weewx 4.5.1 status issue

173 views
Skip to first unread message

Mks Mk

unread,
Sep 5, 2021, 11:35:29 AMSep 5
to weewx-user
recently after power outage when weewx status is checked we get this result

*:~ $ sudo /etc/init.d/weewx status

● weewx.service - LSB: weewx weather system
   Loaded: loaded (/etc/init.d/weewx; generated)
   Active: failed (Result: timeout) since Sun 2021-09-05 15:57:09 +03; 11min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 310 ExecStart=/etc/init.d/weewx start (code=killed, signal=TERM)
    Tasks: 5 (limit: 4915)
   CGroup: /system.slice/weewx.service
           ├─961 python3 /usr/share/weewx/weewxd --daemon --pidfile=/var/run/we…
           └─963 rtl_433 *


weewx is updating the webpage and the database and the log shows these lines

Line 393: Feb 14 13:12:03 raspberrypi systemd[1]: Starting LSB: weewx weather system...
Line 586: Sep  5 15:57:09 raspberrypi systemd[1]: weewx.service: Start operation timed out. Terminating.
Line 587: Sep  5 15:57:09 raspberrypi systemd[1]: weewx.service: Control process exited, code=killed, status=15/TERM
Line 588: Sep  5 15:57:09 raspberrypi systemd[1]: weewx.service: Failed with result 'timeout'.
Line 589: Sep  5 15:57:09 raspberrypi systemd[1]: Failed to start LSB: weewx weather system.
Line 593: Sep  5 15:57:09 raspberrypi weewx[310]: Starting weewx weather system: weewx
Line 593: Sep  5 15:57:09 raspberrypi weewx[310]: Starting weewx weather system: weewx
Line 593: Sep  5 15:57:09 raspberrypi weewx[310]: Starting weewx weather system: weewx


if we stop weewx (sudo /etc/init.d/weewx stop) and start it again

*:~ $ sudo /etc/init.d/weewx status

● weewx.service - LSB: weewx weather system
   Loaded: loaded (/etc/init.d/weewx; generated)
   Active: active (running) since Sun 2021-09-05 18:00:50 +03; 9min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1489 ExecStart=/etc/init.d/weewx start (code=exited, status=0/SUCCESS)
    Tasks: 5 (limit: 4915)
   CGroup: /system.slice/weewx.service
           ├─1504 python3 /usr/share/weewx/weewxd --daemon --pidfile=/var/run/w…
           └─1507 rtl_433 *

the log shows these lines

Line 619: Sep  5 16:10:48 raspberrypi systemd[1]: weewx.service: Found left-over process 961 (python3) in control group while starting unit. Ignoring.
Line 621: Sep  5 16:10:48 raspberrypi systemd[1]: weewx.service: Found left-over process 963 (rtl_433) in control group while starting unit. Ignoring.
Line 623: Sep  5 16:10:48 raspberrypi systemd[1]: Starting LSB: weewx weather system...
Line 624: Sep  5 16:10:48 raspberrypi weewx[1096]: Starting weewx weather system: weewx already running....
Line 624: Sep  5 16:10:48 raspberrypi weewx[1096]: Starting weewx weather system: weewx already running....
Line 624: Sep  5 16:10:48 raspberrypi weewx[1096]: Starting weewx weather system: weewx already running....
Line 625: Sep  5 16:10:48 raspberrypi systemd[1]: Started LSB: weewx weather system.

recently we made some changes to the system so the weewx will not start untill time is sync but we cannot remember the changes we made to the system and the log show these lines

