Octpi on Raspberry Pi 4 WiFi lost overnight

problem: Overnight (when DHCP refreshed) the PI4 disappears from the network. There is not reply to /octopi in browser, it's IP addressin browser, SSH or IP scanner.

What did you already try to solve it? Tested with the methods above. I have observed this behavior from time to time with other Pi running other versions of raspian but never with Octopi. Fix is usually running:

#!/bin/bash

sudo ifconfig wlan0 down

sudo ifconfig wlan0 up

sudo service networking restart

Logs: unsure how to get syslog without GUI

Additional information: Raspberry PI 4 running lasted release candidate of Octopi. Installed from image.

Tell your DHCP server on your network to issue the Pi a static IP address and the problem cures itself.

1 Like

Write a small script that pings Google or something. If it receives no response, it restarts the interface. Run it from cron every 5-10 minutes

I will try this every 10 min. and report back. I am not having a similar problem with OctoPi running on the B 3+

#!/bin/bash
echo 'execute ptest script' >> /home/pi/test.log
count=$(ping -c 3 8.8.8.8 | grep icmp | grep bytes | wc -l)
echo 'result: ' $count >> /home/pi/test.log

if [ $count == 0 ]; then
sudo ifconfig wlan0 down
sudo ifconfig wlan0 up
fi

Sadly (and oddly) that did not help. The log entries showed that there was never an inability to ping 8.8.8.8 yet this morning Octopi was unreachable by Browser or SSH.

UPDATE:

Sadly, I have not found a fix for this problem. I have switched back to my PI B+. Since around 2017 many people have reported this problem or minor variations on it. It is devilishly difficult to reproduce. If anyone has a good idea, I can hook the PI 4 back up again.