Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revisionBoth sides next revision
docs:guide-user:hardware:watchdog [2020/09/21 10:14] – [Hardware watchdog] content optimized vgaeteradocs:guide-user:hardware:watchdog [2021/11/01 11:39] – [USB watchdogs] vgaetera
Line 34: Line 34:
 <code bash> <code bash>
 # Change timeout to 60s # Change timeout to 60s
-ubus call system watchdog '{ "timeout": 60 }'+ubus call system watchdog '{"timeout":60}'
  
 # Change frequency to 1s # Change frequency to 1s
-ubus call system watchdog '{ "frequency": 1 }'+ubus call system watchdog '{"frequency":1}'
 </code> </code>
  
-To stop the service:+To bypass procd, enable the magicclose feature, stop the service and control the watchdog manually:
  
 <code bash> <code bash>
-ubus call system watchdog '{ "stop": true }'+ubus call system watchdog '{"magicclose":true}' 
 +ubus call system watchdog '{"stop":true}' 
 +while :; do echo 1 > /dev/watchdog; sleep 5; done
 </code> </code>
  
 Note that watchdog will cause a reset after it expires. Note that watchdog will cause a reset after it expires.
- 
-To bypass procd and control the watchdog manually, enable the magicclose feature: 
- 
-<code bash> 
-ubus call system watchdog '{"magicclose": true}' 
-echo 1 > /dev/watchdog 
-</code>  
  
 ===== USB watchdogs ===== ===== USB watchdogs =====
Line 70: Line 65:
 This is a script that will generate a procd service to control one of such USB-serial watchdogs. This is a script that will generate a procd service to control one of such USB-serial watchdogs.
  
-<code bash usb_watchdog>+<code bash> 
 +cat << "EOF" > /etc/usb_watchdog
 #!/bin/sh #!/bin/sh
  
Line 117: Line 113:
  
 (install) (install)
-cat << "EOF" > /etc/init.d/usb_watchdog+cat << "EOI" > /etc/init.d/usb_watchdog
 #!/bin/sh /etc/rc.common #!/bin/sh /etc/rc.common
  
Line 132: Line 128:
 } }
  
-stop_service() +stop_service() {
-{+
     /etc/usb_watchdog stop     /etc/usb_watchdog stop
 } }
-EOF+EOI
  
-cat << "EOF" > /lib/upgrade/keep.d/usb_watchdog+cat << "EOI" > /lib/upgrade/keep.d/usb_watchdog
 /etc/init.d/usb_watchdog /etc/init.d/usb_watchdog
 /etc/rc.d/ /etc/rc.d/
 /etc/usb_watchdog /etc/usb_watchdog
-EOF+EOI
  
 chmod +x /etc/init.d/usb_watchdog chmod +x /etc/init.d/usb_watchdog
Line 158: Line 153:
  
 esac esac
 +EOF
 +chmod +x /etc/usb_watchdog
 +/etc/usb_watchdog install
 </code> </code>
  
Line 163: Line 161:
  
 <code bash> <code bash>
-wget --no-check-certificate -O /etc/usb_watchdog "https://openwrt.org/_export/code/docs/guide-user/hardware/watchdog?codeblock=6+uclient-fetch -O usb-watchdog.sh "https://openwrt.org/_export/code/docs/guide-user/hardware/watchdog?codeblock=3
-chmod +x /etc/usb_watchdog +. ./usb-watchdog.sh
-/etc/usb_watchdog install+
 </code> </code>
  
  • Last modified: 2023/08/21 09:20
  • by vgaetera