|
February 17, 2021, 02:21:48 PM |
|
Hi,
I use a easier way how to use this watchdog under Linux. The device is just an countdown timer, then triggers a relay connected to the RESET or POWER switch. Works with the two relay USB watchdog - first picture on previous post (don't have another to test).
I do it that way: First make sure, it there is a kernel module: #ls /lib/modules/`uname -r`/kernel/drivers/watchdog/pcwd_usb.ko
then load the module (if is not louaded previously): #/sbin/modprobe pcwd_usb
test, if it is loaded: #lsmod | grep pcwd_usb
for automatic module loading I did: #echo 'pcwd_usb' >> /etc/modules
If I have the module loaded, I should have a /dev/ttyUSB0 device available for use.
For watchdog function I use crontab:
#crontab -e add the line: * * * * * echo -n -e "\xd" > /dev/ttyUSB0
That sets every minute a counter for 130s. If the crontab stops (PC hangs), then after 130s the trigger connected to the RESET switch restarts the PC. The "\xd" is number in HEX, so 13 in DEC x 10sec is 130sec countdown. And that's all :-)
|