with very long timeout periods allowing underlying problems to report themselves, i get occasional flurries of ’No route to host errors’, which cause s.connect to fail after 18-19 secs, followed by similar that then times out after 2-3 secs, then it works. i would describe it as a local networking issue not a gw1000 driver issue
but i did have to insert that extra debug line to report the reason s.connect was failing to pin it down May 31 20:46:23 ironbark weewx-gw1000[807215] DEBUG user.gw1000: #GE before s.connect ipaddr=b'192.168.37.58' port=45000 May 31 20:46:41 ironbark weewx-gw1000[807215] DEBUG user.gw1000: #GE caught socket.error [Errno 113] No route to host May 31 20:46:41 ironbark weewx-gw1000[807215] DEBUG user.gw1000: #GE before s.shutdown May 31 20:46:41 ironbark weewx-gw1000[807215] DEBUG user.gw1000: #GE shutdown failed: 107 May 31 20:46:41 ironbark weewx-gw1000[807215] DEBUG user.gw1000: #GE before s.close May 31 20:46:41 ironbark weewx-gw1000[807215] DEBUG user.gw1000: Failed attempt 1 to send command 'CMD_GW1000_LIVEDATA': [Errno 113] No route to host cheers ⊣GE⊢ > On 28 May 2023, at 10:08 pm, Graham Eddy <[email protected]> wrote: > > nope, adding s.shutdown() call didn’t help, still timing out > > now i’ll try increasing [GW1000]socket_timeout to 59s to see if it blows even > that long a period > ⊣GE⊢ > >> On 28 May 2023, at 8:10 pm, Graham Eddy <[email protected]> wrote: >> >> the greater detail shows it is timing out on the s.connect() call, after >> going long periods without such timeouts. i have noticed that we open and >> close the socket quite rapidly at times, so i wonder if there is some python >> garbage-collect lag or TCP FIN lag manifesting >> >> i see in python manual >> Note close() <https://docs.python.org/3/library/socket.html#socket.close> >> releases the resource associated with a connection but does not necessarily >> close the connection immediately. If you want to close the connection in a >> timely fashion, call shutdown() >> <https://docs.python.org/3/library/socket.html#socket.socket.shutdown> >> before close() <https://docs.python.org/3/library/socket.html#socket.close>. >> so i have experimentally inserted a s.shutdown() call just before the >> s.connect() call. we’ll see if it makes any difference... >> ⊣GE⊢ >> >>> On 28 May 2023, at 5:30 pm, Graham Eddy <[email protected]> wrote: >>> >>> i should also have mentioned that this same weewx server also hosts another >>> instance of weewx, using serial vantage driver, that is having no such >>> problems >>> ⊣GE⊢ >>> >>>> On 28 May 2023, at 5:28 pm, Graham Eddy <[email protected]> wrote: >>>> >>>> v0.5.0b5 is in place and i continue to get timeouts and restarts. >>>> (logging issue is resolved; i am preferring to continue in this thread for >>>> situational continuity e.g. logs are all relevant) >>>> >>>> in brief, at intermittent times (less than an hour apart to several days >>>> apart), i get three no-response exceptions so a crash/restart of driver. >>>> until several weeks ago it worked happily without timeouts. >>>> i have moved to different power source; was on UPS and now is not. >>>> i have replaced old gw1000 unit with new gw2000 unit with no noticeable >>>> improvement. >>>> i have changed [GW1000]socket_timout to 10s, then to 6s to avoid >>>> unfortunate congruity with polling_interval=10s, with no noticeable change >>>> >>>> the only environmental change i can think of was introducing dnsmasq for >>>> dns/dhcp into home office network but that was months ago, but i did drop >>>> a secondary, non-authoritative dsnmasq server on the weewx server >>>> somewhere about this timeframe (hence my idle wonder about dhcp lease >>>> interference) >>>> >>>> i have now instrumented the driver with lots more debug statements around >>>> every step of sending command & receiving response with gw1000, set the >>>> [GW1000]socket_timeout back to 2s, and wait to see what i learn from this >>>> extra level of detail. >>>> cheers >>>> ⊣GE⊢ >>>> >>>>> On 26 May 2023, at 8:03 pm, gjr80 <[email protected]> wrote: >>>>> >>>>> v0.5.0b5 has been released for close on a year, it would essentially have >>>>> been v0.5.0 but never got around to releasing it. It should be stable >>>> >>> >>> >>> -- >>> 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] >>> <mailto:[email protected]>. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/weewx-user/75C90738-B0B8-4D68-A122-A2B2AEE9C68F%40geddy.au >>> >>> <https://groups.google.com/d/msgid/weewx-user/75C90738-B0B8-4D68-A122-A2B2AEE9C68F%40geddy.au?utm_medium=email&utm_source=footer>. >> >> >> -- >> 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] >> <mailto:[email protected]>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/weewx-user/6658CF4E-1D16-40CF-81F3-D95C2E319EE6%40geddy.au >> >> <https://groups.google.com/d/msgid/weewx-user/6658CF4E-1D16-40CF-81F3-D95C2E319EE6%40geddy.au?utm_medium=email&utm_source=footer>. > > > -- > 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] > <mailto:[email protected]>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/weewx-user/D238B564-8E0F-4E3C-B320-C1A6ADD14397%40geddy.au > > <https://groups.google.com/d/msgid/weewx-user/D238B564-8E0F-4E3C-B320-C1A6ADD14397%40geddy.au?utm_medium=email&utm_source=footer>. -- 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/37EC890B-5491-4B58-8601-151BC046AC5C%40geddy.au.
