DEV Community

Arsenii Kharlanow
Arsenii Kharlanow

Posted on

2

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.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay