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.

Image of Timescale

Timescale – the developer's data platform for modern apps, built on PostgreSQL

Timescale Cloud is PostgreSQL optimized for speed, scale, and performance. Over 3 million IoT, AI, crypto, and dev tool apps are powered by Timescale. Try it free today! No credit card required.

Try free

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

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay