Stogy
Posts: 4
Joined: Sun Jan 07, 2018 9:12 pm

Wifi not working on Pi Zero W [solved]

Sun Jan 07, 2018 9:20 pm

Hi,

So I recently got the Raspberry Pi Zero W and tried to setup the wifi. Don’t have a cable for monitor/usb so decided to try headless.

Created the file ssh and wpa_supplicant.conf

Code: Select all

network={
    ssid="Wifi name"
    psk="Password"
    key_mgmt=WPA-PSK
}
However it doesn’t show up in my router list, so I cannot ssh into it. When I check the SD the files ssh and wpa_supplicant.conf are gone, and according to the documentation that should happen. So I would have thought it would work.

Also tried PiBakery to set it up but that doesn’t make it connect either. Anybody knows why ?

pcmanbob
Posts: 9483
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Wifi not working on Pi Zero W

Sun Jan 07, 2018 11:30 pm

Your wpa_supplicant.conf needs to contain this.

Code: Select all

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

network={
    ssid="Wifi name"
    psk="Password"
    key_mgmt=WPA-PSK
}
you may need to change the country code from GB to one matching your location.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Stogy
Posts: 4
Joined: Sun Jan 07, 2018 9:12 pm

Re: Wifi not working on Pi Zero W

Mon Jan 08, 2018 12:26 am

pcmanbob wrote:
Sun Jan 07, 2018 11:30 pm
Your wpa_supplicant.conf needs to contain this.

Code: Select all

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

network={
    ssid="Wifi name"
    psk="Password"
    key_mgmt=WPA-PSK
}
you may need to change the country code from GB to one matching your location.

Tried this but it’s still not working

pcmanbob
Posts: 9483
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Wifi not working on Pi Zero W

Mon Jan 08, 2018 9:40 am

Did you make any other changes yourself or using PiBakery ?
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

mattmiller
Posts: 2243
Joined: Thu Feb 05, 2015 11:25 pm

Re: Wifi not working on Pi Zero W

Mon Jan 08, 2018 11:50 am

Trying to get a PiZeroW working on WiFi is a real chicken/egg scenario as you really have to KNOW that your wpa_supplicant.conf file is valid

One little missing " or 1 char mistake in the SSID or password and it won't work.

Get the file right and your 99.9999% guaranteed sucess

Note: The PiZero (and Pi3) built in antenna is a bit small compared to a WiFi dongle so you may find that it has to be a bit closer than other devices to your router

And as always, if any device is having trouble connecting to a router - switch the router off and on :)

Stogy
Posts: 4
Joined: Sun Jan 07, 2018 9:12 pm

Re: Wifi not working on Pi Zero W

Mon Jan 08, 2018 12:27 pm

Apparently the country setting was the fault here. I removed th country line and it works fine now.
I’m from the Netherlands so i added country=NL but that didn’t work nor did any other country. Not sure why.

mattmiller
Posts: 2243
Joined: Thu Feb 05, 2015 11:25 pm

Re: Wifi not working on Pi Zero W

Mon Jan 08, 2018 12:37 pm

Interesting - as an experiment (in case was an issue when file being edited before sticking into your Pi)

Can you now edit it on your working Pi

Code: Select all

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
and stick the country line back in and see what happens when you reboot?

Stogy
Posts: 4
Joined: Sun Jan 07, 2018 9:12 pm

Re: Wifi not working on Pi Zero W

Mon Jan 08, 2018 5:40 pm

pcmanbob wrote:
Mon Jan 08, 2018 9:40 am
Did you make any other changes yourself or using PiBakery ?
I tried PiBakery but that didn’t work at all for me.
mattmiller wrote: Interesting - as an experiment (in case was an issue when file being edited before sticking into your Pi)

Can you now edit it on your working Pi

Code: Select all

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
and stick the country line back in and see what happens when you reboot?
If I put the country line back in it crashes the Wifi again and won’t connect. Which is weird, but I found my fix I guess.

User avatar
PiBakery
Posts: 24
Joined: Sat May 21, 2016 4:55 pm
Location: Edinburgh
Contact: Website

Re: Wifi not working on Pi Zero W

Wed Jan 10, 2018 1:32 am

Interesting, so just to clarify it was adding the two lines

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
that made it work?

If that's the case I'll add it to the next update of PiBakery.
PiBakery - The easiest way to setup a Raspberry Pi
www.PiBakery.org
@PiBakery

dad2four
Posts: 26
Joined: Tue Jan 16, 2018 3:40 am

Re: Wifi not working on Pi Zero W

Tue Jan 16, 2018 11:27 pm

Just to add my .02. I'm a total failure as well. Went back for a second pi to be sure the first wasn't bad. Still can't get headless to work. I'm using the hotspot on my phone to be sure I can see the device if it connects. No love. I even went with Jessie lite to be sure this wasn't a stretch problem. I'm using a 1.1 zero if it makes a difference.

mattmiller
Posts: 2243
Joined: Thu Feb 05, 2015 11:25 pm

Re: Wifi not working on Pi Zero W [solved]

Wed Jan 17, 2018 7:17 am

Went back for a second pi to be sure the first wasn't bad.
To try and sort it out - can you take the password off your phone hotpsot and then us know what SSID you've set it to (the real actual one)

(If you actual password is something like 0123456789 then don't bother removing it - just tell us what it is :)

We can then make a working wpa_supplicant file for you and eliminate that as source of the problem

dad2four
Posts: 26
Joined: Tue Jan 16, 2018 3:40 am

Re: Wifi not working on Pi Zero W [solved]

Thu Jan 18, 2018 8:23 pm

The issue I was having was that I run a VPN on my phone. I turned the VPN off and everything was fine.

karon
Posts: 1
Joined: Tue Feb 13, 2018 8:04 pm

Re: Wifi not working on Pi Zero W [solved]

Tue Feb 13, 2018 8:08 pm

Hello,
Same issue with pi zero w and pibakery
added these lines to wifi py script (forgot his name) :

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=FR
and it works fine :)

thanks for pibakery, great idea !

Return to “Troubleshooting”