Problem I've seen in the past was that on a Rasberry Pi installrd NTP , like I have on every system I've installed since 2004, yet after a power outage weeWx started with a bad Os Time. Investigated and found that if I removed purged fake-hwclock the expected wait for ntp worked. Now on some systems I install ntp others I don't, if it's a PI remove fake-hwclock and even if the machine has a RTC I enable systemd-time-wait-sync. Also change weewx.service to:
Requires=systemd-time-wait-sync.service After=systemd-time-wait-sync.service Many ways to get there On Mon, Aug 22, 2022 at 12:02 PM vince <vinceska...@gmail.com> wrote: > Easier yet - just install ntp and use that instead, and systemd won't do > anything time related. > > FWIW - I've found ntp handles drift better by far, and I've been using it > happily everywhere for well over 20 years across all unixy platforms of all > vintages so I know what I'm getting. You never know what systemd is going > to do or change os to os and version to version. You gotta fight the > systemd borg whenever possible :-) > > Here's the logs from a pi4 using ntp that I am running the simulator on > which was powered down overnight. Note how the system boots up initial > with a Mar-26 date and weewx waits gracefully for the system to get the > correct date+time before proceeding. You'll see the syslog show the system > switch to today's date when ntpd updates things and weewx starts up pretty > much immediately after. > > Mar 26 22:42:16 pi4 kernel: [ 0.000000] Booting Linux on physical CPU > 0x0 > Mar 26 22:42:16 pi4 kernel: [ 0.000000] Linux version 5.15.56-v7l+ > (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) > 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1575 SMP Fri Jul 22 20:29:46 > BST 2022 > Mar 26 22:42:16 pi4 kernel: [ 0.000000] CPU: ARMv7 Processor [410fd083] > revision 3 (ARMv7), cr=30c5383d > Mar 26 22:42:16 pi4 kernel: [ 0.000000] CPU: div instructions > available: patching division code > Mar 26 22:42:16 pi4 kernel: [ 0.000000] CPU: PIPT / VIPT nonaliasing > data cache, PIPT instruction cache > Mar 26 22:42:16 pi4 kernel: [ 0.000000] OF: fdt: Machine model: > Raspberry Pi 4 Model B Rev 1.1 > [...] > Mar 26 22:42:16 pi4 kernel: [ 7.491386] uart-pl011 fe201000.serial: no > DMA platform data > Mar 26 22:42:16 pi4 kernel: [ 7.806915] Adding 102396k swap on > /var/swap. Priority:-2 extents:1 across:102396k SSFS > Mar 26 22:42:17 pi4 kernel: [ 8.223906] brcmfmac: > brcmf_cfg80211_set_power_mgmt: power save enabled > Mar 26 22:42:17 pi4 kernel: [ 8.590674] bcmgenet fd580000.ethernet: > configuring instance for external RGMII (RX delay) > Mar 26 22:42:17 pi4 kernel: [ 8.592910] bcmgenet fd580000.ethernet > eth0: Link is Down > > > > > > > *Mar 26 22:42:17 pi4 weewx[415] INFO __main__: Initializing weewx version > 4.8.0Mar 26 22:42:17 pi4 weewx[415] INFO __main__: Using Python 3.9.2 > (default, Mar 12 2021, 04:06:34) #012[GCC 10.2.1 20210110]Mar 26 22:42:17 > pi4 weewx[415] INFO __main__: Platform > Linux-5.15.56-v7l+-armv7l-with-glibc2.31Mar 26 22:42:17 pi4 weewx[415] INFO > __main__: Locale is 'en_US.UTF-8'Mar 26 22:42:17 pi4 weewx[415] INFO > __main__: Using configuration file /home/weewx/weewx.confMar 26 22:42:17 > pi4 weewx[415] INFO __main__: Debug is 0Mar 26 22:42:17 pi4 weewx[415] INFO > __main__: Waiting for sane time. Current time is 2022-03-26 22:42:17 PDT > (1648359737)* > Mar 26 22:42:23 pi4 kernel: [ 14.316585] IPv6: ADDRCONF(NETDEV_CHANGE): > wlan0: link becomes ready > Mar 26 22:42:23 pi4 kernel: [ 14.383527] Bluetooth: Core ver 2.22 > Mar 26 22:42:23 pi4 kernel: [ 14.383597] NET: Registered PF_BLUETOOTH > protocol family > [...] > Mar 26 22:42:23 pi4 kernel: [ 14.700205] Bluetooth: BNEP socket layer > initialized > Mar 26 22:42:23 pi4 kernel: [ 14.714801] NET: Registered PF_ALG protocol > family > Mar 26 22:42:23 pi4 kernel: [ 14.735599] cryptd: max_cpu_qlen set to 1000 > > > > *Aug 22 08:34:37 pi4 kernel: [ 31.832505] cam-dummy-reg: disablingAug 22 > 08:34:37 pi4 weewx[415] INFO weewx.engine: Loading station type Simulator > (weewx.drivers.simulator)Aug 22 08:34:37 pi4 weewx[415] INFO > user.MQTTSubscribe: (Service) Version is 2.1.0*Aug 22 08:34:37 pi4 > weewx[415] INFO user.MQTTSubscribe: (Service) Log level: 0 > Aug 22 08:34:37 pi4 weewx[415] INFO user.MQTTSubscribe: (Service) Log > debug setting: 0 > Aug 22 08:34:37 pi4 weewx[415] INFO user.MQTTSubscribe: (Service) Log > console: False > Aug 22 08:34:37 pi4 weewx[415] INFO user.MQTTSubscribe: (Service) Log > file: None > > > -- > 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 weewx-user+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/weewx-user/0d091386-1e68-4f64-9c7b-44e67de544afn%40googlegroups.com > <https://groups.google.com/d/msgid/weewx-user/0d091386-1e68-4f64-9c7b-44e67de544afn%40googlegroups.com?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 weewx-user+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/CAOAVAecqzabFwUtGL4Ax9BSYOG%2Bw8Ocizb2y2ehXGoGF6u_2aQ%40mail.gmail.com.