Thanks for pointing this out. It looks like it is working for me. I
switched over to systemd control of weewx following the directions in the
Wiki: systemd <https://github.com/weewx/weewx/wiki/systemd>, and I had to
enable the systemd-time-wait-sync service on my Pi: ($sudo systemctl enable
systemd-time-wait-sync). I shut down my Pi and turned off my network,
waited a few minutes, booted the Pi without the network, waited another
couple of minutes, then turned on the network. The log shows Weewx did not
start until the time was updated to the correct time. Partial log attached.
One new message I haven't seen before:
Feb 7 07:56:27 raspberrypi2 systemd[1]: weewx.service: Supervising process
598 which is not our child. We'll most likely not notice when it exits.
I am on Raspbian GNU/Linux 10 (buster). Weewx is about the only real work
my Pi does. I guess there is a question about holding up other processes
too when you enable time-wait-sync.
I did omit the Requires=time-sync.target command in the service file based
on the comment in the Stackexchange link ("...use After= but don't "Pull it
in".).
Walt
On Thursday, February 4, 2021 at 7:21:16 AM UTC-6 [email protected]
wrote:
> Hello!
>
> I am about to install weewx on a Raspberry Pi 4.
> The Raspberry has no RTC, but synchronization using systemd-timesyncd
>
> A note on the delayed start of weewx after timesync is stored in the wiki.
>
> <note>
> Added 25-Nov-2019.
> The article How can I delay the startup of systemd services until the
> datetime is set
> (no RTC on the Raspberry Pi) has some very useful hints on a more elegant
> solution
>
> https://raspberrypi.stackexchange.com/questions/94635/how-can-i-delay-the-startup-of-systemd-services-until-the-datetime-is-set-no-rt
> </note>
>
> Does anyone have that going?
> Is it stable and reliable with this method to delay the start of weewx to
> avoid incorrect timestamps?
>
> Thank you for your answers
> Pline
--
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/25658cdd-e06f-468a-82ea-d1095edf1b13n%40googlegroups.com.
<...previous lines, a bunch of other boot stuff, omitted...>
Feb 7 07:46:55 raspberrypi2 systemd[1]: Started Getty on tty1.
Feb 7 07:46:55 raspberrypi2 systemd[1]: Reached target Login Prompts.
Feb 7 07:46:55 raspberrypi2 systemd[1]: Started OpenBSD Secure Shell server.
Feb 7 07:46:55 raspberrypi2 systemd[1]: Started A high performance web server
and a reverse proxy server.
Feb 7 07:47:01 raspberrypi2 systemd[1]: systemd-hostnamed.service: Succeeded.
<... I turned on the network ...>
Feb 7 07:49:38 raspberrypi2 dhcpcd[470]: wlan0: carrier acquired
Feb 7 07:49:38 raspberrypi2 dhcpcd[470]: wlan0: connected to Access Point
`STTFSW-5'
Feb 7 07:49:38 raspberrypi2 kernel: [ 204.069294] IPv6:
ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
Feb 7 07:49:38 raspberrypi2 dhcpcd[470]: wlan0: IAID eb:16:8f:c9
Feb 7 07:49:38 raspberrypi2 dhcpcd[470]: wlan0: adding address
fe80::57bf:3b90:3c03:3335
Feb 7 07:49:38 raspberrypi2 avahi-daemon[360]: Joining mDNS multicast group on
interface wlan0.IPv6 with address fe80::57bf:3b90:3c03:3335.
Feb 7 07:49:38 raspberrypi2 avahi-daemon[360]: New relevant interface
wlan0.IPv6 for mDNS.
Feb 7 07:49:38 raspberrypi2 avahi-daemon[360]: Registering new address record
for fe80::57bf:3b90:3c03:3335 on wlan0.*.
Feb 7 07:49:39 raspberrypi2 dhcpcd[470]: wlan0: soliciting an IPv6 router
Feb 7 07:49:39 raspberrypi2 dhcpcd[470]: wlan0: rebinding lease of
192.168.0.111
Feb 7 07:49:39 raspberrypi2 dhcpcd[470]: wlan0: probing address
192.168.0.111/24
Feb 7 07:49:40 raspberrypi2 dhcpcd[470]: wlan0: Router Advertisement from
fe80::ee08:6bff:fe62:8cc0
Feb 7 07:49:40 raspberrypi2 dhcpcd[470]: wlan0: adding address
2601:248:8000:2f9d:67fa:993f:8f4:a825/64
Feb 7 07:49:40 raspberrypi2 avahi-daemon[360]: Leaving mDNS multicast group on
interface wlan0.IPv6 with address fe80::57bf:3b90:3c03:3335.
Feb 7 07:49:40 raspberrypi2 avahi-daemon[360]: Joining mDNS multicast group on
interface wlan0.IPv6 with address 2601:248:8000:2f9d:67fa:993f:8f4:a825.
Feb 7 07:49:40 raspberrypi2 avahi-daemon[360]: Registering new address record
for 2601:248:8000:2f9d:67fa:993f:8f4:a825 on wlan0.*.
Feb 7 07:49:40 raspberrypi2 avahi-daemon[360]: Withdrawing address record for
fe80::57bf:3b90:3c03:3335 on wlan0.
Feb 7 07:49:40 raspberrypi2 kernel: [ 205.679390] ICMPv6: process `dhcpcd' is
using deprecated sysctl (syscall) net.ipv6.neigh.wlan0.retrans_time - use
net.ipv6.neigh.wlan0.retrans_time_ms instead
Feb 7 07:49:40 raspberrypi2 dhcpcd[470]: wlan0: adding route to
2601:248:8000:2f9d::/64
Feb 7 07:49:40 raspberrypi2 dhcpcd[470]: wlan0: requesting DHCPv6 information
Feb 7 07:49:40 raspberrypi2 dhcpcd[470]: wlan0: fe80::ee08:6bff:fe62:8cc0 is
reachable again
Feb 7 07:49:40 raspberrypi2 dhcpcd[470]: wlan0: adding default route via
fe80::ee08:6bff:fe62:8cc0
Feb 7 07:49:43 raspberrypi2 dhcpcd[470]: wlan0: Router Advertisement from
fe80::ee08:6bff:fe62:8cc0
Feb 7 07:49:43 raspberrypi2 dhcpcd[470]: wlan0: fe80::ee08:6bff:fe62:8cc0: no
longer a default router
Feb 7 07:49:43 raspberrypi2 dhcpcd[470]: wlan0: deleting default route via
fe80::ee08:6bff:fe62:8cc0
Feb 7 07:49:44 raspberrypi2 dhcpcd[470]: wlan0: leased 192.168.0.111 for
infinity
Feb 7 07:49:44 raspberrypi2 avahi-daemon[360]: Joining mDNS multicast group on
interface wlan0.IPv4 with address 192.168.0.111.
Feb 7 07:49:44 raspberrypi2 avahi-daemon[360]: New relevant interface
wlan0.IPv4 for mDNS.
Feb 7 07:49:44 raspberrypi2 avahi-daemon[360]: Registering new address record
for 192.168.0.111 on wlan0.IPv4.
Feb 7 07:49:44 raspberrypi2 dhcpcd[470]: wlan0: adding route to 192.168.0.0/24
Feb 7 07:49:44 raspberrypi2 dhcpcd[470]: wlan0: adding default route via
192.168.0.1
Feb 7 07:49:51 raspberrypi2 avahi-daemon[360]: Registering new address record
for fe80::57bf:3b90:3c03:3335 on wlan0.*.
<...the time gets changed ...>
Feb 7 07:56:26 raspberrypi2 systemd-time-wait-sync[113]: adjtime state 0
status 2000 time Sun 2021-02-07 13:56:26.132218 UTC
Feb 7 07:56:26 raspberrypi2 systemd-timesyncd[289]: Synchronized to time
server for the first time 204.11.201.10:123 (2.debian.pool.ntp.org).
Feb 7 07:56:26 raspberrypi2 systemd[1]: Started Wait Until Kernel Time
Synchronized.
Feb 7 07:56:26 raspberrypi2 systemd[1]: Reached target System Time
Synchronized.
Feb 7 07:56:26 raspberrypi2 systemd[1]: Starting weewx weather system...
Feb 7 07:56:26 raspberrypi2 systemd[1]: Started Daily apt download activities.
Feb 7 07:56:26 raspberrypi2 systemd[1]: Started Daily rotation of log files.
Feb 7 07:56:26 raspberrypi2 systemd[1]: Started Daily man-db regeneration.
Feb 7 07:56:26 raspberrypi2 systemd[1]: Started Daily apt upgrade and clean
activities.
Feb 7 07:56:26 raspberrypi2 systemd[1]: Reached target Timers.
<... Weewx starts ....>
Feb 7 07:56:26 raspberrypi2 weewx[594] INFO __main__: Initializing weewx
version 4.4.0
Feb 7 07:56:26 raspberrypi2 weewx[594] INFO __main__: Using Python 3.7.3
(default, Jul 25 2020, 13:03:44) #012[GCC 8.3.0]
Feb 7 07:56:26 raspberrypi2 weewx[594] INFO __main__: Platform
Linux-5.4.83-v7+-armv7l-with-debian-10.7
Feb 7 07:56:26 raspberrypi2 weewx[594] INFO __main__: Locale is 'en_US.UTF-8'
Feb 7 07:56:26 raspberrypi2 weewx[594] INFO __main__: PID file is
/run/weewx/weewx.pid
Feb 7 07:56:26 raspberrypi2 weewx[598] INFO __main__: Using configuration file
/etc/weewx/weewx.conf
Feb 7 07:56:26 raspberrypi2 weewx[598] INFO __main__: Debug is 0
Feb 7 07:56:27 raspberrypi2 weewx[598] INFO weewx.engine: Loading station type
Vantage (weewx.drivers.vantage)
Feb 7 07:56:27 raspberrypi2 systemd[1]: weewx.service: Supervising process 598
which is not our child. We'll most likely not notice when it exits.
Feb 7 07:56:27 raspberrypi2 systemd[1]: Started weewx weather system.
Feb 7 07:56:27 raspberrypi2 systemd[1]: Reached target Multi-User System.
Feb 7 07:56:27 raspberrypi2 systemd[1]: Starting Update UTMP about System
Runlevel Changes...
Feb 7 07:56:27 raspberrypi2 systemd[1]: systemd-update-utmp-runlevel.service:
Succeeded.
Feb 7 07:56:27 raspberrypi2 systemd[1]: Started Update UTMP about System
Runlevel Changes.
Feb 7 07:56:27 raspberrypi2 systemd[1]: Startup finished in 3.557s (kernel) +
3min 38.072s (userspace) = 3min 41.629s.
Feb 7 07:56:27 raspberrypi2 dhcpcd[470]: wlan0: fe80::ee08:6bff:fe62:8cc0 is
reachable again
Feb 7 07:56:27 raspberrypi2 dhcpcd[470]: wlan0: fe80::ee08:6bff:fe62:8cc0 is
reachable again
Feb 7 07:56:31 raspberrypi2 weewx[598] INFO weewx.engine: StdConvert target
unit is 0x1
Feb 7 07:56:31 raspberrypi2 weewx[598] INFO weewx.engine: Archive will use
data binding wx_binding
Feb 7 07:56:31 raspberrypi2 weewx[598] INFO weewx.engine: Record generation
will be attempted in 'hardware'
Feb 7 07:56:31 raspberrypi2 weewx[598] INFO weewx.engine: Using archive
interval of 900 seconds (specified by hardware)
Feb 7 07:56:31 raspberrypi2 weewx[598] INFO weewx.restx: StationRegistry:
Station will be registered.
Feb 7 07:56:31 raspberrypi2 weewx[598] INFO weewx.restx: Wunderground: Posting
not enabled.
Feb 7 07:56:31 raspberrypi2 weewx[598] INFO weewx.restx: PWSweather: Posting
not enabled.
Feb 7 07:56:31 raspberrypi2 weewx[598] INFO weewx.restx: CWOP: Posting not
enabled.
Feb 7 07:56:31 raspberrypi2 weewx[598] INFO weewx.restx: WOW: Posting not
enabled.
Feb 7 07:56:31 raspberrypi2 weewx[598] INFO weewx.restx: AWEKAS: Posting not
enabled.
Feb 7 07:56:31 raspberrypi2 weewx[598] INFO __main__: Starting up weewx
version 4.4.0
Feb 7 07:56:31 raspberrypi2 weewx[598] INFO weewx.engine: Clock error is 0.56
seconds (positive is fast)
Feb 7 07:56:31 raspberrypi2 weewx[598] INFO weewx.engine: Using binding
'wx_binding' to database 'weewx.sdb'
Feb 7 07:56:31 raspberrypi2 weewx[598] INFO weewx.manager: Starting backfill
of daily summaries
Feb 7 07:56:31 raspberrypi2 weewx[598] INFO weewx.manager: Daily summaries up
to date
Feb 7 07:56:31 raspberrypi2 weewx[598] INFO weewx.engine: Starting main packet
loop.