I have several Pi Zero W all with the latest Rasbian, running headless. After a few hours I lose the ability to contact them via WiFi or SSH, they are however still running as logs show. Basically I have to reboot them at the power plug. I have swapped SD cards around and power adaptors - I'm sure it's a software setting

I have edited /etc/network/interfaces to include the line wireless-power off and iwconfig | grep "Power Management" shows “Power Management:off” but this has no effect

If its any help I am running them on static IP sudo nano /etc/dhcpcd.conf

interface wlan0

static ip_address=192.168.0.xxx/24 static routers= static domain_name_servers=

Any help gratefully received. Thanks


Rubberstamp - Thanks for the help: with journalctl I get No journal files were found. I can see results in cat /var/log/auth.log (but i have no idea what to look for) and systemctl status dhcpcd (the unit has not shut off reads

dhcpcd.service - dhcpcd on all interfaces Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled) Active: active (running) since Sun 2017-11-26 18:57:12 GMT; 1h 38min ago Process: 371 ExecStart=/sbin/dhcpcd -q -b (code=exited, status=0/SUCCESS) Main PID: 382 (dhcpcd) CGroup: /system.slice/dhcpcd.service └─382 /sbin/dhcpcd -q -b**.

I'm afraid this is all a bit above my pay grade, so thanks for bearing with me

  • What is the output of: journalctl -u ssh --since YYYY-MM-DD and journalctl -u dhcpcd --since YYYY-MM-DD Nov 25 '17 at 15:23

I had the same problems.

Here is what I fond out and how I worked around the loss of wifi

  1. Create errors touch /home/pi/errors
  2. Create /home/pi/resetwifi.sh

    ping -c1 "yourroutersip"
    if [ $? != 0 ]
      sudo ifconfig wlan0 down
      date >> /home/pi/errors  
      sleep 5
      sudo ifconfig wlan0 up
  3. Add entry to run every 5 min in crontab

    crontab -e 
    5 * * * * /home/pi/resetwifi.sh

The errors file shows that my wlan0 is shutting down every hour. I don't know why


I was facing the same problem with rpi0w, it was losing wifi every 2 hours or so. I figured out that the problem was DHCP by looking in the /var/log/syslog, I disabled dhcpd and enabled network interfaces in rpi0w and it has never lost wifi since then. I followed the answer here to configure this and basically involves two steps:

  1. Configure a static network adddress on your Pi in /etc/network/interfaces
  2. Disable the DHCP client daemon and switch to standard Debian networking
  • 2
    Could you add the section in /var/log/syslog/ that lead you to the conclusion?
    – MatsK
    Oct 17 '20 at 3:07
  • It was similar to this here Oct 20 '20 at 7:37

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.