Desiro444
Posts: 15
Joined: Fri Jun 05, 2020 1:35 pm

Raspberry Pi Zero W WiFi problem

Fri Jun 05, 2020 9:13 pm

Hello,

I recently got a raspberry pi zero w. However, I can't get it to connect to my router for an internet connection. I am setting up the raspi in headless mode. When the rpi is powered on, the ACT light flickers around for a minute and then stays on indefinitely. The rpi is not showing up on the router device list. I added the wpa_supplicant.conf and ssh files to the root folder of the boot partition. They are not deleted after first boot, which indicates a problem but I don't know what. Below is the contents of the wpa_supplicant.conf file.

Code: Select all

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

network={
	ssid="[correct ssid]"
	psk="[correct psk]"
	key_mgmt=WPA-PSK
}
Here is what I have tried so far:
  • Change EOL to unix using notepad++
  • Use PiBakery to generate image on microSD card with wifi settings preset
  • Checked if microSD card isn't fake (it isn't)
  • Flashed an older version of raspbian (~2017) onto microSD card
  • Reflashing microSD card
The rpi was flashed using the raspberry pi imager (ex. for 2nd point).

I am unable to connect the rpi to a monitor as I do not have a miniHDMI cable/adapter, nor am I planning to get one.

Any help is appreciated,
-Desiro444

pidd
Posts: 724
Joined: Fri May 29, 2020 8:29 pm
Location: Birkenhead, Wirral, UK
Contact: Website

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 4:25 am

Try taking away the key_mgmt line, you don't need it to get things going.

I'd also take pi_bakery out the equation, just use the pi_imager and create the extra files with notepad++ before first boot.

User avatar
HawaiianPi
Posts: 5888
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 4:50 am

Windows has an irritating default of hiding well known file extensions (like .txt, among others), so your wpa_supplicant.conf file might actually be named wpa_supplicant.conf.txt (which won't work). Turn off that setting in Windows (or otherwise make sure your wpa_supplicant.conf file doesn't end in .txt).

Note that it's okay for the ssh file, because ssh.txt is also acceptable.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

Desiro444
Posts: 15
Joined: Fri Jun 05, 2020 1:35 pm

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 11:42 am

HawaiianPi wrote:
Sat Jun 06, 2020 4:50 am
Windows has an irritating default of hiding well known file extensions (like .txt, among others), so your wpa_supplicant.conf file might actually be named wpa_supplicant.conf.txt (which won't work). Turn off that setting in Windows (or otherwise make sure your wpa_supplicant.conf file doesn't end in .txt).

Note that it's okay for the ssh file, because ssh.txt is also acceptable.
That's not the problem - file explorer warned me that I was changing the extension, so I assume it has been changed.

Desiro444
Posts: 15
Joined: Fri Jun 05, 2020 1:35 pm

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 11:51 am

pidd wrote:
Sat Jun 06, 2020 4:25 am
Try taking away the key_mgmt line, you don't need it to get things going.

I'd also take pi_bakery out the equation, just use the pi_imager and create the extra files with notepad++ before first boot.
I'll try that, however I don't think that's the fix as the wpa_supplicant file should have been deleted/moved after first boot, right?

EDIT: It didn't work.

pidd
Posts: 724
Joined: Fri May 29, 2020 8:29 pm
Location: Birkenhead, Wirral, UK
Contact: Website

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 5:17 pm

Try putting scan_ssid=1 in the network part of the supplicant, not that it should make any difference from your symptoms - but anything is worth a try.

Did you get this new or pre-used, I was wondering if somebody has had a play with the OTP bits?

Desiro444
Posts: 15
Joined: Fri Jun 05, 2020 1:35 pm

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 5:35 pm

pidd wrote:
Sat Jun 06, 2020 5:17 pm
Try putting scan_ssid=1 in the network part of the supplicant, not that it should make any difference from your symptoms - but anything is worth a try.

Did you get this new or pre-used, I was wondering if somebody has had a play with the OTP bits?
Tried that after posting original post, also didn't work.

