weewx.service fails at reboot

168 views
Skip to first unread message

Vetti52

unread,
Feb 1, 2024, 4:27:26 PMFeb 1
to weewx-user
After upgrading to version 5.0.0, I can regularily observe, that starting Weewx  sudo sdystemctl status weewx.service fails because of network error.

My setup is a Rasperry Pi4 under a freshly installed bookworm. I installed the apt package as described in the guide, immediately stopped Weewx and edited weewx.conf to adopt my previous settings. That is to change to GW1000. I also changed from US to metric.
As the Raspi has no display nor keyboard, I log in via ssd. Usually it runs without interaction for many months. However, up to date rebooting was not a problem. No, I have to log in and do a sudo systemctl start weewx, which I would like to avoid, as I tend to forget this, when doing it once per year or so.
Why does this happen since version 5.0.0?  And, if there are new conditions for starting, is  there a way to tell weewx, to wait for an established network?

BTW, I found a more of cosmetic curiosity: The date in the seasons skin is now displayed in form of dd/mm/yy. Ok, I can read it , but it is very unusual. As I did not touch this part in the seasons files, I have now idea, where this format comes from.

Thanks for any suggestions
Peter

vince

unread,
Feb 1, 2024, 4:44:11 PMFeb 1
to weewx-user
Without seeing your logs and the gw1000 section of weewx.conf, we can't help too much.

As always start with setting debug=1, restart weewx, let it run through at least 'two' archive periods, and post the log.

WeeWX isn't going to start nor run reliably if the driver can't find your ecowitt gateway, which happens if your network is unstable and especially if the pi is on wifi.  We'd need to see the gw1000 section of weewx.conf to suggest much there.   And what ip is your pi and what ip is the ecowitt gateway ?

Also does this happen on 'reboot' or on 'power down and up' ?   The pi has no battery backed realtime clock so weewx might be waiting for your pi to get accurate network time.

michael.k...@gmx.at

unread,
Feb 1, 2024, 11:38:20 PMFeb 1
to weewx-user
The "cosmetic curiosity" is because the date in seasons skin's output is formatted using to the locale set for weewx, which is the OS' default locale, if not explicitly set otherwise.

en_GB is the default default (yes, 2x default) locale on RasperryPI OS. Install your desired locale using raspi-config and set it as the OS default locale, or start weewx with this locale.

By now, you cannot set an other locale, than the the one you run weewx with, for report generation, see https://github.com/weewx/weewx/issues/867

Vetti52

unread,
Feb 2, 2024, 4:19:25 PMFeb 2
to weewx-user
Well, there are some drawbacks. Sorry, that blames me. Of course I should have attached the log files, but I still struggle with the new journalctl log file system. The only entry I see there is

every five minutes.
So, I tested the reboot with the simulator driver. Then weewx starts as expected, assuming, it is correllated to the gw1000 driver
At least, I can show the gw1000 related entry in weewx.conf:
##############################################################################

# Options for extension 'GW1000'
[GW1000]
    driver = user.gw1000
    # This section is for the GW1000 API driver.

    # How often to poll the GW1000 API, default is every 20 seconds:
    poll_interval = 20
    [[field_map_extensions]]
        # WeeWX field name = GW1000 field name
        rainEvent = t_rainevent
        txBatteryStatus = wh65_batt
##############################################################################

# Options for extension 'GW1000'
[Accumulator]
    [[rainEvent]]
        extractor = last
    [[txBatteryStatus]]
        extractor = last

There as a lot more of these Accumulator entries. Don't know, if they are still necessary or up to date. My latest update of the gw000.driver was by replacing /usr/share/weewx/user/gw1000.py
Version: 0.6.0b3  Date: 9 January 2024

Vetti52

unread,
Feb 2, 2024, 4:24:17 PMFeb 2
to weewx-user
Oops, the log entry is missing: It should read
sudo journalctl -xeu weewx.service
...
 raspbee weewxd.py[1316]: historygenerator.py: Generated 5 tables in 0.15 seconds

every five minutes. Nothing else.

Thanks
Peter

Vetti52

unread,
Feb 2, 2024, 4:39:06 PMFeb 2
to weewx-user
Hi, Vince!

To complete the questions: The pi is LAN connected. I did
sudo shutdown -r now 
or
sudo shutdown -h now, then unplug the power cable and start again by power connection. In both cases weewx fails because of a network error.
Because of a missing log file I think, that the IP-Adresses won't help

Thanks
Peter

Vetti52

unread,
Feb 4, 2024, 4:14:12 PMFeb 4
to weewx-user
Thanks to Vince I have dived into weewx wiki, there to Raspberry and problems with missing clock. Finally I found this:
sudo systemctl enable systemd-time-wait-sync

This should let the kernel wait for time sync being ready before Requires=time-sync.target becomes active. So far for short, as I understood the man page.
At least the error at reboot is gone now.

Thanks to Vince for leading me on this track. And Thanks to Michael for the hint to setting the locale with raspi-config.

Anyway, I have detected, that I was messed up with the way, I updated from Weewx version 4.10. to 5.0.
But, I prefer to put this update topic into a separate thread

Peter
Reply all
Reply to author
Forward
0 new messages