1

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=192.168.0.1 static domain_name_servers=192.168.0.1

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 – RubberStamp Nov 25 '17 at 15:23
1

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

    #!/bin/sh
    ping -c1 "yourroutersip"
    if [ $? != 0 ]
    then
      sudo ifconfig wlan0 down
      date >> /home/pi/errors  
      sleep 5
      sudo ifconfig wlan0 up
    fi
  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

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.