DEV Community

Arsenii Kharlanow
Arsenii Kharlanow

Posted on

Raspberry Pi. Connect to hidden WiFi

A few days ago I faced a weird issue with connecting my Raspberry Pi to my WiFi after changing some settings on my router.
I spent a few hours before I realized that the cause of the problem is in that I disabled broadcast SSID. Therefore all others devices connect to a hidden network without any issues.

I have started to find out about the way of connecting to WiFi using CLI.

The first thing that I learn is that the connection config is stored in the file:
/etc/wpa_supplicant/wpa_supplicant.conf

My file when I use broadcast SSID on the router:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=HR

network={
    ssid="MyWiFi"
    psk="123456"
    key_mgmt=WPA-PSK
}
Enter fullscreen mode Exit fullscreen mode

And I didn't have any issues with this config before disabled broadcast SSID on my router.

After spending some reading forums I found one parameter that was missed in my config:

scan_ssid=1

After updating my config (In addition, I removed country=HR), Raspberry connected to the WiFi after rebooting.

Now my wpa_supplicant.conf looks:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    scan_ssid=1
    ssid="MyWiFi"
    psk="123456"
    key_mgmt=WPA-PSK
}
Enter fullscreen mode Exit fullscreen mode

I hope this simple solution will help someone save time during configuring WiFi.

Top comments (0)