In the course of doing a fresh install (4.3.0 debian package), I’ve been doing
a lot of restarting weewx. The restart would fail pretty often due to not
waking up the Vantage console (Davis Ethernet datalogger). The driver would
report an ip-read error, followed by a series of ip-write errors until
max_tries was used up. This all happens very quickly because the sleep for
wait_before_retry is inside the try clause so there’s no delay when there’s a
WeeWxIOError exception. (Lines 110-115 in vantage.py.) I moved the sleep
outside of the try/except block and it fixed the problem — with the delay, the
wakeup succeeds after a few retries. (diff attached)
I’m not sure if there was a specific reason for skipping the delay in case of
WeeWxIOError. It seems like there wouldn’t be any disadvantage to putting the
delay outside of the exception, other than taking slightly longer for weewx to
exit in case of an unrecoverable error, and there certainly is the possibility
that having a delay between retries makes it more likely to succeed. Neither
do I see a reason this wouldn’t work with a USB datalogger, but I have no way
to test that.
Thoughts?
-Les
*** /usr/share/weewx/weewx/drivers/vantage.py.dist 2021-01-04
11:43:12.000000000 -0800
--- /usr/share/weewx/weewx/drivers/vantage.py 2021-02-13 10:11:53.084750115
-0800
***************
*** 107,117 ****
if _resp == b'\n\r':
log.debug("Rude wake up of console successful")
return
- print("Unable to wake up console... sleeping")
- time.sleep(self.wait_before_retry)
- print("Unable to wake up console... retrying")
except weewx.WeeWxIOError:
pass
log.debug("Retry #%d failed", count)
log.error("Unable to wake up console")
--- 107,118 ----
if _resp == b'\n\r':
log.debug("Rude wake up of console successful")
return
except weewx.WeeWxIOError:
pass
+
+ print("Unable to wake up console... sleeping")
+ time.sleep(self.wait_before_retry)
+ print("Unable to wake up console... retrying")
log.debug("Retry #%d failed", count)
log.error("Unable to wake up console")
--
You received this message because you are subscribed to the Google Groups
"weewx-development" 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-development/7D296A46-154D-4518-AF5D-AA2DA6B4F2AD%402pi.org.