On Sunday, 9 June 2019 13:33:54 UTC+1, Nick wrote:
>
> On 09/06/2019 05:51, 'Johannes Ebner' via weewx-user wrote:
> > I still have this issue. For me it seems that the Power-Cycle
> > Implementation in WeeWx is broken.
> >
>
> Hi,
>
> I am in the same boat :-(
>
>
> Likewise.
I have just implemented a couple of scripts to use `uhubctrl` (which does
control the RPi's USB port):
#!/bin/bash
# monitorlockup
# watch the weewx log file for lockup condition and use USB power
recycling to clear the lockup
# 20190622
LOGfile="<path-to>/weewx.log"
tail -Fn0 $LOGfile |
while read line ; do
echo "$line" | grep -q "Errno 110"
if [ $? = 0 ]
then
/home/weewx/powercycleusb
fi
done
And
#!/bin/bash
# powercycleusb
<path-to>/uhubctl -a off -p2
sleep 45
<path-to>/uhubctl -a on -p2
Both scripts are executable, owned by root and also setuid root.
`monitorlockup` will run from /etc/rc.local on boot (I trust).
Note: The -F (CAPS) in `tail` should track the logfile despite any log
rotation.
It is possible that the 45 second `sleep` could be reduced.
My logs show approx 2 minutes between the first (of 4) prints of [`Errno
110]`
so I hope to have the console restarted and stable before `weewx` resets
itself.
Does it work? Time will tell...
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/weewx-user/77a061b5-bf26-4d92-bb9b-f6d0352509e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.