I have a Raspberry Pi 3B that acts as a web server for my temperature sensing network. I also use the same Pi for my Pi Word of the day tweets. It’s been pottering along fine for a long time. But last week we had a power outage while we had smart meters installed.

For ‘network management’ reasons that I won’t go into, I’d recently decided to ‘hide’ the SSID (Service Set Identifier) of the router this Pi was connected to. I had thought it would automatically connect, having been connected before. But it didn’t, so I had to connect a keyboard and screen to the Pi, log into the router, make the SSID visible, then retype the password and let it connect again.

That was all a bit of a faff.

“There has to be a better way. Someone must have done this before!” I want it to be hands-free and automatic on booting.

So I googled “connect to hidden SSID on raspberry pi” and came up with a nice blog page with a procedure in. I tried it on my Pi3 with Jessie (a few months old) but it didn’t work for me (it was a bit out of date). I had a quick glance through the comments on that page and found the magic key which made it work.

scan_ssid=1

Essentially, the ‘secret sauce’ that was needed was to add scan_ssid=1 at line 7 of wpa_supplicant.conf which forces the Pi to scan for the invisible SSID by name. If you’ve logged onto a wifi network before on your Pi, you’ll already have a wpa_supplicant.conf file that looks something like the one below. If you’ve never logged into a wifi network, you’lll probably find lines 5-10 missing.

Either way, if you make your wpa_supplicant.conf file look like the one below, completing your hidden SSID (line 6) and wifi password (line 8), you should find that it now works as it ought. Also check line 3 is correct for your country.

You’ll need sudo to edit wpa_supplicant.conf

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 country=GB network={ ssid="insert_your_hidden_SSID_here" scan_ssid=1 psk="insert_your_wifi_password_here" key_mgmt=WPA-PSK }

And then, it should ‘just work” every time you reboot your Pi. This was first tested using a virgin install of Raspbian Jessie 10th April 2017 edition (not updated/upgraded). I’ve also just tested it on a brand new June 2017 Raspbian. It works perfectly for me on both. Let us know how you get on if you try it.