I make no comment on systemd or service files but if loop_on_init <http://weewx.com/docs/usersguide.htm#General> is set True in weewx.conf and the GW1000 driver is being used as a driver WeeWX should recover from the lack of a network on startup.
On WeeWX startup when loading the GW1000 driver the GW1000 driver does need to contact the GW1000 concerned before allowing WeeWX to continue startup. If there is no network connection the GW driver will raise a critical error (as shown in the log extract above) and WeeWX will exit. If loop_on_init is set True WeeWX should restart in 60 seconds (default) and the GW1000 driver will attempt contact again. If loop_on_init is not set True WeeWX will exit. This is standard behaviour in many drivers. If the GW1000 driver is not exhibiting this behaviour it is a bug and I would appreciate full details so it can be fixed. Gary On Sunday, 7 February 2021 at 06:24:29 UTC+10 Vetti52 wrote: > My Weewx installation was updated to version 4.4.0 using > > sudo apt-get update > sudo apt-get install weewx > > under debian buster on a Raspberry Pi 4. The driver is gw1000 version > 0.2.0. > > After rebooting my Raspberry Pi (this happens only about once or twice a > year), I realized, that weewx was not running. After systemctl status > weewx.service (which actually evokes /etc/init.d/weewx status) I was > confronted with the message > > Feb 03 16:44:25 RaspBee python3[629]: weewx[629] CRITICAL > weewx.engine: **** debug_wind=self.debug_wind) > Feb 03 16:44:25 RaspBee python3[629]: weewx[629] CRITICAL > weewx.engine: **** File "/usr/share/weewx/user/gw1000.py", line > 2166, in __init__ > Feb 03 16:44:25 RaspBee python3[629]: weewx[629] CRITICAL > weewx.engine: **** lost_contact_log_period=lost_contact_log_period) > Feb 03 16:44:25 RaspBee python3[629]: weewx[629] CRITICAL > weewx.engine: **** File "/usr/share/weewx/user/gw1000.py", line > 2915, in __init__ > Feb 03 16:44:25 RaspBee python3[629]: weewx[629] CRITICAL > weewx.engine: **** ip_port_list = self.discover() > Feb 03 16:44:25 RaspBee python3[629]: weewx[629] CRITICAL > weewx.engine: **** File "/usr/share/weewx/user/gw1000.py", line > 3005, in discover > Feb 03 16:44:25 RaspBee python3[629]: weewx[629] CRITICAL > weewx.engine: **** socket_obj.sendto(packet, > (self.broadcast_address, self.broadcast_port)) > Feb 03 16:44:25 RaspBee python3[629]: weewx[629] CRITICAL > weewx.engine: **** OSError: [Errno 101] Das Netzwerk ist nicht > erreichbar > Feb 03 16:44:25 RaspBee python3[629]: weewx[629] CRITICAL __main__: Unable > to load driver: [Errno 101] Das Netzwerk ist nicht erreichbar > Feb 03 16:44:25 RaspBee python3[629]: weewx[629] CRITICAL __main__: > **** Exiting... > > After some investigation, I realized, that weewx was not exiting but still > running. So I had first to stop it and could then start it without any > issues. I suppose, that while invoking weewx during boot time from the > /etc/init.d/weewx > script, the network is not yet up. However, the gw1000 driver relies on an > existing network and therefore blocks any further actions of weewx, which > remains running. > I would therefore propose, to replace the init.d script by a weewx.service > directive instead. > I realized meanwhile, that there is a /etc/weewx/weewx.service file > version from 02.02.2020, which is currently not enabled. There are three > stanza entries > [Unit] > Requires=time-sync.target > After=time-sync.target > RequiresMountsFor=/home > > which I don't know, what they are supposed for, but I think, that for > stability reason, it should have at least this additional the stanza in > > [Unit] > After=network-online.target > > and maybe taylor the rest of this file, and after enabling it, take systemctl > start weeww.service as the regular starting process, instead of the > /etc/init.d/weewx script. > > What speaks against this proposal, or, why is the init.d version still > preferably > established? > > -Peter > -- 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/a73d7d24-81f8-4c2d-972f-15fa4b095316n%40googlegroups.com.
