Getting wlan0 to see hidden SSID

I have an issue getting my PiAware box to connect to our hidden SSID.

I didn’t have that issue with the last update which was 2.1-2 but the new 2.1-5 software doesn’t appear to let me enter a SSID which is hidden at work.

I tried the suggestion in the wlan0 “Setup help” thread from Devonian (dated Tue Jan 19, 2016 8:03 am) below but the file won’t load. Probably a syntax error of some type.

His post states…

"If I remember correctly, this worked for me,

sudo nano /etc/network/interfaces

add…

auto wlan0
iface wlan0 inet dhcp
wpa-ssid my-router-ssid
wpa-psk my-router-password

(substitute my-router-ssid and my-router-password for your own router’s ssid and password)

save and close

check it with

sudo ifup wlan0

reboot and check if it auto connects.

sudo reboot

HTH

Nigel."

The current /etc/network/interfaces file has the following for the wlan0 entry

auto wlan0
allow_hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Any suggestions on how to add the Nigel text and make it work or get the startx app to allow hidden SSID entry?

Thanks!

Lowell

You can still add the lines you had before to replace the use of wpa_supplicant.conf in the interfaces file. However, such use is now deprecated and the use of wpa_supplicant is preferred.


auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
        wpa-ssid "NETWORK_NAME"
        wpa-psk "NETWEORK_PASSWORD"

Instead you can leave that file alone and, at it’s very simplest, add the following to the bottom of whatever is already in wpa_supplicant.conf


$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf


network={
ssid="NETWORK_NAME"
psk="NETWORK_PASSWORD"
}

Thanks for the suggestions but neither option works.

During boot on the working 2.1-2 and the newly loaded 2.1-5 SD cards, the following line appears right after the kernel load.

ok ] Setting kernel variables …done
…] Configuring network interfaces…wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
done.

The 2.1-2 card connects because I was able to set up the hidden SSID in the startx gui. I can’t logon because something has happened to the password.

When I try the add to /etc/network/interfaces there are red FAIL messages further down the boot code. Neither option allows the wlan0 to work.

Lowell

If you’re using the method of specifying wpa-psk in /etc/network/interfaces, the field should not be the wifi password itself, but the key provided by the wpa_passphrase command. See wiki.debian.org/WiFi/HowToUse#wpasupplicant.

I reloaded the 2.1-5 update to the SD card and the issue with the wpa_supplicant daemon occurs on first boot.

ok ] Setting kernel variables …done
…] Configuring network interfaces…wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
done.

Perhaps this is something that needs addressed at the next update!

Thanks to those who commented!

Lowell

I don’t think this is anything to do with 2.15. Many folks are using it, including me, with no problems. Perhaps there is an issue with your USB wifi?

Try running:


lsusb

You should see a line in the result that describes your wifi adapter.

You don’t have to use wpa_supplicant. Remove it from your interface file and use the old method. If that doesn’t work either then suspicion again falls on the usb. Also, have you run sudo apt-get update and sudo apt-get upgrade recently to bring your system up to date?

I’ll try that but my Wifi works even with the error on boot. Unless you’re watching the boot on a monitor, there’s no indication that the wpa_supplicant daemon fails to start.

I think that’s why the earlier recommended code to wpa_supplicant doesn’t work.

I have yet to try downloading the Network Manager to add the hidden SSID but will try this weekend.

Your question about getting the updates is my original problem. The unit sits behind a corporate fire wall and if I try to perform the update using the ADS-B page “Send Command” option, the file download(s) to the Pi-Aware unit fails.

Thanks for your help!

Lowell

The network block in your wpa_supplicant.conf file must contain


scan_ssid=1

to connect to a hidden network. This is in addition to manually entering the SSID and encryption type and key into that file.

When the SSID is hidden, the beacon packets from the router do not have a SSID. scan_ssid makes the card send out a probe packet (Is anyone here 'My Secret Network") to make your router reveal itself as the one having that SSID. Anyone monitoring with a raw packet monitor will see that exchange and your SSID is not secret any more.

Pre-hashing the key with wpa_passphrase is recommended but not required. The hashing process is designed to use a lot of CPU time to make a dictionary attack more difficult. On a Pi it takes about a second to do the hash, this will be required each time you boot up if the key is stored as a passphrase text instead of pre-hashed.

If you have an old router that you can set up for a test, first set it with a non-hidden SSID and confirm that your Pi can at least connect to it. Then change to hidden SSID and see if that still works. The test router does not need to be connected to the Internet, so there is no security risk. Edit: If you do this you may need to do it at home. Some of the more sophisticated work networks detect unauthorized wifi signals and jam them.