Ferdinand Keil's

electronic notes

Apr 06, 2020

Enabling the Watchdog on a Raspberry Pi

To increase the reliability of embedded systems - especially ones that are hard to physically access - one can use an embedded watchdog. The watchdog, once activated, will reset the system if it is not fed for a certain time-interval. This guarantees a clean reset in case the system ends up in an unresponsive state.

Luckily, the Raspberry Pi comes with a watchdog unit and with recent versions of Raspbian it is easier than ever to enable it:

echo "RuntimeWatchdogSec=10s" | sudo tee -a /etc/systemd/system.conf

I am note sure if rebooting is necessary afterwards, but it certainly doesn't hurt. The watchdog module is already included in the kernel and systemd will take care of feeding it.

A bash fork bomb can be used to test it. The system should reset and reboot a few seconds after the command was executed.

:(){ :|:& };: # bash fork 💣