Feb 14 13:12:04 raspberrypi weewx[422] INFO __main__: Initializing weewx version 4.5.1
Feb 14 13:12:04 raspberrypi weewx[422] INFO __main__: Using Python 3.7.3 (default, Jan 22 2021, 20:04:44) #012[GCC 8.3.0]
Feb 14 13:12:04 raspberrypi weewx[422] INFO __main__: Platform Linux-5.10.60-v7l+-armv7l-with-debian-10.10
Feb 14 13:12:04 raspberrypi weewx[422] INFO __main__: Locale is 'en_GB.UTF-8'
Feb 14 13:12:04 raspberrypi weewx[422] INFO __main__: Waiting for sane time. Current time is 2019-02-14 13:12:04 +03 (1550139124)
Feb 14 13:14:04 raspberrypi weewx[422] INFO __main__: Waiting for sane time. Current time is 2019-02-14 13:14:04 +03 (1550139244)
Feb 14 13:15:04 raspberrypi weewx[422] INFO __main__: Waiting for sane time. Current time is 2019-02-14 13:15:04 +03 (1550139304)
Feb 14 13:16:04 raspberrypi weewx[422] INFO __main__: Waiting for sane time. Current time is 2019-02-14 13:16:04 +03 (1550139364
Feb 14 13:17:01 raspberrypi CRON[951]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep  5 15:57:08 raspberrypi systemd[1]: Starting Rotate log files...
Sep  5 15:57:08 raspberrypi systemd[1]: Starting Daily man-db regeneration...
Sep  5 15:57:08 raspberrypi systemd[1]: logrotate.service: Succeeded.
Sep  5 15:57:08 raspberrypi systemd[1]: Started Rotate log files.
Sep  5 15:57:09 raspberrypi weewx[422] INFO __main__: PID file is /var/run/weewx.pid
Sep  5 15:57:09 raspberrypi weewx[961] INFO __main__: Using configuration file /etc/weewx/weewx.conf
Sep  5 15:57:09 raspberrypi weewx[961] INFO __main__: Debug is 0
Sep  5 15:57:09 raspberrypi weewx[961] INFO weewx.engine: Loading station type SDR (user.sdr)
Sep  5 15:57:09 raspberrypi systemd[1]: weewx.service: Start operation timed out. Terminating.
Sep  5 15:57:09 raspberrypi systemd[1]: weewx.service: Control process exited, code=killed, status=15/TERM
Sep  5 15:57:09 raspberrypi systemd[1]: weewx.service: Failed with result 'timeout'.
Sep  5 15:57:09 raspberrypi systemd[1]: Failed to start LSB: weewx weather system.
Sep  5 15:57:09 raspberrypi systemd[1]: Reached target Multi-User System.
Sep  5 15:57:09 raspberrypi systemd[1]: Reached target Graphical Interface.
Sep  5 15:57:09 raspberrypi systemd[1]: Starting Update UTMP about System Runlevel Changes...
Sep  5 15:57:09 raspberrypi weewx[310]: Starting weewx weather system: weewx
Sep  5 15:57:09 raspberrypi weewx[961] INFO user.sdr: driver version is 0.80
Sep  5 15:57:09 raspberrypi weewx[961] INFO user.sdr: sensor map is *
Sep  5 15:57:09 raspberrypi weewx[961] INFO user.sdr: deltas is *
Sep  5 15:57:09 raspberrypi weewx[961] INFO user.sdr: startup process 'rtl_433 *
Sep  5 15:57:09 raspberrypi systemd[1]: systemd-update-utmp-runlevel.service: Succeeded.
Sep  5 15:57:09 raspberrypi systemd[1]: Started Update UTMP about System Runlevel Changes.
Sep  5 15:57:09 raspberrypi weewx[961] INFO weewx.engine: StdConvert target unit is 0x1
Sep  5 15:57:09 raspberrypi weewx[961] INFO weewx.engine: Archive will use data binding wx_binding
Sep  5 15:57:09 raspberrypi weewx[961] INFO weewx.engine: Record generation will be attempted in 'hardware'
Sep  5 15:57:09 raspberrypi weewx[961] INFO weewx.engine: Using archive interval of 300 seconds (specified in weewx configuration)
Sep  5 15:57:09 raspberrypi weewx[961] INFO weewx.restx: StationRegistry: Registration not requested.
Sep  5 15:57:09 raspberrypi weewx[961] INFO weewx.restx: Wunderground: Posting not enabled.
Sep  5 15:57:09 raspberrypi weewx[961] INFO weewx.restx: PWSweather: Posting not enabled.
Sep  5 15:57:09 raspberrypi weewx[961] INFO weewx.restx: CWOP: Posting not enabled.
Sep  5 15:57:09 raspberrypi weewx[961] INFO weewx.restx: WOW: Posting not enabled.
Sep  5 15:57:09 raspberrypi weewx[961] INFO weewx.restx: AWEKAS: Posting not enabled.
Sep  5 15:57:09 raspberrypi weewx[961] INFO __main__: Starting up weewx version 4.5.1
Sep  5 15:57:09 raspberrypi weewx[961] INFO weewx.engine: Using binding 'wx_binding' to database 'weewx.sdb'
Sep  5 15:57:09 raspberrypi weewx[961] INFO weewx.manager: Starting backfill of daily summaries
Sep  5 15:57:09 raspberrypi weewx[961] INFO weewx.manager: Daily summaries up to date
Sep  5 15:57:09 raspberrypi weewx[961] INFO weewx.engine: Starting main packet loop.
Sep  5 15:57:09 raspberrypi systemd[1]: man-db.service: Succeeded.
Sep  5 15:57:09 raspberrypi systemd[1]: Started Daily man-db regeneration.
Sep  5 15:57:09 raspberrypi systemd[1]: Startup finished in 5.739s (kernel) + 5min 6.061s (userspace) = 5min 11.800s.
Sep  5 16:00:30 raspberrypi weewx[961] INFO weewx.manager: Added record 2021-09-05 16:00:00 +03 (1630846800) to database 'weewx.sdb'
Sep  5 16:00:30 raspberrypi weewx[961] INFO weewx.manager: Added record 2021-09-05 16:00:00 +03 (1630846800) to daily summary in 'weewx.sdb'
Sep  5 16:00:32 raspberrypi weewx[961] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 2.33 seconds
Sep  5 16:00:37 raspberrypi weewx[961] INFO weewx.imagegenerator: Generated 51 images for report SeasonsReport in 4.89 seconds
Sep  5 16:00:37 raspberrypi weewx[961] INFO weewx.reportengine: Copied 5 files to /var/www/html/weewx

is this normal ? weewx seems to work ok ( I guess )
or do we need fresh reinstall , we have two rpi 4 having the same issue.

vince

unread,
Sep 5, 2021, 1:24:39 PMSep 5
to weewx-user
First - you should never need a fewest install.

I'm not seeing any problem.   As long as it's saving records and generating your web pages you're good.

Mks Mk

unread,
Sep 14, 2021, 2:59:24 AMSep 14
to weewx-user
today another power outage and weewx status is showing failed , We really not sure why it is doing that or the operating system reporting this status of weewx while it is running just fine.

systemctl list-units --type=service
          UNIT                                                         LOAD    ACTIVE  SUB     DESCRIPTION
● weewx.service                                               loaded  failed     failed  LSB: weewx weather system

added  loop_on_init = true to weewx configuration file but it did not make any different.

any idea if this is weewx issue or operating system issue !, we have 2  Raspberry Pi 4  Debian Buster with the same issue.

gjr80

unread,
Sep 14, 2021, 8:35:07 PMSep 14
to weewx-user
What does the log show? systemd output can be useful for seeing the state of a service but when troubleshooting WeeWX it is hit and miss as to whether it provides anything else of use; the log is far better. Have a look at the log after the power returned, did WeeWX start? Were there any errors during WeeWX startup? Did WeeWX have a time issue? Did some error occur later that caused WeeWX to fail? There have been various changes to the WeeWX code base over the years to try to mitigate time issues due to power outages/restarts etc, so it is possible you may not need to do anything in this regard. Again the log will tell you.

Gary

vince

unread,
Sep 14, 2021, 9:37:56 PMSep 14
to weewx-user
On Monday, September 13, 2021 at 11:59:24 PM UTC-7 mksm...@gmail.com wrote:
We really not sure why it is doing that or the operating system reporting this status of weewx while it is running just fine.


If it's running just fine, I'd call this one an annoyance at worst.

The only thing I can think of is that perhaps the pid in /var/run/weewx.pid is not the process id that weewx is actually running under.  That would lead systemd to think it failed when it actually worked ok.

 

Mks Mk

unread,
Sep 15, 2021, 2:03:01 AMSep 15
to weewx-user
Weewx timeout in 5 minutes and the Pi needed more than 5 minutes to get the time sync.

-we have made some changes to the system so weewx must wait until the clock time get sync to the correct time but unfortunately we can not recall these changes we made.
-weewx seems to work just fine and updating the webpage and its database.
-in the past when we stop weewx it does take some time (around 10 to 15 seconds) but now it is instant (1 second).
-sudo /etc/init.d/weewx status will show failed (Result: timeout) since ***

-stopping weewx and restarting it will fix this issue but we believe this is not the right solution to the problem.


log file:

Sep 15 02:20:33 raspberrypi weewx[961] INFO weewx.reportengine: Copied 0 files to /var/www/html/weewx

*power outage

Feb 14 13:12:03 raspberrypi kernel: [    0.000000] Booting Linux on physical CPU 0x0

-******

Feb 14 13:12:03 raspberrypi systemd[1]: Starting LSB: weewx weather system...
-
Feb 14 13:12:04 raspberrypi weewx[423] INFO __main__: Initializing weewx version 4.5.1
Feb 14 13:12:04 raspberrypi weewx[423] INFO __main__: Using Python 3.7.3 (default, Jan 22 2021, 20:04:44) #012[GCC 8.3.0]
Feb 14 13:12:04 raspberrypi weewx[423] INFO __main__: Platform Linux-5.10.60-v7l+-armv7l-with-debian-10.10
Feb 14 13:12:04 raspberrypi weewx[423] INFO __main__: Locale is 'en_GB.UTF-8'
Feb 14 13:12:04 raspberrypi weewx[423] INFO __main__: Waiting for sane time. Current time is 2019-02-14 13:12:04 +03 (1550139124)

-******

Feb 14 13:13:04 raspberrypi weewx[423] INFO __main__: Waiting for sane time. Current time is 2019-02-14 13:13:04 +03 (1550139184)

-******

Feb 14 13:14:04 raspberrypi weewx[423] INFO __main__: Waiting for sane time. Current time is 2019-02-14 13:14:04 +03 (1550139244)
Feb 14 13:15:04 raspberrypi weewx[423] INFO __main__: Waiting for sane time. Current time is 2019-02-14 13:15:04 +03 (1550139304)
Feb 14 13:16:05 raspberrypi weewx[423] INFO __main__: Waiting for sane time. Current time is 2019-02-14 13:16:05 +03 (1550139365)
Feb 14 13:17:01 raspberrypi CRON[845]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Feb 14 13:17:03 raspberrypi systemd[1]: weewx.service: Start operation timed out. Terminating.
Feb 14 13:17:03 raspberrypi systemd[1]: weewx.service: Control process exited, code=killed, status=15/TERM
Feb 14 13:17:03 raspberrypi systemd[1]: weewx.service: Failed with result 'timeout'.
Feb 14 13:17:03 raspberrypi systemd[1]: Failed to start LSB: weewx weather system.

-******

Feb 14 13:17:05 raspberrypi weewx[423] INFO __main__: Waiting for sane time. Current time is 2019-02-14 13:17:05 +03 (1550139425)
Sep 15 02:50:57 raspberrypi weewx[423] INFO __main__: PID file is /var/run/weewx.pid
Sep 15 02:50:57 raspberrypi weewx[857] INFO __main__: Using configuration file /etc/weewx/weewx.conf
Sep 15 02:50:57 raspberrypi weewx[857] INFO __main__: Debug is 0
Sep 15 02:50:57 raspberrypi weewx[857] INFO weewx.engine: Loading station type SDR (user.sdr)
Sep 15 02:50:57 raspberrypi weewx[317]: Starting weewx weather system: weewx
Sep 15 02:50:57 raspberrypi weewx[857] INFO user.sdr: driver version is 0.80
Sep 15 02:50:57 raspberrypi weewx[857] INFO user.sdr: sensor map is *******
Sep 15 02:50:57 raspberrypi weewx[857] INFO user.sdr: deltas is ***********
Sep 15 02:50:57 raspberrypi weewx[857] INFO user.sdr: startup process 'rtl_433 -M utc -F json -R *
Sep 15 02:50:57 raspberrypi weewx[857] INFO weewx.engine: StdConvert target unit is 0x1
Sep 15 02:50:57 raspberrypi weewx[857] INFO weewx.engine: Archive will use data binding wx_binding
Sep 15 02:50:57 raspberrypi weewx[857] INFO weewx.engine: Record generation will be attempted in 'hardware'
Sep 15 02:50:57 raspberrypi weewx[857] INFO weewx.engine: Using archive interval of 300 seconds (specified in weewx configuration)
Sep 15 02:50:58 raspberrypi weewx[857] INFO weewx.restx: StationRegistry: Registration not requested.
Sep 15 02:50:58 raspberrypi weewx[857] INFO weewx.restx: Wunderground: Posting not enabled.
Sep 15 02:50:58 raspberrypi weewx[857] INFO weewx.restx: PWSweather: Posting not enabled.
Sep 15 02:50:58 raspberrypi weewx[857] INFO weewx.restx: CWOP: Posting not enabled.
Sep 15 02:50:58 raspberrypi weewx[857] INFO weewx.restx: WOW: Posting not enabled.
Sep 15 02:50:58 raspberrypi weewx[857] INFO weewx.restx: AWEKAS: Posting not enabled.
Sep 15 02:50:58 raspberrypi weewx[857] INFO __main__: Starting up weewx version 4.5.1
Sep 15 02:50:58 raspberrypi weewx[857] INFO weewx.engine: Using binding 'wx_binding' to database 'weewx.sdb'
Sep 15 02:50:58 raspberrypi weewx[857] INFO weewx.manager: Starting backfill of daily summaries
Sep 15 02:50:58 raspberrypi weewx[857] INFO weewx.manager: Daily summaries up to date
Sep 15 02:50:58 raspberrypi weewx[857] INFO weewx.engine: Starting main packet loop.
Sep 15 02:50:58 raspberrypi systemd[1]: man-db.service: Succeeded.
Sep 15 02:50:58 raspberrypi systemd[1]: Started Daily man-db regeneration.
Sep 15 02:55:24 raspberrypi weewx[857] INFO weewx.manager: Added record 2021-09-15 02:55:00 +03 (1631663700) to database 'weewx.sdb'
Sep 15 02:55:24 raspberrypi weewx[857] INFO weewx.manager: Added record 2021-09-15 02:55:00 +03 (1631663700) to daily summary in 'weewx.sdb'
Sep 15 02:55:27 raspberrypi weewx[857] INFO weewx.cheetahgenerator: Generated 8 files for report SeasonsReport in 2.53 seconds
Sep 15 02:55:28 raspberrypi weewx[857] INFO weewx.imagegenerator: Generated 17 images for report SeasonsReport in 0.75 seconds
Sep 15 02:55:28 raspberrypi weewx[857] INFO weewx.reportengine: Copied 5 files to /var/www/html/weewx

vince

unread,
Sep 15, 2021, 1:26:40 PMSep 15
to weewx-user
ok - it's a known issue because you are not running a realtime clock on your pi.  You can add a RTC module for a few dollars, or live with the annoyance (at this time) since weewx is running ok.

You could probably try to crutch it with a cron job that restarts weewx 10 minutes after a reboot (untested) if it bothers you that much, but you still need quality system time before weewx will come up reliably.

tomn...@frontier.com

unread,
Sep 16, 2021, 9:19:01 AMSep 16
to weewx-user
For some instances I have of weewx I don't have an RTC, so I came up with a delay loop that waits
for NTP to sync before exiting the loop and letting weewx start up.  It's added to extensions.py.
I can send the (python2) code if someone wants it.

Chris

wfs...@gmail.com

unread,
Sep 17, 2021, 12:11:52 PMSep 17
to weewx-user
At least for some versions of Raspian/Debian/Linux there is a systemd-time-wait-sync service that will hold up processes until the time is synchronized.  Discussed here.
Reply all
Reply to author
Forward
0 new messages