I bought the raspi brand new from thepihut.com - however this is the second pi zero I got from them as I had to send the first one back, the power microUSB socket wasn't soldered on correctly and wouldn't power on. I am also sure that this is a pi zero w and not a pi zero non-w as the antenna is clearly visible.

pidd
Posts: 724
Joined: Fri May 29, 2020 8:29 pm
Location: Birkenhead, Wirral, UK
Contact: Website

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 6:18 pm

If you want, I could try your image out.

Create your SD (but don't use it)
create an .img from the SD
zip, tar or gzip it up
Upload it to wetransfer
PM me the link

I'll unzip it, put it on SD, edit network setting to mine, plug it in my ZeroW then watch for smoke.

Desiro444
Posts: 15
Joined: Fri Jun 05, 2020 1:35 pm

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 7:04 pm

pidd wrote:
Sat Jun 06, 2020 6:18 pm
If you want, I could try your image out.

Create your SD (but don't use it)
create an .img from the SD
zip, tar or gzip it up
Upload it to wetransfer
PM me the link

I'll unzip it, put it on SD, edit network setting to mine, plug it in my ZeroW then watch for smoke.
I am using the default image provided when flashing with the Raspberry Pi Imager program. It should be replicable on your end using the raspberry pi imager software. I'll send you a zipped file of the wpa_supplicant.conf and ssh files (with all wifi details redacted ofc) shortly.

EDIT: I can't see a PM button anywhere on your profile, here is the zip file that contains the additional files (both files in the zip file go into the boot drive/partition):
additional.zip
(341 Bytes) Downloaded 6 times
Last edited by Desiro444 on Sat Jun 06, 2020 7:07 pm, edited 1 time in total.

User avatar
kerry_s
Posts: 760
Joined: Thu Jan 30, 2020 7:14 pm

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 7:07 pm

just to rule out, you are connecting to 2.4ghz right?

Desiro444
Posts: 15
Joined: Fri Jun 05, 2020 1:35 pm

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 7:11 pm

kerry_s wrote:
Sat Jun 06, 2020 7:07 pm
just to rule out, you are connecting to 2.4ghz right?
Yes, my router has both 5ghz and 2.4ghz on one network connection/ssid (plusnet hub one router).

User avatar
kerry_s
Posts: 760
Joined: Thu Jan 30, 2020 7:14 pm

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 7:33 pm

Desiro444 wrote:
Sat Jun 06, 2020 7:11 pm
kerry_s wrote:
Sat Jun 06, 2020 7:07 pm
just to rule out, you are connecting to 2.4ghz right?
Yes, my router has both 5ghz and 2.4ghz on one network connection/ssid (plusnet hub one router).
pi0w does not have 5ghz, on my mesh there is a setting(smart assistant) that allows 2.4ghz devices to be discovered, i have to enable it for any device that only supports 2.4ghz.

yours might be something similar.

Desiro444
Posts: 15
Joined: Fri Jun 05, 2020 1:35 pm

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 7:35 pm

kerry_s wrote:
Sat Jun 06, 2020 7:33 pm
Desiro444 wrote:
Sat Jun 06, 2020 7:11 pm
kerry_s wrote:
Sat Jun 06, 2020 7:07 pm
just to rule out, you are connecting to 2.4ghz right?
Yes, my router has both 5ghz and 2.4ghz on one network connection/ssid (plusnet hub one router).
pi0w does not have 5ghz, on my mesh there is a setting(smart assistant) that allows 2.4ghz devices to be discovered, i have to enable it for any device that only supports 2.4ghz.

yours might be something similar.
according to plusnet, it automatically switches (smart wireless). either way, on the router device list all devices are connected under 2.4ghz so shouldn't be a problem there.

pidd
Posts: 724
Joined: Fri May 29, 2020 8:29 pm
Location: Birkenhead, Wirral, UK
Contact: Website

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 7:57 pm

SD card worked with those files appended BUT, it took forever because it does the partition resize and maybe fsck or whatever.

It had me fooled, flashing away for about a minute, then I got diverted as I shutdown the wrong computer, came back to the ZeroW and green light was off, checked a few bits and pieces and my router, it definitely looked like it had switched off. Went to look for hdmi cable to see what it was doing - this took a while as I got a Pi4 cable the first time and I thought other half had set kitchen on fire but when I got back green light was on, it was logged into my router and I putty'd straight into to it, files are gone from root.

I don't know how long this took as I was diverted a couple of times but it could have been ten minutes or even a little longer, it wasn't quick.

Desiro444
Posts: 15
Joined: Fri Jun 05, 2020 1:35 pm

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 8:04 pm

pidd wrote:
Sat Jun 06, 2020 7:57 pm
SD card worked with those files appended BUT, it took forever because it does the partition resize and maybe fsck or whatever.

It had me fooled, flashing away for about a minute, then I got diverted as I shutdown the wrong computer, came back to the ZeroW and green light was off, checked a few bits and pieces and my router, it definitely looked like it had switched off. Went to look for hdmi cable to see what it was doing - this took a while as I got a Pi4 cable the first time and I thought other half had set kitchen on fire but when I got back green light was on, it was logged into my router and I putty'd straight into to it, files are gone from root.

I don't know how long this took as I was diverted a couple of times but it could have been ten minutes or even a little longer, it wasn't quick.
Over here, the LED flashes irregularly for about a minute and then sticks on. There is one point during the boot procedure where the LED stays off for about a dozen seconds. I left mine on for about 15 minutes with no result. I'll try again anyways and edit this post if this changes.

EDIT: 20 minutes, still not showing. Absolutely no flickering on the steady on ACT LED.
EDIT 2: Pulling the plug at 36 minutes.
Last edited by Desiro444 on Sat Jun 06, 2020 8:38 pm, edited 2 times in total.

pidd
Posts: 724
Joined: Fri May 29, 2020 8:29 pm
Location: Birkenhead, Wirral, UK
Contact: Website

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 8:22 pm

Just for reference, I used the lite image and the SD card was a 32GB Samsung Evo Plus as someone said they are fast.

The time I had was 12 minutes +/- a minute, I started on a digital clock at 2038 and glanced at an analogue clock at 2050 it could have finished before then, no idea.

No weird characters or spaces in your SSID or PSK?

Desiro444
Posts: 15
Joined: Fri Jun 05, 2020 1:35 pm

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 8:30 pm

pidd wrote:
Sat Jun 06, 2020 8:22 pm
Just for reference, I used the lite image and the SD card was a 32GB Samsung Evo Plus as someone said they are fast.

The time I had was 12 minutes +/- a minute, I started on a digital clock at 2038 and glanced at an analogue clock at 2050 it could have finished before then, no idea.

No weird characters or spaces in your SSID or PSK?
I have checked the wifi details repeatedly, no errors.

It can't be the validity of the credentials anyways, as the files are not disappearing from the root folder of the boot partition.

User avatar
HawaiianPi
Posts: 5888
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 8:58 pm

Desiro444 wrote:
Sat Jun 06, 2020 8:30 pm
It can't be the validity of the credentials anyways, as the files are not disappearing from the root folder of the boot partition.
That's what's really odd. If your Pi0W is booting those files should not remain in the boot partition.

Are you putting them in the main directory of the small FAT32 "boot" partition, and not in any folder?
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

Desiro444
Posts: 15
Joined: Fri Jun 05, 2020 1:35 pm

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 9:00 pm

HawaiianPi wrote:
Sat Jun 06, 2020 8:58 pm
Desiro444 wrote:
Sat Jun 06, 2020 8:30 pm
It can't be the validity of the credentials anyways, as the files are not disappearing from the root folder of the boot partition.
That's what's really odd. If your Pi0W is booting those files should not remain in the boot partition.

Are you putting them in the main directory of the small FAT32 "boot" partition, and not in any folder?
Yes. See screenshot attached.
wpa.PNG
wpa.PNG (8.37 KiB) Viewed 421 times
(the other boot files are there, just cropped out)

JohnSoCalUSA
Posts: 12
Joined: Sun Jul 07, 2019 6:11 pm

Re: Raspberry Pi Zero W WiFi problem

Sat Jun 06, 2020 10:04 pm

I had a similar problem and think it may have been related to my old router/DHCP server.
What worked for me:
Edit the file /boot/cmdline.txt
And add this option ipv6.disable=1

Or
If you have a Rpi3 try booting the card in that and see if there are any error messages.
Assuming you have a full size HDMI cable and TV

Desiro444
Posts: 15
Joined: Fri Jun 05, 2020 1:35 pm

Re: Raspberry Pi Zero W WiFi problem

Sun Jun 07, 2020 9:59 am

JohnSoCalUSA wrote:
Sat Jun 06, 2020 10:04 pm
I had a similar problem and think it may have been related to my old router/DHCP server.
What worked for me:
Edit the file /boot/cmdline.txt
And add this option ipv6.disable=1

Or
If you have a Rpi3 try booting the card in that and see if there are any error messages.
Assuming you have a full size HDMI cable and TV
I doubt it is that either, as the wpa_supplicsnt file should still be moved anyways, right? I'll try it anways, and edit this post with the result.

I only have a broken rpi 1 model b. Can't do.

EDIT: editing cmdline.txt did not work (left the raspi on for about an hour, no connection).

User avatar
HawaiianPi
Posts: 5888
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Raspberry Pi Zero W WiFi problem

Sun Jun 07, 2020 5:35 pm

Without a connection to the Pi0W it will be difficult to troubleshoot. You should try setting up USB Gadget Mode to get SSH access (configuring the Pi0W as a USB-Ethernet gadget will allow you to SSH in over USB).

I have a Raspberry Pi OS image that is pre-configured, if you'd like to give that a try. I have confirmed this image works on a Windows 10 laptop.

Download the image here.
2020-05-27-raspios-buster-lite-armhf_Pi0USB.zip
SHA256 hash sum is: c3986803b8409e03af51b7b66867f0d709ca6dd2e39414e348816d6f0925b64f

  • Write that image to an SD card with Raspberry Pi Imager or Etcher, then put the SD card into the Pi0.
  • Connect a normal micro-USB cable to the Pi0's data USB port (don't connect anything to the power port).
  • Plug the other end of the micro USB cable to a USB port on your main PC, and the Pi0 will start to boot.
  • While booting, a new USB-Ethernet/RNDIS gadget network adapter should be detected.
  • Depending on the speed of your SD card, the Pi0 could take 1-2 minutes for the first boot.
  • After the Pi0 has booted, you should be able to SSH into pi@raspberrypi.local

Hostname resolving (mDNS) is available on updated versions of Windows 10, Mac OS and most popular Linux desktop distros. If you are running an older Windows OS you might need to install additional software (like Apple's Bonjour Print Services for Windows).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

Desiro444
Posts: 15
Joined: Fri Jun 05, 2020 1:35 pm

Re: Raspberry Pi Zero W WiFi problem

Sun Jun 07, 2020 5:48 pm

HawaiianPi wrote:
Sun Jun 07, 2020 5:35 pm
Without a connection to the Pi0W it will be difficult to troubleshoot. You should try setting up USB Gadget Mode to get SSH access (configuring the Pi0W as a USB-Ethernet gadget will allow you to SSH in over USB).

I have a Raspberry Pi OS image that is pre-configured, if you'd like to give that a try. I have confirmed this image works on a Windows 10 laptop.

Download the image here.
2020-05-27-raspios-buster-lite-armhf_Pi0USB.zip
SHA256 hash sum is: c3986803b8409e03af51b7b66867f0d709ca6dd2e39414e348816d6f0925b64f

  • Write that image to an SD card with Raspberry Pi Imager or Etcher, then put the SD card into the Pi0.
  • Connect a normal micro-USB cable to the Pi0's data USB port (don't connect anything to the power port).
  • Plug the other end of the micro USB cable to a USB port on your main PC, and the Pi0 will start to boot.
  • While booting, a new USB-Ethernet/RNDIS gadget network adapter should be detected.
  • Depending on the speed of your SD card, the Pi0 could take 1-2 minutes for the first boot.
  • After the Pi0 has booted, you should be able to SSH into pi@raspberrypi.local

Hostname resolving (mDNS) is available on updated versions of Windows 10, Mac OS and most popular Linux desktop distros. If you are running an older Windows OS you might need to install additional software (like Apple's Bonjour Print Services for Windows).
Thanks, I'll try that now. Assuming this all works, how would I go around connecting the rpi to my router via the CLI?

EDIT: Just remembered about raspi-config. Ignore the second part of my post. I'll edit the post again when I have completed the above steps.
EDIT 2: puTTY threw back a "Connection refused" error when trying to connect to pi@raspberrypi.local

Desiro444
Posts: 15
Joined: Fri Jun 05, 2020 1:35 pm

Re: Raspberry Pi Zero W WiFi problem

Sun Jun 07, 2020 6:10 pm

Desiro444 wrote:
Sun Jun 07, 2020 5:48 pm
HawaiianPi wrote:
Sun Jun 07, 2020 5:35 pm
Without a connection to the Pi0W it will be difficult to troubleshoot. You should try setting up USB Gadget Mode to get SSH access (configuring the Pi0W as a USB-Ethernet gadget will allow you to SSH in over USB).

I have a Raspberry Pi OS image that is pre-configured, if you'd like to give that a try. I have confirmed this image works on a Windows 10 laptop.

Download the image here.
2020-05-27-raspios-buster-lite-armhf_Pi0USB.zip
SHA256 hash sum is: c3986803b8409e03af51b7b66867f0d709ca6dd2e39414e348816d6f0925b64f

  • Write that image to an SD card with Raspberry Pi Imager or Etcher, then put the SD card into the Pi0.
  • Connect a normal micro-USB cable to the Pi0's data USB port (don't connect anything to the power port).
  • Plug the other end of the micro USB cable to a USB port on your main PC, and the Pi0 will start to boot.
  • While booting, a new USB-Ethernet/RNDIS gadget network adapter should be detected.
  • Depending on the speed of your SD card, the Pi0 could take 1-2 minutes for the first boot.
  • After the Pi0 has booted, you should be able to SSH into pi@raspberrypi.local

Hostname resolving (mDNS) is available on updated versions of Windows 10, Mac OS and most popular Linux desktop distros. If you are running an older Windows OS you might need to install additional software (like Apple's Bonjour Print Services for Windows).
Thanks, I'll try that now. Assuming this all works, how would I go around connecting the rpi to my router via the CLI?

EDIT: Just remembered about raspi-config. Ignore the second part of my post. I'll edit the post again when I have completed the above steps.
EDIT 2: puTTY threw back a "Connection refused" error when trying to connect to pi@raspberrypi.local
To summarise what happened when following the steps;
  • RPi booted, USB cable into the USB port NOT power
  • When entering the command

    Code: Select all

    ping raspberrypi.local
    into windows cmd, there is a response
  • PuTTY throws back a "Connection refused" on port 22 error (same with windows cmd ssh command).
Am I doing something wrong?

EDIT: Looking at the boot drive, the ssh file in root has not been deleted/moved, meaning that I can't SSH into the rpi as it won't move the file/change the setting. Don't know how to fix.

User avatar
HawaiianPi
Posts: 5888
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Raspberry Pi Zero W WiFi problem

Mon Jun 08, 2020 12:52 am

Desiro444 wrote:
Sun Jun 07, 2020 6:10 pm
Am I doing something wrong?

EDIT: Looking at the boot drive, the ssh file in root has not been deleted/moved, meaning that I can't SSH into the rpi as it won't move the file/change the setting. Don't know how to fix.
Your Pi0W is not booting properly, but without a screen or serial console cable it will be difficult to determine why. If it was booting, the ssh file would be deleted, so the only logical conclusion is that it is not booting at all, or failing at some point in the boot process. Since you see some LED activity at first, a failed boot seems most likely.

Not really sure what else you can try at this point.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

Return to “Troubleshooting”