I'm trying to set up something simple.  I want chrony to grab NMEA time as soon 
as it's available, and then sync to PPS.  This system (BBB) has no 
battery-backed RTC and no network access.

When the time is initially correct (set via NTP when connected to network), 
chrony seems to work, and locks to PPS. But when it powers up with a default 
date of 2000, it never syncs after getting GPS lock.

It seems to step once, to the bogus RTC time.  But then it never steps to NMEA 
root@beaglebone:~# chronyd -d
2000-01-01T00:01:29Z chronyd version 2.4 starting (+CMDMON +NTP +REFCLOCK +RTC 
2000-01-01T00:01:29Z Setting filter length for PPS to 1
2000-01-01T00:01:29Z Setting filter length for NMEA to 2
2000-01-01T00:01:29Z Frequency -40.366 +/- 234.206 ppm read from 
2000-01-01T00:01:29Z Using right/UTC timezone to obtain leap second data
2000-01-01T00:01:36Z Selected source NMEA
2000-01-01T00:01:36Z System clock wrong by -11404807.817246 seconds, adjustment 
1999-08-22T00:01:28Z System clock was stepped by -11404807.817246 seconds
1999-08-22T00:01:55Z Can't synchronise: no selectable sources
1999-08-22T00:02:00Z Selected source NMEA
1999-08-22T00:02:02Z System clock wrong by -0.029797 seconds, adjustment started
1999-08-22T00:02:04Z System clock wrong by 0.020517 seconds, adjustment started
1999-08-22T00:02:15Z RTC wrong by 11404807.787 seconds (step)
1999-08-22T00:02:15Z Could not set RTC time
1999-08-22T00:02:18Z Can't synchronise: no selectable sources
1999-08-22T00:02:36Z Selected source NMEA
1999-08-22T00:02:36Z System clock wrong by 361331.850290 seconds, adjustment 
1999-08-26T04:24:48Z System clock was stepped by 361331.850290 seconds
1999-08-26T04:24:50Z Can't synchronise: no selectable sources
1999-08-26T04:25:10Z RTC wrong by 11043475.933 seconds (step)
1999-08-26T04:25:10Z Could not set RTC time

brian@beaglebone:~$ chronyc sources
210 Number of sources = 2
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
#? PPS                           0   0     0     -     +0ns[   +0ns] +/-    0ns

#? NMEA                          0   1   377     2   -6314d[ -6314d] +/- 10559m
brian@beaglebone:~$ chronyc tracking
Reference ID    : ()
Stratum         : 10
Ref time (UTC)  : Thu Aug 26 04:40:34 1999
System time     : 0.000000000 seconds slow of NTP time
Last offset     : -361331.843750000 seconds
RMS offset      : 114263.164062500 seconds
Frequency       : 40.366 ppm slow
Residual freq   : +0.000 ppm
Skew            : 0.000 ppm
Root delay      : 0.000000 seconds
Root dispersion : 0.000003 seconds
Update interval : 20.0 seconds

Leap status     : Normal

brian@beaglebone:~$ chronyc rtcdata
RTC ref time (UTC) : Thu Aug 26 04:43:22 1999
Number of samples  : 4
Number of runs     : 0
Sample span period :    3
RTC is fast by     :     0.347582 seconds
RTC gains time at  :   -77.250 ppm

brian@beaglebone:~$ cat /etc/chrony/chrony.conf
# use at least this many samples of the refclock measurement to reduce jitter
minsamples 10
maxsamples 60

# measure kernel PPS every second, referenced to NMEA time. 
refclock PPS /dev/pps0 poll 0 refid PPS lock NMEA maxsamples 60 prefer

# Get NMEA data from gpsd over shared memory. 
# Our GPS sends $GSV (sats in view) followed by $GLL (time), at 9600 bps, so 
# time msg is delayed a variable amount. To help get a better time estimate 
when using 
# NMEA only, we estimate this to be fixed offset of 160 msec.  Assume a 
variable delay 
# of +/- 250 msec.
# Allow this measurement to set clock initially.  This also serves as a 
fallback in case
# a clock discontinuity causes PPS to fail sanity checking. (Otherwise, PPS 
# permanently become invalidated and time sync will never resume.)
# Measure the NMEA time every 2 seconds.
refclock SHM 0 offset 0.160 delay 0.5 poll 1 refid NMEA 

# Step the clock if the time is off by more than N seconds.
makestep 5.0 -1

leapsectz right/UTC

driftfile /var/lib/chrony/chrony.drift

# Disable logging to save space...
#log tracking measurements statistics refclocks
logdir /var/log/chrony

# Log any adjustment of > 10 msec
logchange 0.01

dumpdir /var/lib/chrony

# Use real-time scheduler priority
sched_priority 5

# if there's a local clock issue, the PPS changes stratum to match this 
# 10 means very suspect.
local stratum 10

# act as NTP server

# Update the RTC if error is > N seconds
rtcautotrim 1.0
rtcfile /var/lib/chrony/chrony.rtc

# do not use any NTP servers
#pool us.pool.ntp.org iburst offline

# No NTP authentication used
#keyfile /etc/chrony/chrony.keys

To unsubscribe email chrony-users-requ...@chrony.tuxfamily.org 
with "unsubscribe" in the subject.
For help email chrony-users-requ...@chrony.tuxfamily.org 
with "help" in the subject.
Trouble?  Email listmas...@chrony.tuxfamily.org.

Reply via email to