WeeWX Watchdog, latest improvements

206 views
Skip to first unread message

Leon Shaner

unread,
May 6, 2019, 7:02:57 PM5/6/19
to weewx...@googlegroups.com
Hey, WeeWX'ers!  =D

Lots of improvements made to my watchdog script(s).

1)   wunderfixer is now decoupled, except in conjunction with an outage.

It means that even if dowufixer=1 (enabled), it will only run if it is within a certain time-frame after an outage (watchdogsecs * repeatwufixer).
With the defaults, wunderfixer runs every 10 minutes, six times, i.e. spread over an hour after an outage.

2)  A separate weewx_wunderfixer wrapper is provided to run separately twice a day.
See readme for recommendations.  This change and #1 above is in the spirit of lowering the amount of "gratuitous" calls to WU infrastructure, while still attempting to keep WU up-to-date a soon as possible after an outage.  The main purpose of the weewx_wunderfixer is to compute today's and yesterday's dates and run against both, just to be extra sure that there are no gaps on the WU side.  Decoupling now means those actions only occur twice a day, instead of every watchdogsecs (e.g. every 10 minutes by default), plus a default of 6 more times after an outage.

3)  The running status of weewx is now explicitly checked, which is in part to catch an outage sooner, in case weewx crashed very recently after a cron interval.
A similar check is now added after a weewx restart attempt, which avoids a double watchdogsecs wait (allows back to back weewx restart and host reboot remediations, which is especially nice in the case of a USB / firmware hang).

4)  Improved and more consistent logging with a running history of status and remediation steps the beginning of the current pass of weewx_watchdog.

That one proved more challenging than expected due to a 1024 line-length limitation somewhere in the middle between the host and my inbox.  A simple "fmt -s -w 1024" did the trick.  I woulda had this update out sooner, were it not for that one!  LOL

The latest 1.1.0 version is over here:

https://github.com/UberEclectic/weewx/tree/watchdog/examples/watchdog

Regards,
\Leon
--
Leon Shaner :: Dearborn, Michigan (iPad Pro)
Message has been deleted
Message has been deleted
Message has been deleted

Bill Arthur

unread,
Oct 19, 2020, 9:16:44 PM10/19/20
to weewx-user
I'm setting up remote weather sites so this is an essential for me. Unfortunately I can't get it to work yet.
But I believe I've found an error:
In the lines below, the sixth line should say weewx_status rather than weewx_start

# weewx stop, start commands -- these depend on your setup
weewx_stop="/etc/init.d/weewx stop"
#weewx_stop="sudo systemctl stop weewx"
weewx_start="/etc/init.d/weewx start"
#weewx_start="sudo systemctl start weewx"
weewx_start="/etc/init.d/weewx status"
#weewx_status="systemctl status weewx"
#host restart command
host_restart="shutdown -r now"
#host_restart="sudo shutdown -r now"  

I'm going to start a fresh install tonight. In all my troubleshooting I've probably honked up something. I went from it having no response to now rebooting every 20 minutes.

Bill Arthur

unread,
Oct 20, 2020, 10:43:46 PM10/20/20
to weewx-user
My fresh install is working well. I'm very happy with the operation.
Now all that remains is correcting line 30 of the script to "weewx_status"
I'm unable to contact the author, if someone else can it would be appreciated
Reply all
Reply to author
Forward
0 new messages