No frozen Raspberry´s anymore

I use my Raspberry Pi Zero W (the first Zero model without WiFi and without installed GPIO pins) as network camera for hedgehogs and as CUPS print server, since my printer at home is not switched on for 24 hours (because we print something at most every few days).
From the first boot it worked very unreliable. Actually only the network connection via WiFi kills itself every now and then. There is just no pattern to detect. Sometimes it runs for several days until failing the network connection, then it runs just for some minutes before trying to make me angry when working on something and throwing my out of the system until I´ll reboot it.

1. Enable watchdog and reboot your Pi. It´s essential for the system to see the hardware devices.

pi@rpi0:~ $ sudo vim /boot/config.txt

# enable watchdog
dtparam=watchdog=on

2. Install watchdog

pi@rpi0:~ $ sudo apt update
pi@rpi0:~ $ sudo apt install watchdog

3. Configure watchdog, just uncomment at least the following lines in /etc/watchdog.conf. Every line is commented, it shouldn´t be a big problem to understand what the options are standing for.

pi@rpi0:~ $ sudo vim /etc/watchdog.conf

watchdog-device  = /dev/watchdog
watchdog-timeout = 15
log-dir          = /var/log/watchdog
realtime         = yes
priority         = 1

4. Optional you can add some more checks to it but the ones above should already do the job.

pi@rpi0:~ $ sudo vim /etc/watchdog.conf

ping        = 192.168.1.1
ping-count  = 3
interface   = wlan0
max-load-1  = 24
max-load-5  = 18
max-load-15 = 12

5. Enable, start and check the service for watchdog

pi@rpi0:~ $ sudo systemctl enable watchdog
pi@rpi0:~ $ sudo systemctl start  watchdog
pi@rpi0:~ $ sudo systemctl status watchdog

I am curious how the Pi will behave in the next days and weeks. If this works I’ll implement it on every Raspberry in the house.

Update: My Pi Zero works great with watchdog enabled, I implemented it on all my other Raspberries. So far no issues but properly working devices 🙂