Walt, glad you figured that out. I recall debating whether to include a dependency
After=systemd-time-wait-sync in the service file, but decided against it because it would hardwire a dependency on the systemd time synchronization. Some people prefer ntp or chrony. The more generic time-sync.target is independent of the actual service in use. Raspberry Pi OS always uses the systemd time sync. It's for this reason that the wiki on the RPi mentions that you should include a dependency on <https://github.com/weewx/weewx/wiki/Raspberry-Pi#c-make-weewxd-depend-on-a-valid-system-time> systemd-time-wait-sync <https://github.com/weewx/weewx/wiki/Raspberry-Pi#c-make-weewxd-depend-on-a-valid-system-time> . Sorry it's so hidden! I suppose a more clever install script could vet what time service is in use and make the appropriate dependency. -tk On Sat, Aug 15, 2026 at 6:42 AM [email protected] <[email protected]> wrote: > Yeah, that appears to be the problem. I upgraded to Trixie a couple of > weeks ago and it looks like wait-sync is disabled out of the box. I'm > pretty sure I didn't disable it myself. I see an extra line now in syslog > just before the clock sync messages: > > Aug 15 08:28:15 Pi-3 sh[1002]: Completed socket interaction for boot stage > config > Aug 15 08:28:15 Pi-3 systemd[1]: Finished cloud-config.service - > Cloud-init: Config Stage. > Aug 15 08:28:23 Pi-3 systemd[1]: NetworkManager-dispatcher.service: > Deactivated successfully. > Aug 15 08:29:22 Pi-3 systemd-time-wait-sync[283]: adjtime state 0 status > 2000 time Sat 2026-08-15 13:29:22.342967 UTC > Aug 15 08:29:22 Pi-3 systemd-timesyncd[320]: Contacted time server > [2600:3c02::f03c:94ff:fee2:9c6a]:123 (2.debian.pool.ntp.org). > Aug 15 08:29:22 Pi-3 systemd-timesyncd[320]: Initial clock synchronization > to Sat 2026-08-15 08:29:22.342856 CDT. > Aug 15 08:29:22 Pi-3 systemd[1]: Finished systemd-time-wait-sync.service - > Wait Until Kernel Time Synchronized. > Aug 15 08:29:22 Pi-3 systemd[1]: Reached target time-sync.target - System > Time Synchronized. > Aug 15 08:29:22 Pi-3 systemd[1]: Started apt-daily.timer - Daily apt > download activities. > Aug 15 08:29:22 Pi-3 systemd[1]: Started apt-daily-upgrade.timer - Daily > apt upgrade and clean activities. > Aug 15 08:29:22 Pi-3 systemd[1]: Started dpkg-db-backup.timer - Daily dpkg > database backup timer. > Aug 15 08:29:22 Pi-3 systemd[1]: Started e2scrub_all.timer - Periodic ext4 > Online Metadata Check for All Filesystems. > Aug 15 08:29:22 Pi-3 systemd[1]: Started fstrim.timer - Discard unused > filesystem blocks once a week. > Aug 15 08:29:22 Pi-3 systemd[1]: Started logrotate.timer - Daily rotation > of log files. > Aug 15 08:29:22 Pi-3 systemd[1]: Started man-db.timer - Daily man-db > regeneration. > Aug 15 08:29:22 Pi-3 systemd[1]: Reached target timers.target - Timer > Units. > Aug 15 08:29:22 Pi-3 systemd[1]: Started weewx.service - WeeWX weather > system. > Aug 15 08:29:22 Pi-3 systemd[1]: Reached target multi-user.target - > Multi-User System. > Aug 15 08:29:22 Pi-3 systemd[1]: Starting cloud-final.service - > Cloud-init: Final Stage... > Aug 15 08:29:22 Pi-3 cloud-init[520]: Cloud-init v. 25.2 running > 'modules:final' at Sat, 15 Aug 2026 13:29:22 +0000. Up 40.40 seconds. > Aug 15 08:29:22 Pi-3 cloud-init[520]: 2026-08-15 13:29:22,689 - > modules.py[WARNING]: Could not find module named cc_netplan_nm_patch > (searched ['cc_netplan_nm_patch', 'cloudinit.config.cc_netplan_nm_patch']) > Aug 15 08:29:22 Pi-3 cloud-init[520]: Cloud-init v. 25.2 finished at Sat, > 15 Aug 2026 13:29:22 +0000. Datasource DataSourceNoCloud > [seed=cmdline,ds_config_seedfrom,file:///boot/firmware][dsmode=local]. Up > 40.67 seconds > Aug 15 08:29:22 Pi-3 sh[1018]: Completed socket interaction for boot stage > final > Aug 15 08:29:22 Pi-3 systemd[1]: Finished cloud-final.service - > Cloud-init: Final Stage. > Aug 15 08:29:22 Pi-3 systemd[1]: Reached target cloud-init.target - > Cloud-init target. > Aug 15 08:29:22 Pi-3 systemd[1]: Startup finished in 3.751s (kernel) + > 36.952s (userspace) = 40.704s. > Aug 15 08:29:23 Pi-3 weewxd[1014]: INFO __main__: Initializing weewxd > version 5.4.0 > Aug 15 08:29:23 Pi-3 weewxd[1014]: INFO __main__: Command line: > /home/pi/weewx-venv/lib/python3.13/site-packages/weewxd.py > /home/pi/weewx-data/weewx.conf > Aug 15 08:29:23 Pi-3 weewxd[1014]: INFO __main__: Using Python: 3.13.5 > (main, Jul 15 2026, 20:25:40) [GCC 14.2.0] > Aug 15 08:29:23 Pi-3 weewxd[1014]: INFO __main__: Located at: > /home/pi/weewx-venv/bin/python > Aug 15 08:29:23 Pi-3 weewxd[1014]: INFO __main__: Platform: > Linux-6.18.39+rpt-rpi-v8-aarch64-with-glibc2.41 > Aug 15 08:29:23 Pi-3 weewxd[1014]: INFO __main__: Locale: > 'en_US.UTF-8' > Aug 15 08:29:23 Pi-3 weewxd[1014]: INFO __main__: Entry path: > /home/pi/weewx-venv/lib/python3.13/site-packages/weewxd.py > > Gotta write that down! (And then forget I wrote it down). > > Walt > > On Saturday, August 15, 2026 at 8:24:18 AM UTC-5 [email protected] wrote: > >> John, I'm no systemd expert either but i'm looking through the rather >> disorganized documentation at debian.org and i think either way should >> work. But I see another reference that systemd-time-wait-sync needs to be >> enabled along with systemd-timesyncd. >> >> I have timesyncd enabled but time-wait-sync is not. Let me enable that >> and retest. >> >> Walt >> >> >> >> On Saturday, August 15, 2026 at 7:46:47 AM UTC-5 John Smith wrote: >> >>> After=time-sync.target >>>> Wants=network-online.target >>>> After=network-online.target >>> >>> >>> I'm not an expert on SystemD service files but shouldn't the After= be a >>> single line? >>> >>> eg After=network-online.target time-sync.target >>> >>> On Sat, 15 Aug 2026 at 21:37, [email protected] <[email protected]> wrote: >>> >>>> pi@Pi-3:~ $ sudo systemctl status weewx >>>> ● weewx.service - WeeWX weather system >>>> Loaded: loaded (/etc/systemd/system/weewx.service; enabled; >>>> preset: enabled) >>>> Active: active (running) since Fri 2026-08-14 12:32:53 CDT; 17h ago >>>> Invocation: 267b6c1305ba4ad4a6f6872ade89aa05 >>>> Docs: https://weewx.com/docs >>>> Main PID: 985 (python) >>>> Tasks: 6 (limit: 806) >>>> CPU: 1h 4min 27.142s >>>> CGroup: /system.slice/weewx.service >>>> └─985 /home/pi/weewx-venv/bin/python >>>> /home/pi/weewx-venv/lib/python3.13/site-packages/weewxd.py >>>> /home/pi/weewx-data/weewx.conf >>>> >>>> pi@Pi-3:~ $ cat /etc/systemd/system/weewx.service >>>> # systemd service configuration file for WeeWX >>>> >>>> [Unit] >>>> Description=WeeWX weather system >>>> Documentation=https://weewx.com/docs >>>> Requires=time-sync.target >>>> After=time-sync.target >>>> Wants=network-online.target >>>> After=network-online.target >>>> >>>> # If you are using MySQL uncomment the following lines: >>>> # After=mysqld.service >>>> # Wants=mysqld.service >>>> >>>> # If you are using MariaDB uncomment the following lines: >>>> # After=mariadb.service >>>> # Wants=mariadb.service >>>> >>>> [Service] >>>> ExecStart=/home/pi/weewx-venv/bin/python >>>> /home/pi/weewx-venv/lib/python3.13/site-packages/weewxd.py >>>> /home/pi/weewx-data/weewx.conf >>>> StandardOutput=null >>>> StandardError=journal+console >>>> User=pi >>>> Group=pi >>>> >>>> [Install] >>>> WantedBy=multi-user.target >>>> pi@Pi-3:~ $ >>>> >>>> On Friday, August 14, 2026 at 5:29:04 PM UTC-5 Tom Keffer wrote: >>>> >>>>> Could you post your weewx.service file? >>>>> >>>>> On Fri, Aug 14, 2026 at 2:34 PM [email protected] <[email protected]> >>>>> wrote: >>>>> >>>>>> Tom and Vince, >>>>>> >>>>>> This time gap was only a couple of minutes, but what if the power >>>>>> goes out for a couple of hours? Isn't the station time being changed >>>>>> incorrectly? From my log, a couple of lines above the clock sync: >>>>>> Aug 14 12:33:01 Pi-3 weewxd[985]: INFO weewx.engine: Clock error is >>>>>> 185.33 seconds (positive is fast) >>>>>> Aug 14 12:33:02 Pi-3 weewxd[985]: INFO weewx.drivers.vantage: Clock >>>>>> set to 2026-08-14 12:33:02 CDT (1786728782) >>>>>> Can't that cause db errors and Vantage memory being overwritten if >>>>>> the time is way off? >>>>>> Thanks for your help. Here's the output of those commands: >>>>>> pi@Pi-3:~ $ journalctl -b -u systemd-timesyncd >>>>>> Aug 14 12:32:29 Pi-3 systemd[1]: Starting systemd-timesyncd.service - >>>>>> Network Time Synchronization... >>>>>> Aug 14 12:32:29 Pi-3 systemd[1]: Started systemd-timesyncd.service - >>>>>> Network Time Synchronization. >>>>>> Aug 14 12:32:31 Pi-3 systemd-timesyncd[315]: Network configuration >>>>>> changed, trying to establish connection. >>>>>> Aug 14 12:32:32 Pi-3 systemd-timesyncd[315]: Network configuration >>>>>> changed, trying to establish connection. >>>>>> Aug 14 12:32:32 Pi-3 systemd-timesyncd[315]: Network configuration >>>>>> changed, trying to establish connection. >>>>>> Aug 14 12:32:32 Pi-3 systemd-timesyncd[315]: Network configuration >>>>>> changed, trying to establish connection. >>>>>> Aug 14 12:32:32 Pi-3 systemd-timesyncd[315]: Network configuration >>>>>> changed, trying to establish connection. >>>>>> Aug 14 12:36:07 Pi-3 systemd-timesyncd[315]: Contacted time server >>>>>> [2607:f1c0:f054:5e00::2]:123 (2.debian.pool.ntp.org). >>>>>> Aug 14 12:36:07 Pi-3 systemd-timesyncd[315]: Initial clock >>>>>> synchronization to Fri 2026-08-14 12:36:07.050420 CDT. >>>>>> pi@Pi-3:~ $ journalctl -b -u weewx | head >>>>>> Aug 14 12:32:53 Pi-3 systemd[1]: Started weewx.service - WeeWX >>>>>> weather system. >>>>>> Aug 14 12:32:54 Pi-3 weewxd[985]: INFO __main__: Initializing weewxd >>>>>> version 5.4.0 >>>>>> Aug 14 12:32:54 Pi-3 weewxd[985]: INFO __main__: Command line: >>>>>> /home/pi/weewx-venv/lib/python3.13/site-packages/weewxd.py >>>>>> /home/pi/weewx-data/weewx.conf >>>>>> Aug 14 12:32:54 Pi-3 weewxd[985]: INFO __main__: Using Python: 3.13.5 >>>>>> (main, Jul 15 2026, 20:25:40) [GCC 14.2.0] >>>>>> Aug 14 12:32:54 Pi-3 weewxd[985]: INFO __main__: Located at: >>>>>> /home/pi/weewx-venv/bin/python >>>>>> Aug 14 12:32:54 Pi-3 weewxd[985]: INFO __main__: Platform: >>>>>> Linux-6.18.39+rpt-rpi-v8-aarch64-with-glibc2.41 >>>>>> Aug 14 12:32:54 Pi-3 weewxd[985]: INFO __main__: Locale: >>>>>> 'en_US.UTF-8' >>>>>> Aug 14 12:32:54 Pi-3 weewxd[985]: INFO __main__: Entry path: >>>>>> /home/pi/weewx-venv/lib/python3.13/site-packages/weewxd.py >>>>>> Aug 14 12:32:54 Pi-3 weewxd[985]: INFO __main__: WEEWX_ROOT: >>>>>> /home/pi/weewx-data >>>>>> Aug 14 12:32:54 Pi-3 weewxd[985]: INFO __main__: Config file: >>>>>> /home/pi/weewx-data/weewx.conf >>>>>> pi@Pi-3:~ $ >>>>>> On Friday, August 14, 2026 at 3:01:28 PM UTC-5 Tom Keffer wrote: >>>>>> >>>>>>> I assume your concern are the lines >>>>>>> >>>>>>> Aug 14 12:36:07 Pi-3 systemd-timesyncd[315]: Contacted time server >>>>>>> [2607:f1c0:f054:5e00::2]:123 (2.debian.pool.ntp.org). >>>>>>> Aug 14 12:36:07 Pi-3 systemd-timesyncd[315]: Initial clock >>>>>>> synchronization to Fri 2026-08-14 12:36:07.050420 CDT. >>>>>>> >>>>>>> >>>>>>> which occur well after weewxd has started up. You did not post the >>>>>>> full log from boot, so we don't know if there was an earlier attempt at >>>>>>> synchronization. Let's take a look. Try running this: >>>>>>> >>>>>>> journalctl -b -u systemd-timesyncd >>>>>>> >>>>>>> Compare the time to the weewxd startup: >>>>>>> >>>>>>> journalctl -b -u weewx | head >>>>>>> >>>>>>> Also, was there a meaningful clock correction? Is there something >>>>>>> that is creating concern? >>>>>>> >>>>>>> -tk >>>>>>> >>>>>>> >>>>>>> On Fri, Aug 14, 2026 at 11:52 AM [email protected] <[email protected]> >>>>>>> wrote: >>>>>>> >>>>>>>> I noticed after booting that weewx is starting before the time is >>>>>>>> synchronized. See the partial log attached. I'm a weewx pip install >>>>>>>> Version 5.4 on a Pi running Trixie based Raspberry OS Lite. I don't >>>>>>>> think >>>>>>>> I've messed with anything and it sure looks like the weewx.service file >>>>>>>> that's active has the Requires= and After=time-sync.target commands. >>>>>>>> >>>>>>>> I don't know when this broke, but I'm positive it used to work. >>>>>>>> >>>>>>>> Walt >>>>>>>> >>>>>>>> -- >>>>>>>> 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 visit >>>>>>>> https://groups.google.com/d/msgid/weewx-user/79c08560-8e07-4b39-afca-0eea029149d6n%40googlegroups.com >>>>>>>> <https://groups.google.com/d/msgid/weewx-user/79c08560-8e07-4b39-afca-0eea029149d6n%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 [email protected]. >>>>>> >>>>> To view this discussion visit >>>>>> https://groups.google.com/d/msgid/weewx-user/49b52235-bf13-4fc3-a51b-73d4a3ef6261n%40googlegroups.com >>>>>> <https://groups.google.com/d/msgid/weewx-user/49b52235-bf13-4fc3-a51b-73d4a3ef6261n%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 [email protected]. >>>> >>> To view this discussion visit >>>> https://groups.google.com/d/msgid/weewx-user/d414c6d7-bd3d-4d78-8000-39da0334c3c3n%40googlegroups.com >>>> <https://groups.google.com/d/msgid/weewx-user/d414c6d7-bd3d-4d78-8000-39da0334c3c3n%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 [email protected]. > To view this discussion visit > https://groups.google.com/d/msgid/weewx-user/4f4c376d-a370-4d04-a1b4-8d0adab94e03n%40googlegroups.com > <https://groups.google.com/d/msgid/weewx-user/4f4c376d-a370-4d04-a1b4-8d0adab94e03n%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 [email protected]. To view this discussion visit https://groups.google.com/d/msgid/weewx-user/CAPq0zEAE0BED6HzM4fO8idqfv0r46YR473j3_ToeAC%2BsVCEAdA%40mail.gmail.com.
