Hardware watchdog
A hardware watchdog is a digital clock that needs to be regularly restarted before it reaches a certain time.
Just like in the TV series Lost, there is a dead man's switch hidden on the island that needs to be pressed at regular intervals; otherwise, an unknown event will begin. In terms of the Broadcom GPU, if the switch is not pressed, it means that the system has stopped responding, and the reaction event is to restart Raspberry Pi and reload the operating system with the expectation that it will resolve the issue, at least temporarily.
Raspbian has a kernel module included—which is disabled by default—that deals with the watchdog hardware. A configurable daemon that runs on the software layer sends regular events (like pressing a button), referred to as a heartbeat to the watchdog, via the kernel module.
Enabling the watchdog and daemon
To get everything up and running, we need to do a few things, as follows:
- Add the following in the console:
sudo modprobe...