[chrony-users] Debugging PPS messages in chrony

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-users Archives ]


Hi all,

I am looking at setting up a relatively custom thing for timekeeping, which attempts to function as a GPS (in terms of PPS + unix stamp) using an RTC and microcontroller.

As a result I cannot use gpsd, my intention was to supply the PPS on a GPIO pin and transfer the corresponding timestamp to the SHM location. The PPS signal is routed corrected, as can be seen by

$ sudo ppstest /dev/pps0
trying PPS source "/dev/pps0"
found PPS source "/dev/pps0"
ok, found 1 source(s), now start fetching data...
source 0 - assert 1720367204.484611266, sequence: 415 - clear  0.000000000, sequence: 0
source 0 - assert 1720367205.484547142, sequence: 416 - clear  0.000000000, sequence: 0
source 0 - assert 1720367206.484646017, sequence: 417 - clear  0.000000000, sequence: 0

But it seems like this is not seen by chrony at all, as far as I know it wants the SHM update to actually synchronize, but when I added that it wasn't working so I'm trying to peel back the layers. Can I see confirmation anywhere that chrony registers the PPS by itself? My chrony config is loosely based on the default:

$ cat /etc/chrony/chrony.conf
# Welcome to the chrony configuration file. See chrony.conf(5) for more
# information about usuable directives.

# This will use (up to):
# - 4 sources from ntp.ubuntu.com which some are ipv6 enabled
# - 2 sources from 2.ubuntu.pool.ntp.org which is ipv6 enabled as well
# - 1 source from [01].ubuntu.pool.ntp.org each (ipv4 only atm)
# This means by default, up to 6 dual-stack and up to 2 additional IPv4-only
# sources will be used.
# At the same time it retains some protection against one of the entries being
# down (compare to just using one of the lines). See (LP: #1754358) for the
# discussion.
#
# About using servers from the NTP Pool Project in general see (LP: #104525).
# Approved by Ubuntu Technical Board on 2011-02-08.
# See http://www.pool.ntp.org/join.html for more information.
#pool ntp.ubuntu.com        iburst maxsources 4
#pool 0.ubuntu.pool.ntp.org iburst maxsources 1
#pool 1.ubuntu.pool.ntp..org iburst maxsources 1
#pool 2.ubuntu.pool.ntp.org iburst maxsources 2
refclock PPS /dev/pps0 refid PPS trust prefer
#refclock SHM 2:perm=0666 delay 0.5 refid GPS noselect

# This directive specify the location of the file containing ID/key pairs for
# NTP authentication.
keyfile /etc/chrony/chrony.keys

# This directive specify the file into which chronyd will store the rate
# information.
#driftfile /var/lib/chrony/chrony.drift

# Uncomment the following line to turn logging on.
log tracking measurements statistics refclocks

# Log files location.
logdir /var/log/chrony

# Stop bad estimates upsetting machine clock.
maxupdateskew 100.0

# This directive enables kernel synchronisation (every 11 minutes) of the
# real-time clock. Note that it can’t be used along with the 'rtcfile' directive.
rtcsync

# Step the system clock instead of slewing it if the adjustment is larger than
# one second, but only in the first three clock updates.
makestep 1 3

Systemctl status also shows some difficulty opening the log file, I'm not 100% sure the cause for this as the directory exists

$ systemctl status chrony
● chrony.service - chrony, an NTP client/server
     Loaded: loaded (/lib/systemd/system/chrony.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2024-07-07 17:45:20 CEST; 4min 5s ago
       Docs: man:chronyd(8)
             man:chronyc(1)
             man:chrony.conf(5)
    Process: 1191 ExecStart=/usr/lib/systemd/scripts/chronyd-starter.sh $DAEMON_OPTS (code=exited, status=0/SUCCESS)
    Process: 1198 ExecStartPost=/usr/lib/chrony/chrony-helper update-daemon (code=exited, status=0/SUCCESS)
   Main PID: 1196 (chronyd)
      Tasks: 2 (limit: 7967)
     Memory: 984.0K
     CGroup: /system.slice/chrony.service
             ├─1196 /usr/sbin/chronyd -F -1
             └─1197 /usr/sbin/chronyd -F -1

Jul 07 17:45:20 Khadas systemd[1]: Starting chrony, an NTP client/server...
Jul 07 17:45:20 Khadas chronyd[1196]: chronyd version 3.5 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +A>
Jul 07 17:45:20 Khadas chronyd[1196]: Could not open log file /var/log/chrony/tracking.log
Jul 07 17:45:20 Khadas chronyd[1196]: Loaded seccomp filter
Jul 07 17:45:20 Khadas systemd[1]: Started chrony, an NTP client/server.

But the directory is forever empty:

$ ls /var/log -al | grep chrony
drwxr-xr-x   2    119             129    4096 Aug 25  2020 chrony

Sorry this became quite a long message, I wanted to be sure I captured everything.

Best regards,
Morten


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/