Make use of the Raspberry Pi Hardware Watchdog to automatically restart on hangs

I recently learned about the build-in (hardware) watchdog functionality on raspberry pis to automatically reboot them when something got stuck.
This actually happens to me occasionally when the SSD cannot be written to any more (so far a reboot solved the problem).

Apparently the watchdog needs to be enabled and a watchdog daemon needs to be running - see, e.g., Running forever with the Raspberry Pi Hardware Watchdog

As I am running HAOS I see no way to do this myself and would hope the core team would see this to be a useful addition to HAOS.

See Home Assistant Add-on: Hardware watchdog service

Of course not only for the raspberry hosts but also for odroid and other hardware that comes with a watchdog timer

I would like a watchdog timer to start before any docker or addon is started, should be part of an embedded systems operating system setup I believe.

I’ve found the watchdog command is available on home-assistant os. But it’s very limited and I don’t know if there’s an easy way to start any service on a read-only operating system.

When I am logged into the host I am able to start it (on odroid xu4) with

watchdog -t 5 -T 50 /dev/watchdog 

It’s busybox based and a very limited watchdog command. But it works and I believe we should have an option to use this or something like this (systemd also can talk with the hardware watchdog and could also be used perhaps for some more advanced scenario’s)

In my case I want the host to soft restart cleanly when there’s no internet connection (usb 4g lte router then also gets a power cycle and that might also help being the system back online). So I want a bit more control on how to reboot the system. When the system becomes totally unresponsive I want the hardware watchdog to reboot the system.

1 Like