Author

Topic: USB Watchdog-Control-Linux v1.1 (Read 388 times)

newbie
Activity: 24
Merit: 0
February 17, 2021, 09:21:48 AM
#2
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 :-)

jr. member
Activity: 30
Merit: 4
June 10, 2020, 04:02:29 PM
#1
I wrote a program to control Watchdog in Linux, and I believe it will come in handy for anyone who mine in Linux.



In version 1.1 I added support for new types of watchdogs, v3.2 (black) and v5.0 (red):



Installation instruction:
https://www.youtube.com/watch?v=VN_Kk9RTEpA&t=3s


Download link:
https://github.com/delevic/USB-Wathchdog-Control-Linux
Jump to: