Weird Wifi problem Pi Zero W

Aug 25, 2024 Last reply: 1 year ago 10 Replies

I have a Pi Zero W with a weird Wifi issue.



The Pi runs an SSH gateway and is powered from a USB port on the router. It's been running faultlessly for about 2years now with a few tweaks to the standard setup to mount regularly written to files on a ramdisk to preserve the SDcard. The system reboots every 24hrs as a simple way of stopping the ramdisk filling up.



After a new router was installed, this Pi has issues connecting to Wifi.



Power it up and there's a 75% chance it will connect. If it doesn't removing and reapplying power makes it likely to connect. If you reboot it from the command line it fails to connect most times.



I have a spare Pi Zero W and swapped the SDcard into the spare. Connects every time on reboot or on power-cycle. I place another SDcard in the intermittent one and the same Wifi connection problem exists. One card is Debian 12 with NetworkManager and one is Debian 11 with old style networking setup.



The fault moves with the Pi and doesn't seem to be software dependent. Using Debian 12 and checking with a USB Ethernet connection the Wifi fails with "could not activate connection: Activation failed: secrets were required but not provided" even though the password is set and has connected. I've checked there's no dust/dirt or other contamination on the PCB. I've powered it from several different USB ports (desktop, router, phone charger). The rest of the Pi seems to work fine when the Ethernet connection is in use. Or when it was in an original Pi Model A with a USB Wifi dongle, it boots and the Wifi connects. The software image appears OK. It's just this Pi Zero W with iffy Wifi.



Has anyone seen anything like this? Most annoying. Any ideas?


My guess, and its no more than that, is that the new router is negotiating connections in a different way than the old.

All routers have options for what they will accept and it may be that your new router is set to either deprecate or entirely reject the particular security protocol your pi uses. Another possibility is that you have set the router to a channel that is not legally permitted as far as your Pi is concerned.

I would start by documenting what exact settings the old router was using and exactly duplicating them in the new.

I have found WPA-PSK to be a reliable security protocol to use. On channel 13 with European channels enabled

Also test the PI Zero W against other wifi access points. A moblile phone often is useful in this context.

If the Zero W does prove terminally recalcitrant, life is too short, Buy another one :-)

First things first the Zeros are 2.4GHz only. Maybe you don't notice iffy

2.4GHz signal on devices that support 5GHz?

I suppose it's possible to get a static zap into the RF frontend, which might degrade reception without entirely killing it. Newer Pis have a screened RF section which may help prevent static zapping, but there may still be exposed pads (eg the antenna test points).

As has already been said, if you've narrowed it down to the hardware then there's nothing for it but to replace it (and perhaps relegate the old one to some use that doesn't need wifi). The current Zero 2 W is much nicer than the original Zero, btw.

Theo

About a year ago I got three Pi Zero W. They were intended for use as birdbox cameras. When testing them indoors one of them had substantially shorter "range" than the others, so short that it could not be used as intended. Got it replaced from ThePiHut without any problems.

Rebooting is always has a risk of failure, so I suggest looking in to cleaning out the RAM disc using a cron job. logrotate is very useful.

My original Raspberry Pi in the shed (Pi B 256MB with WiFi dongle) used to have a poor signal which seemed to degrade over time, so I put it only a daily reboot, and it got less and less reliable reconnecting and often just wouldn't come back up without a power cycle, so I stopped that. Turns out it was the WiFi dongle, problem went away when I upgraded to a Pi 3 with it's own WiFi.

It does sound like that Pi is at fault, and maybe you should retire it, or move it to other duties. Pi zeros are cheap, so is not great loss.

I did have reliability problems with two camera Pi Zeros a couple of years ago when if the router rebooted (including when you changed the configuration), they wouldn't reconnect and had to be power cycled. But that did turn out to be software, as it stopped at some point and the are still working fine to this day.

That's not something I've seen before.

---druck

Perhaps not enough enthropy in /dev/random for wpa_supplicant to work? I had that problem initialising the Pi Zero W's WiFi from scratch via custom scripts on Linux, fixed by using Haveged to fill the enthropy pool quicker. NetworkManager in Debian is the other end of the spectrum so far as ways of setting WiFi up go though. It probably already has that sorted out.

Is that really worth the trouble? They’re so cheap to replace.

Yes. It's not the cost of a new SDcard that is the issue it's the convenience. If I'm working away from home and want to access the home equipment then I can. If the SDcard fails through write failure and I'm away and in a time zone 8-10hrs different then my lovely wife will not be pleased if I ring her at 3am her time and ask her to get up and swap the SDcard! You can guarantee it will fail at the least convenient time.

Anyway, it's a few lines changed in /etc/mtab to mount bits of /var on the ramdisk.

Yes. I became used to having a low power, always-on SSH server at home so used it quite a lot. I bought a spare as Zeros are so cheap "just in case". That spare is now in service and I've ordered another.

I did some experiments last night to confirm it's the Zero W Wifi that is at fault. Essentially it is random whether the built in Wifi will connect on power up or reboot.

[snip]

A new RPi Zero W arrived today. I took the SDcard from the unreliable Pi and put it into the new one. Successful Wifi connection on every reboot. The other Pi has been labelled as iffy and put in the box of things that might be useful one day.

Well, equipped with a suitable dongle (erhernet or wifi) it is probably just fine...

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required