Hi, Mikael,

My watchdog script could certainly be "complimentary" to Constantine's script, 
and with minor modifications could potentially replace it.   IIRC, isn't mine 
at least the third script recently mentioned on the alias to address nearly the 
same issues?

For sure these scripts shouldn't be necessary, but things happen, and bugs that 
can be fixed may eventually be fixed, but in the mean-time, I'd rather have a 
script notify / remediate / workaround issues than keep randomly discovering 
that my station isn't reporting only hours after it "went offline."   :-/

So, anyway, in my weewx_watchdog script I am merely sending an e-mail 
notification when the station hasn't reported, but there is an example included 
(commented out) that initiates a reboot, which is the only remedy I have found 
for when my WMR300 stops communicating on my RPI.

Instead of the "shutdown -r now" it would be very easy to instead use 
"systemctl status weewx" to check if the service is running and then "systemctl 
start weewx" to start it (or "systemctl restart weewx").

With a little more work, I could do a series of remediation steps, like first 
attempting to restart weewx, then IFF the station still is not reporting, do 
the reboot the next time.   I didn't bother, because never once ever did a 
simple restart of weewx fix the USB issues with my WMR300 on RPI.   Also, I 
didn't bother to check if weewx was running, because my weewx has never 
actually stopped running.  It's always the USB issue at fault in my case.  :-/

If there is interest I could add a weewx restart remediation and even put some 
simple toggle's at the top to control which remediation steps are desired, such 
as restart_weewx vs. reboot_host, and maybe even do the logic to first try one 
and then the other if both are enabled.   Could put a toggle for whether to do 
the wunderfixer steps, too.   I'm going to write a separate post about that in 
a minute.  ;-)

Incidentally, I had to move the script.  It's in its own branch now:

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

Regards,
Leon
--
Leon Shaner :: Dearborn, Michigan (iPad Pro)

> On May 1, 2019, at 4:13 AM, pliggen...@gmail.com wrote:
> 
> Hi Leon,
> 
> could this be used as a complement to Constantine Samaklis script you helped 
> me with yesterday? 
> Sometimes the wh1080 freezes USB-connection to my raspberry pi but the weewx 
> service is still running so Constantines script wont have any effect in this 
> case?
> I think this issue with whxxxx is well known.
> 
> BR Mikael
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to weewx-user+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to