How to correctly enable Watchdog Timer on Raspberry Pi 4

Can you confirm that this is the correct way (from normal user):

sudo nano /boot/firmware/config.txt

Append:
dtparam=watchdog=on

sudo reboot

dmesg | grep -i watchdog

sudo mkdir -p /etc/systemd/system.conf.d

sudo nano /etc/systemd/system.conf.d/watchdog.conf

Append:
[Manager]
RuntimeWatchdogSec=15s
RebootWatchdogSec=10min

sudo reboot

systemctl show | grep -E “Watchdog”

What exactly do you want to do? Maybe you could describe your project in a little more detail.

Occasionally the Raspberry Pi 4 crashes and I need to turn off/turn on the power phisically.

I want to avoid this rare but boring procedure (especially If I am outside).

Is Watchdog Time a feature that could be good in my case?

Are the steps I showed in my first post the correct way to enable it in Debian-DietPi?

but if the system crashed, how should Watchdog restart in this case? I mean it already crashed.

Not sure if this is same Raspberry Pi 4 crashing under load after linux-image-6.18.29+rpt-rpi-v8 kernel update · Issue #8148 · MichaIng/DietPi · GitHub but RPI kernel 6.18.33+rpt-rpi-v8 fixed some issues.

My issue happened once a couple of years ago and two times in 2026.

I’m going to update anyway.

That function should work just in this case scenario:

The software crashed but the hardware is still powered.

The timer should “understand” that the software is down and reboot the Raspberry Pi 4.

Then, I wonder if the method to enable it that I described in my first post is correct.

what do you mean by software? Watchdog is nothing else. It’s a software agent. If your entire system crashes, and you are not able to login via SSH anymore, I doubt Watchdog will do anything.

Should be a software that “send” a message to the hardware.

If the hardware, which is not OS related, doesn’t hear that signal, will understand that the system is stuck and then should reboot the system.

If this work, should be a killer feature for any owner of Raspberry Pi.

Imagine those that use the device in places not easy to reach or, in our case, as server of a distant location, hardware is still power-on, Internet (the router) is still working but the OS crashes.

I’m not aware of the Raspberry Pi having such a hardware feature

Anyway maybe something you can have a look in

If you check:

dietpi@DietPi:~$ ls /dev/watchdog*
/dev/watchdog /dev/watchdog0

I already see other posts (here and elsewhere) but they never are clear and left doubts.

ok I was not aware that the RPi4 has such a hardware watchdog build in within the SOC

Basically your described way should be correct

To check the watchdog, you can use

wdctl

And to force a kernel crash

sudo sh -c "echo c > /proc/sysrq-trigger"

The question is whether this will ‘fix’ your problem, as we don’t know why the system is crashing, and you don’t know what the status will be afterwards. Perhaps only some services have been shut down, rather than the entire system? That would mean it might still be functioning to some extent.

The SSH service for sure shuts down, anyway, after the update “RPI kernel 6.18.33+rpt-rpi-v8” the problem didn’t happen anymore, at least for now.