Enabling Watchdog Based on RTC Alarm
The device has a built-in hardware watchdog and supports a software watchdog function based on the RTC alarm. The following describes how to enable this watchdog function by installing the DKMS package and updating initramfs.
Enabling Watchdog
Preparation:
The device is properly started and connected to the network.
Steps:
- In the command pane, run the following commands in sequence to add the edatec APT source.
curl -sS https://apt.edatec.cn/pubkey.gpg | sudo apt-key add -
echo "deb https://apt.edatec.cn/raspbian stable main" | sudo tee /etc/apt/sources.list.d/edatec.list
sudo apt update

- Run the following command to install the tool packages.
sudo apt install debhelper dh-dkms dkms fakeroot

- Run the following command to install the
ed-rtc-watchdogsoftware package.
sudo apt install ./ed-rtc-watchdog_1.0.0_all.deb
- Run the following command to verify whether the software package is installed successfully.
dpkg -l | grep ed-
The following figure indicates a successful installation.

- Run the following command to update initramfs.
sudo update-initramfs -u

- Run the following command to restart the device.
sudo reboot
Modifying the Watchdog Counter Reset Time
The default watchdog counter reset time is set to 2 minutes. You can modify it as needed.
- Run the following command to open the
rtc_alarm.confconfiguration file. The value after the parameteralarm_timeout=indicates the current watchdog counter reset time, in minutes.
sudo nano /etc/rtc_alarm.conf
Modify the value after the parameter
alarm_timeout=as needed.Press
ctrl+oto save the configuration file, then pressEnter, and finally pressctrl+xto exit the configuration file.Run the following command to restart the
ed-rtc-alarm.serviceservice for the configuration to take effect.
sudo systemctl restart ed-rtc-alarm.service
TIP
After enabling the watchdog, if you need to switch the kernel version, make sure to install the corresponding kernel header files at the same time to ensure that related drivers and modules can be properly compiled and loaded. It is recommended to use the following command format for installation:
sudo apt install linux-image-<kernel version> linux-headers-<kernel version>
Example command (taking switching to kernel version 6.12.47 as an example):
sudo apt install linux-image-6.12.47+rpt-rpi-v8 linux-headers-6.12.47+rpt-rpi-v8
