1

I have a Pi Zero W running a fully up-to-date version of Raspbian (buster).

For some reason, the Zero isn't reliably connecting to my wifi. I followed the wifi configuration steps here. I've also watched a few video tutorials.

pi@pizero:~ $ sudo cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
    ssid="MY SSID"
    psk="MY PASSWORD"
}

Sometimes I'll boot the Pi and it simply will not connect to wifi. Once it gets into that state my only option is to manually re-create the wpa_supplicant.conf file on the boot image sd card. That will work for a few boots... and then I'm back to having to manually update the sd card again. That is the only way I can get the Pi to connect to Wifi again. The boot image doesn't have an /etc directory so I can't examine the wpa file. The Pi is headless so the only way I can connect is via ssh over Wifi.

Am I missing something obvious? Thank you in advance!

  • How's your network setup? As in are the 2 4ghz and 5ghz bands broadcast as separate APs. The pi zero can only connect to 2.4ghz networks. If the network is a combination of 5/2.4ghz then that might explain the issue as it might not be getting the correct signal from the router all the time hence it connecting/not connecting on and off. – rohtua Sep 2 at 16:52
  • @rohtua Thank you for your comment. I switched my network to use 2.4 ghz only and the problem persists. – Offswitch Sep 3 at 8:14
  • OK so we can rule that out. Have you established whether the pi is actually connecting to the network? Can you ssh in when no monitor etc is plugged in. Also does the same behaviour occur when the pi is wired into the network? – rohtua Sep 3 at 16:59
  • Why do you have to re-create the wpa_supplicant.conf file on the boot image sd card? Is the current /etc/wpa_supplicant/wpa_supplicant.conf missed or corrupted or changed? When WiFi fails, then check with journalctl -b | grep wpa_supplicant what error messages do you find and tell us. – Ingo Sep 5 at 11:30
  • @Ingo Why do I recreate it? Because that is the only way I can get the Pi to connect to Wifi again. The boot image doesn't have an /etc directory so I can't examine the wpa file. The Pi is headless so the only way I can connect is via ssh over Wifi. – Offswitch Sep 6 at 12:40
2

It may be possible that wpa_supplicant is modifying its configuration file for some reason to permanently store configuration changes but with the change it will not work anymore. This is manged by the option:

update_config=1

Set this option to 0. This will wpa_supplicant prevent to change its configuration file so you have excluded this possebillity.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.