Go Down

Topic: [SOLVED]Watchdog timer in OpenWRT Linux on the Yun (Read 3899 times) previous topic - next topic


Jun 23, 2015, 06:10 pm Last Edit: Jun 23, 2015, 10:56 pm by yamanoorsai_15
I am trying to implement a watchdog timer that reboots the Linux OS running on the Yun. I came across the watchdog and issued the following command

Code: [Select]
watchdog -t 5 -T 60 /dev/watchdog

This starts a watchdog daemon and it appears that the watchdog is automatically reset by the command. I was looking something similar to what you would do on a microcontroller. I would like to be able to reset the watchdog @ /dev/watchdog from the application I am running.

Is there a way of achieving this?


Jun 23, 2015, 10:37 pm Last Edit: Jun 23, 2015, 11:02 pm by sonnyyu
Yun OS has watchdog daemon install and enabled.

Code: [Select]
root@Arduino:~# ps |grep watchdog
 1347 root      1492 S    /sbin/watchdog -t 5 /dev/watchdog
 2792 root      1484 S    grep watchdog

Code: [Select]
watchdog  --help
BusyBox v1.19.4 (2014-11-13 19:03:47 CET) multi-call binary.

Usage: watchdog [-t N[ms]] [-T N[ms]] [-F] DEV

Periodically write to watchdog device DEV

        -T N    Reboot after N seconds if not reset (default 60)
        -t N    Reset every N seconds (default 30)
        -F      Run in foreground

Use 500ms to specify period in milliseconds

Code: [Select]
watchdog -t 5 -T 60 /dev/watchdog

means reset the watchdog every 30 seconds with 60 second timeout
same as

Code: [Select]
/sbin/watchdog -t 5 /dev/watchdog

So No need to issued the that command.

To trigger watchdog:

Code: [Select]
root@Arduino:~# uptime
 20:26:52 up 53 min,  load average: 0.00, 0.03, 0.04

pgrep watchdog | xargs kill -SIGSTOP

root@Arduino:~# uptime
 20:29:22 up 1 min,  load average: 0.42, 0.21, 0.08

Go Up