TurdFarmer
Posts: 4
Joined: Thu Jul 18, 2019 8:16 pm

Stretch won't connect to hidden SSID (I've searched high and low)

Fri Jul 19, 2019 2:53 pm

I have 4 brand new Model 3 B+ that I'm trying to join to my work's network. It's a hidden SSID with no DHCP (please don't tell me that there's no point in having a hidden SSID. I can't change this so all that's moot). I have about 12 older Pi's running Jessie and they're joined to the network just fine, as are other devices, so whatever's happening is strictly related to these Model 3 B+ running stretch (version 9). I've been through so many different articles and forums, even mirroring the config from the older Pi's. Unfortunately I'm unable to run Jessie on the new Pi's because they won't boot. As I understand it the newer hardware doesn't support the older OS. Here's what I've done so far:

1. Modify the wpa_supplicant file to join to the wifi
2. Modify the dhcpcd file to assign IP
The result was the RPI could "see" the hidden SSID now but didn't seem to be correctly "associated" with it. The fact that I could "see" the SSID leads me to believe that the wpa_supplicant file must be set up correctly or else I wouldn't see the SSID. Additionally, the wifi controller shows the RPI as "associated" with the network but it shows the RPI's IP is 0.0.0.0. When I run ifconfig wlan0 I don't see an IP address. When I say the RPI can "see" the hidden SSID, what I mean is that when I click on the network icon at the top right and look for wifi networks, I can see the hidden SSID.
When the wpa_supplicant file is unmodified I cannot see the hidden network. I banged away at these configs, trying different things but nothing worked so I gave up and tried other things (further below). Immediately below are the wpa_supplicant and dhcpcd configs

wpa_supplicant.conf:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
ssid="our hidden ssid"
scan_ssid=1
psk="our passphrase"
key_mgmt=WPA-PSK
}

dhcpcd.conf: (most of this is the default, commented out config. I'm only including the uncommented section)
static ip_address=10.x.x.x
static routers=10.x.x.x
static domain_name_servers=8.8.8.8


When the above failed I figured I would try to recreate the same config that we used for Jessie. That's below:

1. Modify interfaces file

auto lo
iface lo inet loopback

iface eth0 inet manual

allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 10.x.x.x
netmask 255.255.255.0
dns-nameservers 8.8.8.8
gateway 10.x.x.x
wpa-scan-ssid 1
wpa-ap-scan 1
wpa-key-mgmt WPA-PSK
wpa-proto RSN WPA
wpa-pairwise CCMP TKIP
wpa-group CCMP TKIP
wpa-ssid "Hidden SSID"
wpa-psk (converted passphrase to HEX)

This is the only config that's modified on the older RPI's. When I attempt to use this method it seems to "break" the network adapter. When I click on the network icon I get a message that says "No wireless interfaces found".


Any guidance is appreciated.

thanks
Last edited by TurdFarmer on Fri Jul 19, 2019 7:10 pm, edited 2 times in total.

drgeoff
Posts: 9595
Joined: Wed Jan 25, 2012 6:39 pm

Re: Stretch won't connect to hidden SSID (I've searched high and low)

Fri Jul 19, 2019 4:22 pm

1. Do not put the IP parameters in the interfaces file. Use the dhcpcd.conf file.

2. The ip_address line requires the appropriate /x at the end of the dotted quad. Eg /16 where the equivalent netmask would be 255.255.0.0

3. Hiding the SSID does not increase security and just causes more problems.

TurdFarmer
Posts: 4
Joined: Thu Jul 18, 2019 8:16 pm

Re: Stretch won't connect to hidden SSID (I've searched high and low)

Fri Jul 19, 2019 7:06 pm

Thanks,
Unfortunately this didn't work for me. Here's the config files

1. Do not put the IP parameters in the interfaces file. Use the dhcpcd.conf file. - Done
2. The ip_address line requires the appropriate /x at the end of the dotted quad. Eg /16 where the equivalent netmask would be 255.255.0.0 - Done. Thanks for this confirmation

dhcpcd.conf:
interface wlan0
static IP_address=10.x.x.x/24
#static IP6_address=blah blah blah
static routers=10.x.x.1
static domain_name_servers=8.8.8.8

wpa_supplicant.conf:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

#network={
# ssid="Hidden SSID"
# scan_ssid=1
# psk="password"
# key-mgmt=WPA-PSK
#}

interfaces:
auto lo
iface lo inet loopback

iface eth0 inet manual

#allow-hotplug wlan0
#iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

auto wlan0
allow-hotplug wlan0
#iface wlan0 inet static
#address 10.x.x.1
#netmask 255.255.255.0
#dns-nameservers 8.8.8.8
#gateway 10.x.x.1
wpa-scan-ssid 1
wpa-ap-scan 1
wpa-key-mgmt WPA-PSK
wpa-proto RSN WPA
wpa-pairwise CCMP TKIP
wpa-group CCMP TKIP
wpa-ssid "Hidden SSID"
wpa-psk HEX passcode


Tried restarting networking services and restarting RPI, but I'm still getting the error "no wireless interfaces found" and it doesn't "see" the SSID.

Thanks for your efforts

epoch1970
Posts: 3333
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Stretch won't connect to hidden SSID (I've searched high and low)

Fri Jul 19, 2019 7:41 pm

Remove everything you added to /etc/network/interfaces.
Everything.

Insert configuration in files /etc/wpa_supplicant/wpa_supplicant.conf
and in /etc/dhcpcd.conf

The current official documentation about network configuration is still relevant for Stretch, Buster introduced no changes.
Jessie and Stretch do differ, esp. by the fact the interfaces file was still used in Jessie, and no longer in Stretch.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

TurdFarmer
Posts: 4
Joined: Thu Jul 18, 2019 8:16 pm

Re: Stretch won't connect to hidden SSID (I've searched high and low)

Fri Jul 19, 2019 9:35 pm

Thanks for this info. I've made a few changes to different configs so to be sure I just wiped the card, reloaded stretch via noobs. It's right out of the box except for the changes below:

DHCPCD:
interface wlan0
static IP_address=10.x.x.x/24
#static IP6_address=blah blah blah
static routers=10.x.x.1
static domain_name_servers=8.8.8.8

wpa_supplicant:

ctrl_interface=DIR=/var/run/wpa_supplicant.conf
update_config=1
country=US

Network={
ssid="Hidden SSID" (with quotes)
scan_ssid=1
psk="password" (with quotes)
key_mgmt=WPA-PSK
}


Those are the only changes made. Still won't connect. I can "see" the hidden network in the network config GUI. Prior to adding the config to wpa_supplicant, I could not see the hidden network. When I look in the wireless controller I see the RPI "associated" with the network, but it shows 0.0.0.0 for the IP. When I run ifconfig wlan0 i don't see an IP address, I only this:

wlan0: flags-4099<UP, Broadcast, Multicast > MTU 1500
ether (mac address) txqueuelen 1000 (ehternet)
Rx packets 12 bytes 1452
Rx errors 0
Tx packets 11
Rx errors 0

thanks again for everyones effort

Andyroo
Posts: 3770
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Stretch won't connect to hidden SSID (I've searched high and low)

Fri Jul 19, 2019 10:20 pm

You may have a case issue.

Code: Select all

interface eth0
static ip_address=192.168.1.10/24
static routers=192.168.1.254
static domain_name_servers=192.168.1.2
Note IP is lowercase- not upper in yours.

By the way - you do not need to hide private IP address ranges - they are not reachable from outside your LAN and it can increase the difficulty of debugging issues :lol:

How did you create these files? Do they have cr/lf or just lf at the end of each line?
Need Pi spray - these things are breeding in my house...

MrEngman
Posts: 3835
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Stretch won't connect to hidden SSID (I've searched high and low)

Fri Jul 19, 2019 10:26 pm

Shouldn't the first line of file wpa_supplicant.conf be

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

Andyroo
Posts: 3770
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Stretch won't connect to hidden SSID (I've searched high and low)

Fri Jul 19, 2019 10:30 pm

Missed that one :oops:
Need Pi spray - these things are breeding in my house...

TurdFarmer
Posts: 4
Joined: Thu Jul 18, 2019 8:16 pm

Re: Stretch won't connect to hidden SSID (I've searched high and low)

Mon Jul 22, 2019 1:35 pm

Andyroo wrote:
Fri Jul 19, 2019 10:20 pm
How did you create these files? Do they have cr/lf or just lf at the end of each line?
I didn't create the files, I did a fresh install of stretch and I modified these two files. Can you elaborate on "Do they have cr/If or just If at the end of each line"?

MrEngman
Posts: 3835
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Stretch won't connect to hidden SSID (I've searched high and low)

Mon Jul 22, 2019 1:48 pm

TurdFarmer wrote:
Mon Jul 22, 2019 1:35 pm
Andyroo wrote:
Fri Jul 19, 2019 10:20 pm
How did you create these files? Do they have cr/lf or just lf at the end of each line?
I didn't create the files, I did a fresh install of stretch and I modified these two files. Can you elaborate on "Do they have cr/If or just If at the end of each line"?
Linux text files, .conf. .txt etc., usually only use lf at the end of each line.

If you edit the files on a Windows machine , depending on the editor you use, they could end up with cr/lf at the end of each line rather than just lf.

On my Windows laptop I use the editor notepad++ and then you can set it up to use Linux end of line format, lf only.


MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

User avatar
Jimblob64
Posts: 15
Joined: Fri May 20, 2016 12:02 am

Re: Stretch won't connect to hidden SSID (I've searched high and low)

Wed Jul 24, 2019 12:29 pm

I assume you tried what I'm about to say worked for me, but it ended up working for me, so just throwing this out as a possibility. I have no idea if it'd work for you, but:

After removing all networks from my wpa_supplicant.conf, and making no other changes to anything network-related at all:

1. Ran "sudo raspi-config" from the command line.
2. Selected "Network Options" and picked "Wi-Fi."
3. Typed in my router's SSID.
4. Typed the Wi-Fi passphrase
5. Selected "Finish."

But since I still hadn't told the Pi it was a hidden SSID, I then needed to open wpa_supplicant.conf one more time, and add: scan_ssid=1 to the network.

That's it, I put nothing else in wpa_supplicant. Saved and closed it, and then typed:
sudo wpa_cli -i wlan0 reconfigure

This Pi (3B running Stretch, and also a 4B with Buster) were then connected to my wpa2-psk hidden-SSID wi-fi, on 2.4 and 5 GHz, whichever band the Pi hardware was able.

The symptoms this procedure fixed:
Seeing the hidden-SSID router in the list of available wi-fi networks, and not connecting to it despite wpa_supplicant having the right SSID, password, and security type. Like, I could select the SSID in the GUI, type in my passkey at the prompt, and it wouldn't connect, even try to connect, or acknowledge I'd just typed something.

(Primary resource for all this: Adafruit's "Setting up Wi-Fi by Hand" tutorial.)
RPi 4B w/ Buster in a toasty little official case, and an RPi 3B w/ Stretch.

Return to “Troubleshooting”