meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
hw:usb_watchdog [2020/10/04 12:28] – created niziakhw:usb_watchdog [2020/10/14 20:41] (current) niziak
Line 5: Line 5:
 {{:hw:usb_watchdog_restarter_top.jpg?direct&200|}} {{:hw:usb_watchdog_restarter_top.jpg?direct&200|}}
 {{:hw:usb_watchdog_restarter_bottom.jpg?direct&200|}} {{:hw:usb_watchdog_restarter_bottom.jpg?direct&200|}}
 +
 +===== Communication protocol =====
 +
 +<code>
 +[238947.892900] usb 1-3.4: Product: USB2.0-Serial
 +[238947.899333] ch341 1-3.4:1.0: ch341-uart converter detected
 +[238947.906552] usb 1-3.4: ch341-uart converter now attached to ttyUSB0
 +</code>
 +
 +Serial port parameters: 9600 8N1
 +<code bash>stty -F /dev/ttyUSB0 raw speed 9600</code>
 +
 +Each command is 1 byte value. It set watchdog threshold in deciseconds. Example commands:
 +Commands sent to watchdog (1 byte):
 +  * ''1'' - next expected kick in 10 seconds. <code bash> echo -ne "\x01" > /dev/ttyUSB0</code>
 +  * ''36'' - next expected kick in 360 seconds. <code bash> echo -ne "\x01" > /dev/ttyUSB0</code> 
 +  * ''128'' - status query. It responds with ''0x81'' <code bash> echo -ne "\x80" > /dev/ttyUSB0</code> 
 +  * ''255'' - forced reset. <code bash> echo -ne "\xFF" > /dev/ttyUSB0</code>
 +
 +REMARK: Avoid low threshold. It is stored internally in watchdog, so after reset it is still low. In this case it is not possible to boot OS.
 +
 +Default (after powerup) watchdog window is 170 sec (measured).
 +
 +===== Daemon =====
 +
 +[[https://github.com/niziak/usb-watchdog]]