Bitcoin Forum
November 10, 2024, 02:00:59 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: USB Watchdog-Control-Linux v1.1  (Read 388 times)
delevic (OP)
Jr. Member
*
Offline Offline

Activity: 30
Merit: 4


View Profile
June 10, 2020, 09:02:29 PM
Last edit: June 10, 2020, 09:31:26 PM by delevic
 #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
ManicMiner276
Newbie
*
Offline Offline

Activity: 24
Merit: 0


View Profile
February 17, 2021, 02:21:48 PM
 #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 :-)

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!