txtbook
Posts: 4
Joined: Tue Nov 27, 2018 5:02 am

wpa_supplicant.conf not working/connecting

Tue Nov 27, 2018 5:05 am

I'm trying to setup headless config on a new Raspberry Pi Zero W with Raspbian Stretch. I'm adding wpa_supplicant.conf as well as ssh to the boot directory.

I'm using the following code, but I can't see the pi on my network via the Google WiFi app and can't find it with Putty:

Code: Select all

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
	ssid="Network_Name"
	psk="WiFiPassword"
	key_mgmt=WPA-PSK
}

My network is a Google WiFi system which uses WPA2-Personal - does that change what I need to have for key_mgmt? According to my desktop computer, my WiFi is broadcasting 2.4Ghz and 5Ghz, 802.11ac, WPA2-Personal.



It seems like the pi is accessing the wpa_supplicant.conf file because if I take the sd card out and look at it with my computer, it is gone (meaning the OS moved it/used it).

On the pi, I get a flickering green light for maybe 20 seconds, then solid steady green.

I am 110% sure I am using the right SSID and password, and I have made sure everything has the correct capitalization.


Any ideas?

Andyroo

Re: wpa_supplicant.conf not working/connecting

Tue Nov 27, 2018 11:11 am

Are you getting an IP address from the router?

I would check on the router to see if that has issued an IP address first rather than trusting the app. The Pi should pop up on the 2.4Ghz network as your config looks fine bar from one minor difference to mine. The WPA2-Personal is not an issue as it is just another name for WPA2-PSK (Pre-Shared Key).

The only minor difference I can see between your layout and my working one is the location of the country line - no idea if it makes a difference to be honest but may be worth checking :roll:

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB

network={
    ssid="myssid"
    psk=“mypassword”
    key_mgmt=WPA-PSK
}

txtbook
Posts: 4
Joined: Tue Nov 27, 2018 5:02 am

Re: wpa_supplicant.conf not working/connecting

Tue Nov 27, 2018 3:49 pm

Unfortunately in the case of Google WiFi, the app is the interface for the router. When I get home later today, I'll copy paste yours and give it a shot.

txtbook
Posts: 4
Joined: Tue Nov 27, 2018 5:02 am

Re: wpa_supplicant.conf not working/connecting

Wed Nov 28, 2018 12:59 am

Still not working. Should I put "WPA2-PSK" in the key_mgmt?

Here's what I have done:

1. Switched from a iPhone USB charger to a iPad USB charger (more power)
2. Formatted SD card completely
3. Re-downloaded Raspbian with Desktop from this site
4. Use balenaEtcher to put it on the SD card
5. Created and wrote an all new wpa_supplicant.conf file with Notepad++ (see below for code)
6. Created ssh file
7. Loaded it up, watched the green light flicker for 30-60 seconds, then became solid

Code: Select all

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

network={
    ssid="ThisIsMyNetworkName"
    psk=“123456790”
    key_mgmt=WPA-PSK
}
Still can't see the pi on my network, still can't reach it with Putty. Shutting down the pi and looking at the SD card, I can see the ssh and wpa_supplicant.conf files are gone, which I believe tells me the OS is booting and reading the files, then moving them to right place.

I'm going crazy here. What could I be doing wrong?

My SSID has caps in it, like: ThisIsMyNetworkName. I have it in the wpa_supplicant exactly like that, with quotes of course. Does that matter?

The Pi is sitting less than 10 feet with line of sight to my wireless access point.

Ernst
Posts: 1288
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: wpa_supplicant.conf not working/connecting

Wed Nov 28, 2018 7:35 am

txtbook wrote:
Wed Nov 28, 2018 12:59 am

Code: Select all

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

network={
    ssid="ThisIsMyNetworkName"
    psk=“123456790”
    key_mgmt=WPA-PSK
}
I suggest you check the contents of wpa_supplicant.conf because the double quotes used for psk look wrong.
You can see this if you compare the first quote in ssid (") with the first quote in psk (“)
and the second quote in ssid (") with the second quote in psk (”).
This sequence shows the quotes in ssid and psk: ""“”

The double quotes in ssid are correct, the double quotes in psk are wrong.
The road to insanity is paved with static ip addresses

Andyroo

Re: wpa_supplicant.conf not working/connecting

Wed Nov 28, 2018 3:53 pm

That’s odd as mine was a copy and paste to here and then I changed the SSID and password...

Looking at two live boxes here (inc the one I copied this from) they both have normal quotes :?:

User avatar
ChromeBlue
Posts: 20
Joined: Wed Jun 26, 2013 3:26 pm
Location: Hannibal, MO

Re: wpa_supplicant.conf not working/connecting

Sun Feb 16, 2020 2:32 am

Did this ever get resolved because I have the same issue EVERYTIME I try to setup headless. I gave up long ago and just connect via HDMI to a monitor to setup the Pi now. After I get it configured then I can go headless. But what a PIA.
Frito: Yah I know this place pretty good, I went to law school here.

Pvt. Joe Bowers: In Costco?
----------
From Idiocracy - funniest/scariest move ever.

txtbook
Posts: 4
Joined: Tue Nov 27, 2018 5:02 am

Re: wpa_supplicant.conf not working/connecting

Sun Feb 16, 2020 1:12 pm

Yes but so long ago I can’t remember exactly. It was something to do with the country being wrong in the install of the OS, making it unable to see or connect to WiFi.

User avatar
mooblie
Posts: 152
Joined: Fri Oct 14, 2016 2:07 pm
Location: The Scottish Highlands

Re: wpa_supplicant.conf not working/connecting

Sun Feb 16, 2020 4:54 pm

FWIW I can absolutely confirm that if your wpa_supplicant.conf file has been "got at" by a word processor, "helpfully" replacing the double quotes with "pretty ones", then it will fail.

Smart double quotes - what I call 66+99 - WILL FAIL,
Dumb double quotes - what I call 11+11 - are NECESSARY.

Easy to miss this, but once you're looking for it, you can spot it, as did Ernst above.

Naturally, these double quotes all have different ASCII codes, which the parser wants to be right, i.e. dumb!

Return to “Troubleshooting”