Watchdog timer setup

Sir,
I am using onion omega. I want to setup my onion omega board have to reboot every 24 hours with the help of watchdog timer. How to do?

1 Like

If you want just a periodic reboot you can do that without extra ardware.

1 Like

sir i tried, just it was restarted after 50 seconds, for me atleast 1 hour if it is give then i can manage it.

Will it is possible watchdog timer setup atleast 1 hour.

If anything not happening in between time i will reset the time again like way i will manage it.

This way should make it restart every hour:

sed -i -e "
\$i ubus call system watchdog '{\"timeout\":3600}'
\$i ubus call system watchdog '{\"stop\":true}'
" /etc/rc.local
/etc/init.d/done boot

Hi sir,
which you have given me that command i enter directly in the terminal. but a restart is not happening. first, i tried given 180 sec after 3 mins my onion omega not yet restarted. but when i did manual restart, then after my onion omega is restarting every 30 sec. even when i setup 3600 after also.

sed -i -e "
$i ubus call system watchdog '{"timeout":180}'
$i ubus call system watchdog '{"stop":true}'
" /etc/rc.local

That's a startup script, that you can edit and run manually:

# Edit
vi /etc/rc.local

# Run
sh /etc/rc.local

# Verify
ubus call system watchdog
1 Like

i tried sir even though same problem gateway has restarting every 30 seconds

watchdog_error2 .

can you see 3rd image i added script in /etc/rc.local.

1 Like

I tried sir, even though i am getting same problem gateway has restarting every 30 seconds.

watchdog_error2

can you see 3rd image i added script in /etc/rc.local

1 Like

Check the output:

ubus call system watchdog '{"timeout":180}'
ubus call system watchdog '{"timeout":3600}'
ubus call system watchdog

1 Like

It works for me, but it seems that your hardware watchdog doesn't support timeout customization.

In this case the easiest way is to implement periodic reboot using cron as mentioned above.

but cron cannot do reboot right when the OS is a struct or hanged issue happened.
but watchdog timer can do.

1 Like

When the kernel or procd fails, this should trigger your hardware watchdog timeout and reboot the system automatically, so it should combine well with periodic reboot using cron.

oho is it?
then can i reset crontab schedule, if anything does not happen?.
yes means how to do?

This depends on what do you expect to happen.
Generally you don't even need to perform periodic reboot, unless you experience specific problems like memory leak or performance degradation.
Many devices can work relatively smoothly for weeks and months without periodic reboot with just hardware watchdog that is enabled by default.