Discussion:
[chrony-users] GPS / Chrony NTP server config questions
Miroslav Lichvar
2017-11-14 15:36:18 UTC
Permalink
Thank you for the quick response Bill... The PPS is coming in on /dev/pps1
which is what I have in the refclock entry in my chrony.conf file. When run
/sys/devices/virtual/pps/pps1/assert
1510661769.997836084#571264
That looks good. The configuration also looks good. I guess the only
thing that could be wrong is the offset value on the SHM line. Does
the machine have an internet connection? It might help if you could
configure it with an NTP server and remove the lock option from PPS to
see if it works that way and to see if the offset of the NMEA source
needs to be adjusted.

If that doesn't work, recompiling chrony with debug support
(--enable-debug) and running chronyd with -d -d should show why it's
ignoring the PPS samples.
--
Miroslav Lichvar
--
To unsubscribe email chrony-users-***@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-***@chrony.tuxfamily.org
with "help" in the subject.
Trouble? Email ***@chrony.tuxfamily.org.
Joe Smith
2017-11-14 20:45:41 UTC
Permalink
I rebuilt chrony with --enable-debug and ran with -d -d Below is some
output although I'm not 100% sure what it means. Tried looking at the
source code to see if I could ascertain the cause but I was unable. I let
it run for a bit and here's some sample output. The pattern just seems to
repeat over and over.

2017-11-14T20:34:08Z refclock.c:765:(filter_add_sample) filter sample 0
t=1510691647.698064095 offset=-0.198064096 dispersion=0.000001833
2017-11-14T20:34:08Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse
ignored offset=0.003574796 sync=0 dist=1.500000000
2017-11-14T20:34:09Z refclock.c:765:(filter_add_sample) filter sample 1
t=1510691649.560963143 offset=-0.060963144 dispersion=0.000001833
2017-11-14T20:34:09Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse
ignored offset=0.003580218 sync=0 dist=1.500000000
2017-11-14T20:34:10Z refclock_shm.c:104:(shm_poll) SHM sample ignored
mode=1 count=1202298 valid=0
2017-11-14T20:34:10Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse
ignored offset=0.003583732 sync=0 dist=1.500000000
2017-11-14T20:34:11Z refclock.c:765:(filter_add_sample) filter sample 2
t=1510691651.549839364 offset=-0.049839365 dispersion=0.000001833
2017-11-14T20:34:11Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse
ignored offset=0.003582173 sync=0 dist=1.500000000
2017-11-14T20:34:12Z refclock_shm.c:104:(shm_poll) SHM sample ignored
mode=1 count=1202302 valid=0
2017-11-14T20:34:12Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse
ignored offset=0.003574833 sync=0 dist=1.500000000
2017-11-14T20:34:13Z refclock.c:765:(filter_add_sample) filter sample 3
t=1510691653.564970804 offset=-0.064970805 dispersion=0.000001833
2017-11-14T20:34:13Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse
ignored offset=0.003576043 sync=0 dist=1.500000000
2017-11-14T20:34:14Z refclock_shm.c:104:(shm_poll) SHM sample ignored
mode=1 count=1202306 valid=0
2017-11-14T20:34:14Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse
ignored offset=0.003574430 sync=0 dist=1.500000000
2017-11-14T20:34:15Z refclock.c:765:(filter_add_sample) filter sample 4
t=1510691654.612400335 offset=-0.112400336 dispersion=0.000001833
2017-11-14T20:34:15Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse
ignored offset=0.003573701 sync=0 dist=1.500000000
2017-11-14T20:34:16Z refclock.c:765:(filter_add_sample) filter sample 5
t=1510691656.599152919 offset=-0.099152920 dispersion=0.000001833
2017-11-14T20:34:16Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse
ignored offset=0.003564191 sync=0 dist=1.500000000
2017-11-14T20:34:17Z refclock.c:765:(filter_add_sample) filter sample 6
t=1510691657.519233732 offset=-0.019233733 dispersion=0.000001833
2017-11-14T20:34:17Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse
ignored offset=0.003540440 sync=0 dist=1.500000000
2017-11-14T20:34:18Z refclock.c:765:(filter_add_sample) filter sample 7
t=1510691658.565950335 offset=-0.065950336 dispersion=0.000001833
2017-11-14T20:34:18Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse
ignored offset=0.003555990 sync=0 dist=1.500000000
2017-11-14T20:34:19Z refclock.c:765:(filter_add_sample) filter sample 8
t=1510691659.612487851 offset=-0.112487852 dispersion=0.000001833
2017-11-14T20:34:19Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse
ignored offset=0.003554507 sync=0 dist=1.500000000
2017-11-14T20:34:20Z refclock_shm.c:104:(shm_poll) SHM sample ignored
mode=1 count=1202318 valid=0
2017-11-14T20:34:20Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse
ignored offset=0.003536535 sync=0 dist=1.500000000
2017-11-14T20:34:21Z refclock.c:765:(filter_add_sample) filter sample 9
t=1510691661.556102500 offset=-0.056102501 dispersion=0.000001833
2017-11-14T20:34:21Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse
ignored offset=0.003563863 sync=0 dist=1.500000000
2017-11-14T20:34:22Z refclock.c:765:(filter_add_sample) filter sample 10
t=1510691662.603828315 offset=-0.103828316 dispersion=0.000001833
2017-11-14T20:34:22Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse
ignored offset=0.003559951 sync=0 dist=1.500000000
2017-11-14T20:34:23Z refclock_shm.c:104:(shm_poll) SHM sample ignored
mode=1 count=1202324 valid=0
2017-11-14T20:34:23Z sources.c:356:(SRC_AccumulateSample) ip=[NMEA]
t=1510691656.723338336 ofs=0.080481 del=0.200000 disp=0.009623 str=0
2017-11-14T20:34:23Z sourcestats.c:583:(SST_DoNewRegression)
off=1.007180e-01 freq=6.636850e-05 skew=3.159318e-04 n=16 bs=0 runs=10
asym=0.000000 arun=0
Thank you for the quick response Bill... The PPS is coming in on
/dev/pps1
which is what I have in the refclock entry in my chrony.conf file. When
run
/sys/devices/virtual/pps/pps1/assert
1510661769.997836084#571264
That looks good. The configuration also looks good. I guess the only
thing that could be wrong is the offset value on the SHM line. Does
the machine have an internet connection? It might help if you could
configure it with an NTP server and remove the lock option from PPS to
see if it works that way and to see if the offset of the NMEA source
needs to be adjusted.
If that doesn't work, recompiling chrony with debug support
(--enable-debug) and running chronyd with -d -d should show why it's
ignoring the PPS samples.
--
Miroslav Lichvar
--
with "unsubscribe" in the subject.
with "help" in the subject.
Bill Unruh
2017-11-14 21:53:31 UTC
Permalink
I have also not looked at the code recently but am suspicious. The time is
for example 1510691647.698064095 That is almost exactly half way between the
two seconds, and I think that the time needs to be within 1/4 sec of the top
of the second for chrony to think that there is a lock, and to start looking
at the time.

As Lichvar suggested, it would be a really great idea to connect your system
to the ethernet and to see what an ntp server somewhere else thinks is the
correct time.
Two possibilities. One is that it is the clear edge of the pulse that needs to
be used as the top of the second. the second is that your nmea (GPS) time is
out by just about exactly 1/2 a second (which way I have no idea without some
other time source. )



William G. Unruh __| Canadian Institute for|____ Tel: +1(604)822-3273
Physics&Astronomy _|___ Advanced Research _|____ Fax: +1(604)822-5324
UBC, Vancouver,BC _|_ Program in Cosmology |____ ***@physics.ubc.ca
Canada V6T 1Z1 ____|____ and Gravity ______|_ www.theory.physics.ubc.ca/
I rebuilt chrony with --enable-debug and ran with -d -d  Below is some output although I'm
not 100% sure what it means. Tried looking at the source code to see if I could ascertain
the cause but I was unable. I let it run for a bit and here's some sample output. The
pattern just seems to repeat over and over.
2017-11-14T20:34:08Z refclock.c:765:(filter_add_sample) filter sample 0
t=1510691647.698064095 offset=-0.198064096 dispersion=0.000001833
2017-11-14T20:34:08Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse ignored
offset=0.003574796 sync=0 dist=1.500000000
2017-11-14T20:34:09Z refclock.c:765:(filter_add_sample) filter sample 1
t=1510691649.560963143 offset=-0.060963144 dispersion=0.000001833
2017-11-14T20:34:09Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse ignored
offset=0.003580218 sync=0 dist=1.500000000
2017-11-14T20:34:10Z refclock_shm.c:104:(shm_poll) SHM sample ignored mode=1 count=1202298
valid=0
2017-11-14T20:34:10Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse ignored
offset=0.003583732 sync=0 dist=1.500000000
2017-11-14T20:34:11Z refclock.c:765:(filter_add_sample) filter sample 2
t=1510691651.549839364 offset=-0.049839365 dispersion=0.000001833
2017-11-14T20:34:11Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse ignored
offset=0.003582173 sync=0 dist=1.500000000
2017-11-14T20:34:12Z refclock_shm.c:104:(shm_poll) SHM sample ignored mode=1 count=1202302
valid=0
2017-11-14T20:34:12Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse ignored
offset=0.003574833 sync=0 dist=1.500000000
2017-11-14T20:34:13Z refclock.c:765:(filter_add_sample) filter sample 3
t=1510691653.564970804 offset=-0.064970805 dispersion=0.000001833
2017-11-14T20:34:13Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse ignored
offset=0.003576043 sync=0 dist=1.500000000
2017-11-14T20:34:14Z refclock_shm.c:104:(shm_poll) SHM sample ignored mode=1 count=1202306
valid=0
2017-11-14T20:34:14Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse ignored
offset=0.003574430 sync=0 dist=1.500000000
2017-11-14T20:34:15Z refclock.c:765:(filter_add_sample) filter sample 4
t=1510691654.612400335 offset=-0.112400336 dispersion=0.000001833
2017-11-14T20:34:15Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse ignored
offset=0.003573701 sync=0 dist=1.500000000
2017-11-14T20:34:16Z refclock.c:765:(filter_add_sample) filter sample 5
t=1510691656.599152919 offset=-0.099152920 dispersion=0.000001833
2017-11-14T20:34:16Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse ignored
offset=0.003564191 sync=0 dist=1.500000000
2017-11-14T20:34:17Z refclock.c:765:(filter_add_sample) filter sample 6
t=1510691657.519233732 offset=-0.019233733 dispersion=0.000001833
2017-11-14T20:34:17Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse ignored
offset=0.003540440 sync=0 dist=1.500000000
2017-11-14T20:34:18Z refclock.c:765:(filter_add_sample) filter sample 7
t=1510691658.565950335 offset=-0.065950336 dispersion=0.000001833
2017-11-14T20:34:18Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse ignored
offset=0.003555990 sync=0 dist=1.500000000
2017-11-14T20:34:19Z refclock.c:765:(filter_add_sample) filter sample 8
t=1510691659.612487851 offset=-0.112487852 dispersion=0.000001833
2017-11-14T20:34:19Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse ignored
offset=0.003554507 sync=0 dist=1.500000000
2017-11-14T20:34:20Z refclock_shm.c:104:(shm_poll) SHM sample ignored mode=1 count=1202318
valid=0
2017-11-14T20:34:20Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse ignored
offset=0.003536535 sync=0 dist=1.500000000
2017-11-14T20:34:21Z refclock.c:765:(filter_add_sample) filter sample 9
t=1510691661.556102500 offset=-0.056102501 dispersion=0.000001833
2017-11-14T20:34:21Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse ignored
offset=0.003563863 sync=0 dist=1.500000000
2017-11-14T20:34:22Z refclock.c:765:(filter_add_sample) filter sample 10
t=1510691662.603828315 offset=-0.103828316 dispersion=0.000001833
2017-11-14T20:34:22Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse ignored
offset=0.003559951 sync=0 dist=1.500000000
2017-11-14T20:34:23Z refclock_shm.c:104:(shm_poll) SHM sample ignored mode=1 count=1202324
valid=0
2017-11-14T20:34:23Z sources.c:356:(SRC_AccumulateSample) ip=[NMEA] t=1510691656.723338336
ofs=0.080481 del=0.200000 disp=0.009623 str=0
2017-11-14T20:34:23Z sourcestats.c:583:(SST_DoNewRegression) off=1.007180e-01
freq=6.636850e-05 skew=3.159318e-04 n=16 bs=0 runs=10 asym=0.000000 arun=0
Thank you for the quick response Bill... The PPS is coming in on /dev/pps1
which is what I have in the refclock entry in my chrony.conf file. When run
/sys/devices/virtual/pps/pps1/assert
1510661769.997836084#571264
That looks good. The configuration also looks good. I guess the only
thing that could be wrong is the offset value on the SHM line. Does
the machine have an internet connection? It might help if you could
configure it with an NTP server and remove the lock option from PPS to
see if it works that way and to see if the offset of the NMEA source
needs to be adjusted.
If that doesn't work, recompiling chrony with debug support
(--enable-debug) and running chronyd with -d -d should show why it's
ignoring the PPS samples.
--
Miroslav Lichvar
--
with "unsubscribe" in the subject.
with "help" in the subject.
Miroslav Lichvar
2017-11-15 07:02:00 UTC
Permalink
Post by Joe Smith
I rebuilt chrony with --enable-debug and ran with -d -d Below is some
output although I'm not 100% sure what it means. Tried looking at the
source code to see if I could ascertain the cause but I was unable. I let
it run for a bit and here's some sample output. The pattern just seems to
repeat over and over.
The "sync=0 dist=1.5" part says the system clock is not synchronized,
which suggests it's not trying to lock to the NMEA source. Looking at
your config again, I see now that the PPS refclock is missing "lock
NMEA".

Alternatively, you could try to remove noselect from the NMEA line, so
chronyd can synchronize the clock to the NMEA source first and then
it can switch to PPS.
Post by Joe Smith
2017-11-14T20:34:22Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse
ignored offset=0.003559951 sync=0 dist=1.500000000
2017-11-14T20:34:23Z refclock_shm.c:104:(shm_poll) SHM sample ignored
mode=1 count=1202324 valid=0
2017-11-14T20:34:23Z sources.c:356:(SRC_AccumulateSample) ip=[NMEA]
t=1510691656.723338336 ofs=0.080481 del=0.200000 disp=0.009623 str=0
2017-11-14T20:34:23Z sourcestats.c:583:(SST_DoNewRegression)
off=1.007180e-01 freq=6.636850e-05 skew=3.159318e-04 n=16 bs=0 runs=10
asym=0.000000 arun=0
Thank you for the quick response Bill... The PPS is coming in on
/dev/pps1
which is what I have in the refclock entry in my chrony.conf file. When
run
/sys/devices/virtual/pps/pps1/assert
1510661769.997836084#571264
That looks good. The configuration also looks good. I guess the only
thing that could be wrong is the offset value on the SHM line. Does
the machine have an internet connection? It might help if you could
configure it with an NTP server and remove the lock option from PPS to
see if it works that way and to see if the offset of the NMEA source
needs to be adjusted.
If that doesn't work, recompiling chrony with debug support
(--enable-debug) and running chronyd with -d -d should show why it's
ignoring the PPS samples.
--
Miroslav Lichvar
--
with "unsubscribe" in the subject.
with "help" in the subject.
--
Miroslav Lichvar
--
To unsubscribe email chrony-users-***@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-***@chrony.tuxfamily.org
with "help" in the subject.
Trouble? Email ***@chrony.tuxfamily.org.
Joe Smith
2017-11-15 11:31:24 UTC
Permalink
Thank you so much!! With the lock NMEA it is no longer ignoring the pulses.
I should be able to make adjustments to the offset and whatnot to get the
clock accuracy down to where I need it.
Post by Miroslav Lichvar
Post by Joe Smith
I rebuilt chrony with --enable-debug and ran with -d -d Below is some
output although I'm not 100% sure what it means. Tried looking at the
source code to see if I could ascertain the cause but I was unable. I let
it run for a bit and here's some sample output. The pattern just seems to
repeat over and over.
The "sync=0 dist=1.5" part says the system clock is not synchronized,
which suggests it's not trying to lock to the NMEA source. Looking at
your config again, I see now that the PPS refclock is missing "lock
NMEA".
Alternatively, you could try to remove noselect from the NMEA line, so
chronyd can synchronize the clock to the NMEA source first and then
it can switch to PPS.
Post by Joe Smith
2017-11-14T20:34:22Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse
ignored offset=0.003559951 sync=0 dist=1.500000000
2017-11-14T20:34:23Z refclock_shm.c:104:(shm_poll) SHM sample ignored
mode=1 count=1202324 valid=0
2017-11-14T20:34:23Z sources.c:356:(SRC_AccumulateSample) ip=[NMEA]
t=1510691656.723338336 ofs=0.080481 del=0.200000 disp=0.009623 str=0
2017-11-14T20:34:23Z sourcestats.c:583:(SST_DoNewRegression)
off=1.007180e-01 freq=6.636850e-05 skew=3.159318e-04 n=16 bs=0 runs=10
asym=0.000000 arun=0
Thank you for the quick response Bill... The PPS is coming in on
/dev/pps1
which is what I have in the refclock entry in my chrony.conf file.
When
Post by Joe Smith
run
/sys/devices/virtual/pps/pps1/assert
1510661769.997836084#571264
That looks good. The configuration also looks good. I guess the only
thing that could be wrong is the offset value on the SHM line. Does
the machine have an internet connection? It might help if you could
configure it with an NTP server and remove the lock option from PPS to
see if it works that way and to see if the offset of the NMEA source
needs to be adjusted.
If that doesn't work, recompiling chrony with debug support
(--enable-debug) and running chronyd with -d -d should show why it's
ignoring the PPS samples.
--
Miroslav Lichvar
--
with "unsubscribe" in the subject.
with "help" in the subject.
--
Miroslav Lichvar
--
with "unsubscribe" in the subject.
with "help" in the subject.
Bill Unruh
2017-11-15 16:48:23 UTC
Permalink
William G. Unruh __| Canadian Institute for|____ Tel: +1(604)822-3273
Physics&Astronomy _|___ Advanced Research _|____ Fax: +1(604)822-5324
UBC, Vancouver,BC _|_ Program in Cosmology |____ ***@physics.ubc.ca
Canada V6T 1Z1 ____|____ and Gravity ______|_ www.theory.physics.ubc.ca/
Thank you so much!! With the lock NMEA it is no longer ignoring the pulses. I should be able
to make adjustments to the offset and whatnot to get the clock accuracy down to where I need
it.
NMEA can never give better than 10s of ms accuracy. The problem is that when
the gps receiver sends out an NMEA sentence is arbitrary and even the length
of the sentence is to an extent arbitrary. To get better accuracy, it is the
PPS that gives it. However the pps conveys only the information of when the
turnover of the second occurs, not which second that is. That is what the NMEA
is needed for. (and once the system has that once , it really no longer needs
the NMEA) since the system clock is sufficiently regular that it can figure
out which second the pulse belongs to for at least many hours, and usually for
months.

Thus: chrony is switched on. Chrony uses the NMEA sentences ( or infomation
from network ntp servers) to get the system clock disciplined to 10's of ms.
The PPS now takes over, and the clock then gets disciplined to microsecond
accuracy. If the PPS is interrupted for some reason, the system clock carries
over the seconds information for hours to days until the PPS works again.
I rebuilt chrony with --enable-debug and ran with -d -d  Below is some
output although I'm not 100% sure what it means. Tried looking at the
source code to see if I could ascertain the cause but I was unable. I let
it run for a bit and here's some sample output. The pattern just seems to
repeat over and over.
The "sync=0 dist=1.5" part says the system clock is not synchronized,
which suggests it's not trying to lock to the NMEA source. Looking at
your config again, I see now that the PPS refclock is missing "lock
NMEA".
Alternatively, you could try to remove noselect from the NMEA line, so
chronyd can synchronize the clock to the NMEA source first and then
it can switch to PPS.
2017-11-14T20:34:22Z refclock.c:520:(RCL_AddCookedPulse) refclock pulse
ignored offset=0.003559951 sync=0 dist=1.500000000
2017-11-14T20:34:23Z refclock_shm.c:104:(shm_poll) SHM sample ignored
mode=1 count=1202324 valid=0
2017-11-14T20:34:23Z sources.c:356:(SRC_AccumulateSample) ip=[NMEA]
t=1510691656.723338336 ofs=0.080481 del=0.200000 disp=0.009623 str=0
2017-11-14T20:34:23Z sourcestats.c:583:(SST_DoNewRegression)
off=1.007180e-01 freq=6.636850e-05 skew=3.159318e-04 n=16 bs=0 runs=10
asym=0.000000 arun=0
Thank you for the quick response Bill... The PPS is coming in on
/dev/pps1
which is what I have in the refclock entry in my chrony.conf file. When
run
/sys/devices/virtual/pps/pps1/assert
1510661769.997836084#571264
That looks good. The configuration also looks good. I guess the only
thing that could be wrong is the offset value on the SHM line. Does
the machine have an internet connection? It might help if you could
configure it with an NTP server and remove the lock option from PPS to
see if it works that way and to see if the offset of the NMEA source
needs to be adjusted.
If that doesn't work, recompiling chrony with debug support
(--enable-debug) and running chronyd with -d -d should show why it's
ignoring the PPS samples.
Joe Smith
2017-11-16 13:07:44 UTC
Permalink
I'm trying to determine the best way to get an idea of my clock accuracy
now that I'm getting the PPS signals. Is that "chronyc tracking"? When I do
"chronyc sources" or "chronyc sourcestats" those seem to indicate NMEA
offsets that are on the order of 40-60ms.

***@beaglebone:~$ chronyc sources
210 Number of sources = 2
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
#? NMEA 0 4 377 14 -59ms[ -59ms] +/-
107ms
#* PPS 0 4 377 12 -1985ns[-2545ns] +/-
1792ns
***@beaglebone:~$ chronyc sourcestats
210 Number of sources = 2
Name/IP Address NP NR Span Frequency Freq Skew Offset Std
Dev
==============================================================================
NMEA 64 29 1009 -8.352 14.888 -48ms
9366us
PPS 10 3 145 -0.000 0.136 -2ns
3981ns
***@beaglebone:~$ chronyc tracking
Reference ID : 50505300 (PPS)
Stratum : 1
Ref time (UTC) : Thu Nov 16 13:04:35 2017
System time : 0.000000898 seconds slow of NTP time
Last offset : -0.000000564 seconds
RMS offset : 0.000011269 seconds
Frequency : 39.580 ppm fast
Residual freq : -0.000 ppm
Skew : 0.138 ppm
Root delay : 0.000000001 seconds
Root dispersion : 0.000025743 seconds
Update interval : 16.0 seconds
Leap status : Normal

The "chronyc tracking" output seems to indicate (if I'm understanding the
documentation correctly) that the accuracy is pretty good. Am I
interpreting this correctly?
Post by Bill Unruh
William G. Unruh __| Canadian Institute for|____ Tel: +1(604)822-3273
Physics&Astronomy _|___ Advanced Research _|____ Fax: +1(604)822-5324
Canada V6T 1Z1 ____|____ and Gravity ______|_ www.theory.physics.ubc.ca/
Thank you so much!! With the lock NMEA it is no longer ignoring the
pulses. I should be able
to make adjustments to the offset and whatnot to get the clock accuracy
down to where I need
it.
NMEA can never give better than 10s of ms accuracy. The problem is that when
the gps receiver sends out an NMEA sentence is arbitrary and even the length
of the sentence is to an extent arbitrary. To get better accuracy, it is the
PPS that gives it. However the pps conveys only the information of when the
turnover of the second occurs, not which second that is. That is what the NMEA
is needed for. (and once the system has that once , it really no longer needs
the NMEA) since the system clock is sufficiently regular that it can figure
out which second the pulse belongs to for at least many hours, and usually for
months.
Thus: chrony is switched on. Chrony uses the NMEA sentences ( or infomation
from network ntp servers) to get the system clock disciplined to 10's of ms.
The PPS now takes over, and the clock then gets disciplined to microsecond
accuracy. If the PPS is interrupted for some reason, the system clock carries
over the seconds information for hours to days until the PPS works again.
Post by Joe Smith
I rebuilt chrony with --enable-debug and ran with -d -d Below is
some
Post by Joe Smith
output although I'm not 100% sure what it means. Tried looking at
the
Post by Joe Smith
source code to see if I could ascertain the cause but I was
unable. I let
Post by Joe Smith
it run for a bit and here's some sample output. The pattern just
seems to
Post by Joe Smith
repeat over and over.
The "sync=0 dist=1.5" part says the system clock is not
synchronized,
which suggests it's not trying to lock to the NMEA source. Looking at
your config again, I see now that the PPS refclock is missing "lock
NMEA".
Alternatively, you could try to remove noselect from the NMEA line, so
chronyd can synchronize the clock to the NMEA source first and then
it can switch to PPS.
Post by Joe Smith
2017-11-14T20:34:22Z refclock.c:520:(RCL_AddCookedPulse)
refclock pulse
Post by Joe Smith
ignored offset=0.003559951 sync=0 dist=1.500000000
2017-11-14T20:34:23Z refclock_shm.c:104:(shm_poll) SHM sample
ignored
Post by Joe Smith
mode=1 count=1202324 valid=0
2017-11-14T20:34:23Z sources.c:356:(SRC_AccumulateSample)
ip=[NMEA]
Post by Joe Smith
t=1510691656.723338336 ofs=0.080481 del=0.200000 disp=0.009623
str=0
Post by Joe Smith
2017-11-14T20:34:23Z sourcestats.c:583:(SST_DoNewRegression)
off=1.007180e-01 freq=6.636850e-05 skew=3.159318e-04 n=16 bs=0
runs=10
Post by Joe Smith
asym=0.000000 arun=0
On Tue, Nov 14, 2017 at 10:36 AM, Miroslav Lichvar <
Thank you for the quick response Bill... The PPS is coming in
on
Post by Joe Smith
/dev/pps1
which is what I have in the refclock entry in my chrony.conf
file. When
Post by Joe Smith
run
/sys/devices/virtual/pps/pps1/assert
1510661769.997836084#571264
That looks good. The configuration also looks good. I guess the
only
Post by Joe Smith
thing that could be wrong is the offset value on the SHM line.
Does
Post by Joe Smith
the machine have an internet connection? It might help if you
could
Post by Joe Smith
configure it with an NTP server and remove the lock option from
PPS to
Post by Joe Smith
see if it works that way and to see if the offset of the NMEA
source
Post by Joe Smith
needs to be adjusted.
If that doesn't work, recompiling chrony with debug support
(--enable-debug) and running chronyd with -d -d should show why
it's
Post by Joe Smith
ignoring the PPS samples.
Bill Unruh
2017-11-16 17:57:08 UTC
Permalink
William G. Unruh __| Canadian Institute for|____ Tel: +1(604)822-3273
Physics&Astronomy _|___ Advanced Research _|____ Fax: +1(604)822-5324
UBC, Vancouver,BC _|_ Program in Cosmology |____ ***@physics.ubc.ca
Canada V6T 1Z1 ____|____ and Gravity ______|_ www.theory.physics.ubc.ca/
I'm trying to determine the best way to get an idea of my clock accuracy now that I'm
getting the PPS signals. Is that "chronyc tracking"? When I do "chronyc sources" or "chronyc
sourcestats" those seem to indicate NMEA offsets that are on the order of 40-60ms.
NMEA is a prety terrible clock. a) the receiver decodes and composes the nmea
sentances when it is not busy doing something else. The sentences are delivers
at something like 30Kbaud, ( which is about 3000 bytes per second) The sentences
are about 50 bytes long, so just getting in a sentence takes about a 30ms of
a second. And each sentence has a slightly different length so the arrival of
the end of the sentence varies with its length. All of these things mean that
nmea is useless for accruracy better than about 10ms even if you compensate
for the average time delay.

You cannot estimate the accuracy of the PPS from the nmea sentences. It is
like trying to estimate the accuracy of a stopwatch by using a water clock.
210 Number of sources = 2
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
#? NMEA                          0   4   377    14    -59ms[  -59ms] +/-  107ms
#* PPS                           0   4   377    12  -1985ns[-2545ns] +/- 1792ns
210 Number of sources = 2
Name/IP Address            NP  NR  Span  Frequency  Freq Skew  Offset  Std Dev
==============================================================================
NMEA                       64  29  1009     -8.352     14.888    -48ms  9366us
PPS                        10   3   145     -0.000      0.136     -2ns  3981ns
Reference ID    : 50505300 (PPS)
Stratum         : 1
Ref time (UTC)  : Thu Nov 16 13:04:35 2017
System time     : 0.000000898 seconds slow of NTP time
Last offset     : -0.000000564 seconds
RMS offset      : 0.000011269 seconds
Frequency       : 39.580 ppm fast
Residual freq   : -0.000 ppm
Skew            : 0.138 ppm
Root delay      : 0.000000001 seconds
Root dispersion : 0.000025743 seconds
Update interval : 16.0 seconds
Leap status     : Normal
The "chronyc tracking" output seems to indicate (if I'm understanding the documentation
correctly) that the accuracy is pretty good. Am I interpreting this correctly?
The PPS accuracy is largely determined by the interrupt handling time, which
is something like a usec. It depends, so that if the the pps comes in when the
computer is reading a disk (which used non-interruptable interrupts) it will
be delayed by many microseconds. But yes, the PPS should be pretty good. as
tracking says it has a rms offset of about 10us. Most of that is delay, so the
accuracy is probably about 10us, The precision is much better, in the hundreds
of ns range.

The only way you could estimate more accurately is to run the PPS to a scope,
and have the system send out a pulse say on the parallel port at a
predetermined time (say 100 usec after the top of the hour using polling of
the clock to say when to send out that pulse) and see what the actual offset
is on the scope.
William G. Unruh __| Canadian Institute for|____ Tel: +1(604)822-3273
Physics&Astronomy _|___ Advanced Research _|____ Fax: +1(604)822-5324
Canada V6T 1Z1 ____|____ and Gravity ______|_ www.theory.physics.ubc.ca/
Thank you so much!! With the lock NMEA it is no longer ignoring the
pulses. I should be able
to make adjustments to the offset and whatnot to get the clock
accuracy down to where I need
it.
NMEA can never give better than 10s of ms accuracy. The problem is that when
the gps receiver sends out an NMEA sentence is arbitrary and even the length
of the sentence is to an extent arbitrary. To get better accuracy, it is the
PPS that gives it. However the pps conveys only the information of when the
turnover of the second occurs, not which second that is. That is what the NMEA
is needed for. (and once the system has that once , it really no longer needs
the NMEA) since the system clock is sufficiently regular that it can figure
out which second the pulse belongs to for at least many hours, and usually for
months.
Thus: chrony is switched on. Chrony uses the NMEA sentences ( or infomation
from network ntp servers) to get the system clock disciplined to 10's of ms.
The PPS now takes over, and the clock then gets disciplined to microsecond
accuracy. If the PPS is interrupted for some reason, the system clock carries
over the seconds information for hours to days until the PPS works again.
On Wed, Nov 15, 2017 at 2:02 AM, Miroslav Lichvar
      > I rebuilt chrony with --enable-debug and ran with -d -d 
Below is some
      > output although I'm not 100% sure what it means. Tried
looking at the
      > source code to see if I could ascertain the cause but I was
unable. I let
      > it run for a bit and here's some sample output. The pattern
just seems to
      > repeat over and over.
      The "sync=0 dist=1.5" part says the system clock is not
synchronized,
      which suggests it's not trying to lock to the NMEA source.
Looking at
      your config again, I see now that the PPS refclock is missing
"lock
      NMEA".
      Alternatively, you could try to remove noselect from the NMEA
line, so
      chronyd can synchronize the clock to the NMEA source first and
then
      it can switch to PPS.
      > 2017-11-14T20:34:22Z refclock.c:520:(RCL_AddCookedPulse)
refclock pulse
      > ignored offset=0.003559951 sync=0 dist=1.500000000
      > 2017-11-14T20:34:23Z refclock_shm.c:104:(shm_poll) SHM
sample ignored
      > mode=1 count=1202324 valid=0
      > 2017-11-14T20:34:23Z sources.c:356:(SRC_AccumulateSample)
ip=[NMEA]
      > t=1510691656.723338336 ofs=0.080481 del=0.200000
disp=0.009623 str=0
      > 2017-11-14T20:34:23Z sourcestats.c:583:(SST_DoNewRegression)
      > off=1.007180e-01 freq=6.636850e-05 skew=3.159318e-04 n=16
bs=0 runs=10
      > asym=0.000000 arun=0
      >
      > On Tue, Nov 14, 2017 at 10:36 AM, Miroslav Lichvar
      >
      > > > Thank you for the quick response Bill... The PPS is
coming in on
      > > /dev/pps1
      > > > which is what I have in the refclock entry in my
chrony.conf file. When
      > > run
      > > >
      > > > /sys/devices/virtual/pps/pps1/assert
      > > > 1510661769.997836084#571264
      > >
      > > That looks good. The configuration also looks good. I
guess the only
      > > thing that could be wrong is the offset value on the SHM
line. Does
      > > the machine have an internet connection? It might help if
you could
      > > configure it with an NTP server and remove the lock option
from PPS to
      > > see if it works that way and to see if the offset of the
NMEA source
      > > needs to be adjusted.
      > >
      > > If that doesn't work, recompiling chrony with debug
support
      > > (--enable-debug) and running chronyd with -d -d should
show why it's
      > > ignoring the PPS samples.
Denny Page
2017-11-16 18:20:46 UTC
Permalink
Interrupt latency for character devices in Linux is 6-7 us, even with no other activity. You can get better than this using a gpio and spinning on it, but I haven’t seen anyone do this with with serial pps.

Denny
Post by Bill Unruh
The PPS accuracy is largely determined by the interrupt handling time, which
is something like a usec. It depends, so that if the the pps comes in when the
computer is reading a disk (which used non-interruptable interrupts) it will
be delayed by many microseconds.
Bill Unruh
2017-11-16 18:32:34 UTC
Permalink
Post by Denny Page
Interrupt latency for character devices in Linux is 6-7 us, even with no other activity. You
It has been a while but I ran tests on a system in which I changed the state
of a parallel port pin and fed that into an interrupt grabbing the system time
just before toggling the pin, and the time when the interrupt service routine
got the interrupt. The latency was of the
order of 1us, not 7. Now that was on an older machine with the 1us, not the ns
clock. I have not tried this recently but would be surprized if the time was
worse now.
Post by Denny Page
can get better than this using a gpio and spinning on it, but I haven’t seen anyone do this
Well, that is unclear, and hugely expensive in terms of taking up the time of
the cpu.
Post by Denny Page
with with serial pps.
Denny
The PPS accuracy is largely determined by the interrupt handling time, which
is something like a usec. It depends, so that if the the pps comes in when the
computer is reading a disk (which used non-interruptable interrupts) it will
be delayed by many microseconds.
Rob Janssen
2017-11-16 19:06:18 UTC
Permalink
Post by Bill Unruh
Post by Denny Page
Interrupt latency for character devices in Linux is 6-7 us, even with no other activity. You
It has been a while but I ran tests on a system in which I changed the state
of a parallel port pin and fed that into an interrupt grabbing the system time
just before toggling the pin, and the time when the interrupt service routine
got the interrupt. The latency was of the
order of 1us, not 7. Now that was on an older machine with the 1us, not the ns
clock. I have not tried this recently but would be surprized if the time was
worse now.
I am using chrony with serial PPS on a number of different machines, and I see the 6-7 us figure
on HP Proliant systems while on Dell PowerEdge sytems it is more like 1us.
No idea where the difference comes from.

Plotting the offset from chronyc tracking normally yields values well within 200ns (with the occasional
peak to 600ns) for a Dell, while a HP is normally within 2us and peaks to 6us.

It apparenly varies with system design so it doesn't surprise me that people find different values.
(what does surprise me that it varies little between very different models from the same manufacturer,
yet it varies so widely between manufacturers)

Rob
--
To unsubscribe email chrony-users-***@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-***@chrony.tuxfamily.org
with "help" in the subject.
Trouble? Email ***@chrony.tuxfamily.org.
Bill Unruh
2017-11-16 19:49:21 UTC
Permalink
Post by Rob Janssen
Post by Bill Unruh
Post by Denny Page
Interrupt latency for character devices in Linux is 6-7 us, even with no
other activity. You
It has been a while but I ran tests on a system in which I changed the state
of a parallel port pin and fed that into an interrupt grabbing the system time
just before toggling the pin, and the time when the interrupt service routine
got the interrupt. The latency was of the
order of 1us, not 7. Now that was on an older machine with the 1us, not the ns
clock. I have not tried this recently but would be surprized if the time was
worse now.
I am using chrony with serial PPS on a number of different machines, and I
see the 6-7 us figure
on HP Proliant systems while on Dell PowerEdge sytems it is more like 1us.
No idea where the difference comes from.
How do you measure that latency? It does seem that the parallel port is a much
faster interrupt than the serial port, so it might have something to do with
the serial port hardware used. (in particular if the serial port is really a
phony serial->usb port I would expect large latency).
Post by Rob Janssen
Plotting the offset from chronyc tracking normally yields values well within
200ns (with the occasional
peak to 600ns) for a Dell, while a HP is normally within 2us and peaks to 6us.
It apparenly varies with system design so it doesn't surprise me that people
find different values.
(what does surprise me that it varies little between very different models
from the same manufacturer,
yet it varies so widely between manufacturers)
Rob
--
"unsubscribe" in the subject.
subject.
--
To unsubscribe email chrony-users-***@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-***@chrony.tuxfamily.org
with "help" in the subject.
Trouble? Email ***@chrony.tuxfamily.org.
Rob Janssen
2017-11-16 20:36:53 UTC
Permalink
Post by Bill Unruh
Post by Rob Janssen
I am using chrony with serial PPS on a number of different machines, and I see the 6-7 us figure
on HP Proliant systems while on Dell PowerEdge sytems it is more like 1us.
No idea where the difference comes from.
How do you measure that latency? It does seem that the parallel port is a much
faster interrupt than the serial port, so it might have something to do with
the serial port hardware used. (in particular if the serial port is really a
phony serial->usb port I would expect large latency).
Well, I did not really measure the absolute latency very accurately, it is more the jitter in the latency what
is appearing in my measurements.
I compared two computers each running on a separate GPSDO but close together, using a scope,
and they were quite close in timing. But those were both Dell computers. Later we started using HP and the
results were a little worse.
However, my goal for this application is <10us between systems and it is always possible to achieve that.

All of those systems have an "onboard UART". Setserial determines them as:
/dev/ttyS0 at 0x03f8 (irq = 4) is a 16550A
However there is of course no 16550A anywhere on those boards, it is a cell in some system support chip.

It is true that parallel is better than serial, if only due to the lack of RS232 linedrivers with their associated
filtering (slew rate limiting) as defined in the RS232 standard. Equipment manufacturers may add additional
filters on each line for EMI reasons. The (emulated) 16550 may add other delays.
A parallel port traditionally was only some 74LS latch, and its current implementation probably still is faster than a UART.

For really accurate PPS handling one would want a dedicated PCI-E card with a clock oscillator and a counter,
latched in a register on PPS edge, and issuing the interrupt. The driver would then read the latched counter
value and the current counter value on interrupt. The interrupt response time becomes irrelevant because the
actual timestamp has been latched by the hardware. I think some Meinberg products use this method.

Rob
--
To unsubscribe email chrony-users-***@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-***@chrony.tuxfamily.org
with "help" in the subject.
Trouble? Email ***@chrony.tuxfamily.org.
Bill Unruh
2017-11-16 21:40:12 UTC
Permalink
Post by Rob Janssen
Post by Bill Unruh
Post by Rob Janssen
I am using chrony with serial PPS on a number of different machines, and I
see the 6-7 us figure
on HP Proliant systems while on Dell PowerEdge sytems it is more like 1us.
No idea where the difference comes from.
How do you measure that latency? It does seem that the parallel port is a much
faster interrupt than the serial port, so it might have something to do with
the serial port hardware used. (in particular if the serial port is really a
phony serial->usb port I would expect large latency).
Well, I did not really measure the absolute latency very accurately, it is
more the jitter in the latency what
is appearing in my measurements.
OK. That is of course a different though related question.
Post by Rob Janssen
I compared two computers each running on a separate GPSDO but close together,
using a scope,
and they were quite close in timing. But those were both Dell computers.
Later we started using HP and the
results were a little worse.
However, my goal for this application is <10us between systems and it is
always possible to achieve that.
/dev/ttyS0 at 0x03f8 (irq = 4) is a 16550A
However there is of course no 16550A anywhere on those boards, it is a cell
in some system support chip.
It is true that parallel is better than serial, if only due to the lack of
The problem of course is that very few computers come with parallel ports
these days.
Post by Rob Janssen
RS232 linedrivers with their associated
filtering (slew rate limiting) as defined in the RS232 standard. Equipment
manufacturers may add additional
filters on each line for EMI reasons. The (emulated) 16550 may add other delays.
A parallel port traditionally was only some 74LS latch, and its current
implementation probably still is faster than a UART.
For really accurate PPS handling one would want a dedicated PCI-E card with a
clock oscillator and a counter,
latched in a register on PPS edge, and issuing the interrupt. The driver
would then read the latched counter
value and the current counter value on interrupt. The interrupt response
time becomes irrelevant because the
actual timestamp has been latched by the hardware. I think some Meinberg
products use this method.
Certainly, but that is another expense which is really beyond the chrony/ntpd
level. Of course one then has to relate that timestamp on the card to the
computer's system time, and take into account that card counter's changes in
drift etc. Ie, one have two clocks not to discipline-- the onboard counter and
the system clock. Not that that is that difficult but it is an added
complexity.
--
To unsubscribe email chrony-users-***@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-***@chrony.tuxfamily.org
with "help" in the subject.
Trouble? Email ***@chrony.tuxfamily.org.
Rob Janssen
2017-11-17 11:50:54 UTC
Permalink
Post by Bill Unruh
Post by Rob Janssen
/dev/ttyS0 at 0x03f8 (irq = 4) is a 16550A
However there is of course no 16550A anywhere on those boards, it is a cell in some system support chip.
It is true that parallel is better than serial, if only due to the lack of
The problem of course is that very few computers come with parallel ports
these days.
The same holds for serial ports. And when there is one, it might well be a bit-banged port with only Rx/Tx data,
or a USB device. Fortunately we are dealing with "server grade" systems that usually still have a serial port or two.
Post by Bill Unruh
Post by Rob Janssen
For really accurate PPS handling one would want a dedicated PCI-E card with a clock oscillator and a counter,
latched in a register on PPS edge, and issuing the interrupt. The driver would then read the latched counter
value and the current counter value on interrupt. The interrupt response time becomes irrelevant because the
actual timestamp has been latched by the hardware. I think some Meinberg products use this method.
Certainly, but that is another expense which is really beyond the chrony/ntpd
level. Of course one then has to relate that timestamp on the card to the
computer's system time, and take into account that card counter's changes in
drift etc. Ie, one have two clocks not to discipline-- the onboard counter and
the system clock. Not that that is that difficult but it is an added
complexity.
It depends on the approach. You could have a 10 MHz oscillator disciplined to GPS and ticking a counter and
discipline that for real time, but a simpler approach is to just have a freerunning 10 MHz (or so) crystal oscillator
that ticks a counter that you latch at PPS event time and then in the handler readout the current counter value
and the latched value, subtract them, and you know your interrupt latency for that particular pulse. You also readout
the system time as usual and discipline it using the PPS, but corrected for the latency.
When your latency is of the order of 1-10us (say 100us worst case), the effect of an error in the 10 MHz is very
small because it is scaled by the factor latency/total time, or about 10^5, and an error there only slightly affects the
accuracy of real time, not the drift of the clock etc.

I have some plans for our system to offload the entire accurate timing thing to an external board anyway. Just
NTP discipline of the clock will be sufficient, and then the 10 MHz and 1PPS from the GPSDO go to an external
board that does the exact timing in an FPGA or similar.

Rob
--
To unsubscribe email chrony-users-***@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-***@chrony.tuxfamily.org
with "help" in the subject.
Trouble? Email ***@chrony.tuxfamily.org.
Miroslav Lichvar
2017-11-20 10:20:30 UTC
Permalink
Post by Bill Unruh
Post by Rob Janssen
For really accurate PPS handling one would want a dedicated PCI-E card
with a clock oscillator and a counter,
latched in a register on PPS edge, and issuing the interrupt. The
driver would then read the latched counter
value and the current counter value on interrupt. The interrupt
response time becomes irrelevant because the
actual timestamp has been latched by the hardware. I think some
Meinberg products use this method.
Certainly, but that is another expense which is really beyond the chrony/ntpd
level. Of course one then has to relate that timestamp on the card to the
computer's system time, and take into account that card counter's changes in
drift etc. Ie, one have two clocks not to discipline-- the onboard counter and
the system clock. Not that that is that difficult but it is an added
complexity.
This is already supported in chrony with the option enabling external
PPS timestamping in the PHC driver. For instance, the Intel I210 card
has software defined pins (SDP), which can be used to accurately
timestamp a PPS signal.

In chrony.conf it can be specified like this:
refclock PHC /dev/ptp0:extpps:pin=1 width 0.2 poll 2 refid GPS

The accuracy of the system clock is then limited by the asymmetry of
the PCI-E bus, which is apparently in the order of hundreds of
nanoseconds. If the same card is used for timestamping the PPS and NTP
packets, this asymmetry will cancel out for NTP clients. This way, you
can build an NTP server which probably beats any commercial solution
currently available on the market in both accuracy and price. The
clients just need to support the interleaved mode.
--
Miroslav Lichvar
--
To unsubscribe email chrony-users-***@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-***@chrony.tuxfamily.org
with "help" in the subject.
Trouble? Email ***@chrony.tuxfamily.org.
Denny Page
2017-11-16 20:36:15 UTC
Permalink
Post by Bill Unruh
Post by Denny Page
Interrupt latency for character devices in Linux is 6-7 us, even with no other activity. You
It has been a while but I ran tests on a system in which I changed the state
of a parallel port pin and fed that into an interrupt grabbing the system time
just before toggling the pin, and the time when the interrupt service routine
got the interrupt. The latency was of the
order of 1us, not 7. Now that was on an older machine with the 1us, not the ns
clock. I have not tried this recently but would be surprized if the time was
worse now.
Hmm… I can’t speak to parallel port, but I can’t see that it would be much different that any other APIC based interrupt. I’ve experimented with several serial interface chips, Intel and AMD with power management disabled, and the 6-7us seems pretty consistent. I would love to lower this, and am really open to suggestion if you have ideas. Yes, I know that MSI should be lower, and while I do have serial cards that support MSI, none of the Linux drivers support it for the chips I have. I haven’t been motivated yet to rewrite the drivers for MSI. :)
Post by Bill Unruh
Post by Denny Page
can get better than this using a gpio and spinning on it, but I haven’t seen anyone do this
Well, that is unclear, and hugely expensive in terms of taking up the time of
the cpu.
It’s not completely free running. You run a loop that includes a pause which allows you to trade off between the duty cycle of the CPU and resolution of the pulse.

Denny
--
To unsubscribe email chrony-users-***@chrony.tuxfamily.org
with "unsubscribe" in the subject.
For help email chrony-users-***@chrony.tuxfamily.org
with "help" in the subject.
Trouble? Email ***@chrony.tuxfamily.org.
Bill Unruh
2017-11-16 21:33:25 UTC
Permalink
Post by Bill Unruh
Post by Denny Page
Interrupt latency for character devices in Linux is 6-7 us, even with no other activity. You
It has been a while but I ran tests on a system in which I changed the state
of a parallel port pin and fed that into an interrupt grabbing the system time
just before toggling the pin, and the time when the interrupt service routine
got the interrupt. The latency was of the
order of 1us, not 7. Now that was on an older machine with the 1us, not the ns
clock. I have not tried this recently but would be surprized if the time was
worse now.
Hmm
 I can’t speak to parallel port, but I can’t see that it would be much different that any other APIC based interrupt. I’ve experimented with several serial interface chips, Intel and AMD with power management disabled, and the 6-7us seems pretty consistent. I would love to lower this, and am really open to suggestion if you have ideas. Yes, I know that MSI should be lower, and while I do have serial cards that support MSI, none of the Linux drivers support it for the chips I have. I haven’t been motivated yet to rewrite the drivers for MSI. :)
Well, as I said I made measurements which showed that the parallel port was of
the order of 1us. I vaguely recall that I also looked at the serial port and
it was worse, but I cannot remember any figures. The problem is that the
serial chip needs to register the interrupt and deliver it to the system.
Since serial ports operate at absurdly low baud rates, it is not so important
that the interrupt operate quickly, so I suspect manufacturers do not bother.
Post by Bill Unruh
Post by Denny Page
can get better than this using a gpio and spinning on it, but I haven’t seen anyone do this
Well, that is unclear, and hugely expensive in terms of taking up the time of
the cpu.
It’s not completely free running. You run a loop that includes a pause which allows you to trade off between the duty cycle of the CPU and resolution of the pulse.
But in order to get 1usec resolution you would have to be running that loop at
MHz which leaves not much time And finding something which will pause reliably
at the 1us time scale is also hard.
Denny
--
with "unsubscribe" in the subject.
with "help" in the subject.
Joe Smith
2017-11-16 18:21:13 UTC
Permalink
I'm not too concerned about the accuracy of the PPS. This particular GPS
receiver is pretty high quality.
https://learn.adafruit.com/adafruit-ultimate-gps/overview It delivers the
NMEA data and the PPS. A number of online resources describing similar
projects and the GPSD Time Service HOWTO page all speak highly of it. I
just wasn't sure if there was a way to get an idea of the clock accuracy
using chronyc. Mainly just to be sure I didn't do anything wrong with the
settings.
Post by Bill Unruh
William G. Unruh __| Canadian Institute for|____ Tel: +1(604)822-3273
Physics&Astronomy _|___ Advanced Research _|____ Fax: +1(604)822-5324
Canada V6T 1Z1 ____|____ and Gravity ______|_ www.theory.physics.ubc.ca/
I'm trying to determine the best way to get an idea of my clock accuracy
Post by Joe Smith
now that I'm
getting the PPS signals. Is that "chronyc tracking"? When I do "chronyc
sources" or "chronyc
sourcestats" those seem to indicate NMEA offsets that are on the order of 40-60ms.
NMEA is a prety terrible clock. a) the receiver decodes and composes the nmea
sentances when it is not busy doing something else. The sentences are delivers
at something like 30Kbaud, ( which is about 3000 bytes per second) The sentences
are about 50 bytes long, so just getting in a sentence takes about a 30ms of
a second. And each sentence has a slightly different length so the arrival of
the end of the sentence varies with its length. All of these things mean that
nmea is useless for accruracy better than about 10ms even if you compensate
for the average time delay.
You cannot estimate the accuracy of the PPS from the nmea sentences. It is
like trying to estimate the accuracy of a stopwatch by using a water clock.
Post by Joe Smith
210 Number of sources = 2
MS Name/IP address Stratum Poll Reach LastRx Last sample
============================================================
===================
#? NMEA 0 4 377 14 -59ms[ -59ms] +/-
107ms
#* PPS 0 4 377 12 -1985ns[-2545ns] +/-
1792ns
210 Number of sources = 2
Name/IP Address NP NR Span Frequency Freq Skew Offset
Std Dev
============================================================
==================
NMEA 64 29 1009 -8.352 14.888 -48ms
9366us
PPS 10 3 145 -0.000 0.136 -2ns
3981ns
Reference ID : 50505300 (PPS)
Stratum : 1
Ref time (UTC) : Thu Nov 16 13:04:35 2017
System time : 0.000000898 seconds slow of NTP time
Last offset : -0.000000564 seconds
RMS offset : 0.000011269 seconds
Frequency : 39.580 ppm fast
Residual freq : -0.000 ppm
Skew : 0.138 ppm
Root delay : 0.000000001 seconds
Root dispersion : 0.000025743 seconds
Update interval : 16.0 seconds
Leap status : Normal
The "chronyc tracking" output seems to indicate (if I'm understanding the documentation
correctly) that the accuracy is pretty good. Am I interpreting this correctly?
The PPS accuracy is largely determined by the interrupt handling time, which
is something like a usec. It depends, so that if the the pps comes in when the
computer is reading a disk (which used non-interruptable interrupts) it will
be delayed by many microseconds. But yes, the PPS should be pretty good. as
tracking says it has a rms offset of about 10us. Most of that is delay, so the
accuracy is probably about 10us, The precision is much better, in the hundreds
of ns range.
The only way you could estimate more accurately is to run the PPS to a scope,
and have the system send out a pulse say on the parallel port at a
predetermined time (say 100 usec after the top of the hour using polling of
the clock to say when to send out that pulse) and see what the actual offset
is on the scope.
Post by Joe Smith
+1(604)822-3273
+1(604)822-5324
UBC, Vancouver,BC _|_ Program in Cosmology |____
Canada V6T 1Z1 ____|____ and Gravity ______|_
www.theory.physics.ubc.ca/
Thank you so much!! With the lock NMEA it is no longer ignoring the
pulses. I should be able
to make adjustments to the offset and whatnot to get the clock
accuracy down to where I need
it.
NMEA can never give better than 10s of ms accuracy. The problem is that when
the gps receiver sends out an NMEA sentence is arbitrary and even the length
of the sentence is to an extent arbitrary. To get better accuracy, it is the
PPS that gives it. However the pps conveys only the information of when the
turnover of the second occurs, not which second that is. That is what the NMEA
is needed for. (and once the system has that once , it really no longer needs
the NMEA) since the system clock is sufficiently regular that it can figure
out which second the pulse belongs to for at least many hours, and usually for
months.
Thus: chrony is switched on. Chrony uses the NMEA sentences ( or infomation
from network ntp servers) to get the system clock disciplined to 10's of ms.
The PPS now takes over, and the clock then gets disciplined to microsecond
accuracy. If the PPS is interrupted for some reason, the system clock carries
over the seconds information for hours to days until the PPS works again.
On Wed, Nov 15, 2017 at 2:02 AM, Miroslav Lichvar
Post by Joe Smith
I rebuilt chrony with --enable-debug and ran with -d
-d
Below is some
Post by Joe Smith
output although I'm not 100% sure what it means. Tried
looking at the
Post by Joe Smith
source code to see if I could ascertain the cause but
I was
unable. I let
Post by Joe Smith
it run for a bit and here's some sample output. The
pattern
just seems to
Post by Joe Smith
repeat over and over.
The "sync=0 dist=1.5" part says the system clock is not
synchronized,
which suggests it's not trying to lock to the NMEA
source.
Looking at
your config again, I see now that the PPS refclock is
missing
"lock
NMEA".
Alternatively, you could try to remove noselect from
the NMEA
line, so
chronyd can synchronize the clock to the NMEA source
first and
then
it can switch to PPS.
Post by Joe Smith
2017-11-14T20:34:22Z refclock.c:520:(RCL_AddCookedP
ulse)
refclock pulse
Post by Joe Smith
ignored offset=0.003559951 sync=0 dist=1.500000000
2017-11-14T20:34:23Z refclock_shm.c:104:(shm_poll) SHM
sample ignored
Post by Joe Smith
mode=1 count=1202324 valid=0
2017-11-14T20:34:23Z sources.c:356:(SRC_AccumulateS
ample)
ip=[NMEA]
Post by Joe Smith
t=1510691656.723338336 ofs=0.080481 del=0.200000
disp=0.009623 str=0
Post by Joe Smith
2017-11-14T20:34:23Z sourcestats.c:583:(SST_DoNewRe
gression)
Post by Joe Smith
off=1.007180e-01 freq=6.636850e-05 skew=3.159318e-04
n=16
bs=0 runs=10
Post by Joe Smith
asym=0.000000 arun=0
On Tue, Nov 14, 2017 at 10:36 AM, Miroslav Lichvar
On Tue, Nov 14, 2017 at 07:40:33AM -0500, Joe Smith
Thank you for the quick response Bill... The PPS
is
coming in on
Post by Joe Smith
/dev/pps1
which is what I have in the refclock entry in my
chrony.conf file. When
Post by Joe Smith
run
the cat command corresponding to that device I
cat
Post by Joe Smith
/sys/devices/virtual/pps/pps1/assert
1510661769.997836084#571264
That looks good. The configuration also looks good.
I
guess the only
Post by Joe Smith
thing that could be wrong is the offset value on
the SHM
line. Does
Post by Joe Smith
the machine have an internet connection? It might
help if
you could
Post by Joe Smith
configure it with an NTP server and remove the lock
option
from PPS to
Post by Joe Smith
see if it works that way and to see if the offset
of the
NMEA source
Post by Joe Smith
needs to be adjusted.
If that doesn't work, recompiling chrony with debug
support
Post by Joe Smith
(--enable-debug) and running chronyd with -d -d
should
show why it's
Post by Joe Smith
ignoring the PPS samples.
Bill Unruh
2017-11-16 18:35:31 UTC
Permalink
It has now been suggested to you at least by two different people-- hook your
system up to the network, and do a timing using a nearby ntp server.
That will give you of the order of 10-20us accuracy, and you can see if that
time is the same as your pps time.

I have no idea how accurate gpsd is. I have either written my own interrupt
handler or used the serial pps-ldisc module.




William G. Unruh __| Canadian Institute for|____ Tel: +1(604)822-3273
Physics&Astronomy _|___ Advanced Research _|____ Fax: +1(604)822-5324
UBC, Vancouver,BC _|_ Program in Cosmology |____ ***@physics.ubc.ca
Canada V6T 1Z1 ____|____ and Gravity ______|_ www.theory.physics.ubc.ca/
I'm not too concerned about the accuracy of the PPS. This particular GPS receiver is pretty
high quality. https://learn.adafruit.com/adafruit-ultimate-gps/overview  It delivers the
NMEA data and the PPS. A number of online resources describing similar projects and the GPSD
Time Service HOWTO page all speak highly of it. I just wasn't sure if there was a way to get
an idea of the clock accuracy using chronyc. Mainly just to be sure I didn't do anything
wrong with the settings.
William G. Unruh __| Canadian Institute for|____ Tel: +1(604)822-3273
Physics&Astronomy _|___ Advanced Research _|____ Fax: +1(604)822-5324
Canada V6T 1Z1 ____|____ and Gravity ______|_ www.theory.physics.ubc.ca/
I'm trying to determine the best way to get an idea of my clock
accuracy now that I'm
getting the PPS signals. Is that "chronyc tracking"? When I do
"chronyc sources" or "chronyc
sourcestats" those seem to indicate NMEA offsets that are on the
order of 40-60ms.
NMEA is a prety terrible clock. a) the receiver decodes and composes the nmea
sentances when it is not busy doing something else. The sentences are delivers
at something like 30Kbaud, ( which is about 3000 bytes per second) The sentences
are about 50 bytes long, so just getting in a sentence takes about a 30ms of
a second. And each sentence has a slightly different length so the arrival of
the end of the sentence varies with its length. All of these things mean that
nmea is useless for accruracy better than about 10ms even if you compensate
for the average time delay.
You cannot estimate the accuracy of the PPS from the nmea sentences. It is
like trying to estimate the accuracy of a stopwatch by using a water clock.
210 Number of sources = 2
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
#? NMEA                          0   4   377    14    -59ms[  -59ms]
+/-  107ms
#* PPS                           0   4   377    12  -1985ns[-2545ns]
+/- 1792ns
210 Number of sources = 2
Name/IP Address            NP  NR  Span  Frequency  Freq Skew 
Offset  Std Dev
==============================================================================
NMEA                       64  29  1009     -8.352     14.888   
-48ms  9366us
PPS                        10   3   145     -0.000      0.136   
 -2ns  3981ns
Reference ID    : 50505300 (PPS)
Stratum         : 1
Ref time (UTC)  : Thu Nov 16 13:04:35 2017
System time     : 0.000000898 seconds slow of NTP time
Last offset     : -0.000000564 seconds
RMS offset      : 0.000011269 seconds
Frequency       : 39.580 ppm fast
Residual freq   : -0.000 ppm
Skew            : 0.138 ppm
Root delay      : 0.000000001 seconds
Root dispersion : 0.000025743 seconds
Update interval : 16.0 seconds
Leap status     : Normal
The "chronyc tracking" output seems to indicate (if I'm
understanding the documentation
correctly) that the accuracy is pretty good. Am I interpreting this
correctly?
The PPS accuracy is largely determined by the interrupt handling time, which
is something like a usec. It depends, so that if the the pps comes in when the
computer is reading a disk (which used non-interruptable interrupts) it will
be delayed by many microseconds.  But yes, the PPS should be pretty good. as
tracking says it has a rms offset of about 10us. Most of that is delay, so the
accuracy is probably about 10us, The precision is much better, in the hundreds
of ns range.
The only way you could estimate more accurately is to run the PPS to a scope,
and have the system send out a pulse say on the parallel port at a
predetermined time (say 100 usec after the top of the hour using polling of
the clock to say when to send out that pulse) and see what the actual offset
is on the scope.
+1(604)822-3273
+1(604)822-5324
      UBC, Vancouver,BC _|_ Program in Cosmology |____
      Canada V6T 1Z1 ____|____ and Gravity ______|_
www.theory.physics.ubc.ca/
            Thank you so much!! With the lock NMEA it is no longer
ignoring the
            pulses. I should be able
            to make adjustments to the offset and whatnot to get the clock
            accuracy down to where I need
            it.
      NMEA can never give better than 10s of ms accuracy. The problem is
that when
      the gps receiver sends out an NMEA sentence is arbitrary and even
the length
      of the sentence is to an extent arbitrary. To get better accuracy,
it is the
      PPS that gives it. However the pps conveys only the information of
when the
      turnover of the second occurs, not which second that is. That is
what the NMEA
      is needed for. (and once the system has that once , it really no
longer needs
      the NMEA) since the system clock is sufficiently regular that it can
figure
      out which second the pulse belongs to for at least many hours, and
usually for
      months.
      Thus: chrony is switched on. Chrony uses the NMEA sentences ( or
infomation
      from network ntp servers) to get the system clock disciplined to
10's of ms.
      The PPS now takes over, and the clock then gets disciplined to
microsecond
      accuracy. If the PPS is interrupted for some reason, the system
clock carries
      over the seconds information for hours to days until the PPS works
again.
            On Wed, Nov 15, 2017 at 2:02 AM, Miroslav Lichvar
                  On Tue, Nov 14, 2017 at 03:45:41PM -0500, Joe Smith
                  > I rebuilt chrony with --enable-debug and ran with -d
-d 
            Below is some
                  > output although I'm not 100% sure what it means. Tried
            looking at the
                  > source code to see if I could ascertain the cause but
I was
            unable. I let
                  > it run for a bit and here's some sample output. The
pattern
            just seems to
                  > repeat over and over.
                  The "sync=0 dist=1.5" part says the system clock is not
            synchronized,
                  which suggests it's not trying to lock to the NMEA
source.
            Looking at
                  your config again, I see now that the PPS refclock is
missing
            "lock
                  NMEA".
                  Alternatively, you could try to remove noselect from the
NMEA
            line, so
                  chronyd can synchronize the clock to the NMEA source
first and
            then
                  it can switch to PPS.
                  > 2017-11-14T20:34:22Z
refclock.c:520:(RCL_AddCookedPulse)
            refclock pulse
                  > ignored offset=0.003559951 sync=0 dist=1.500000000
                  > 2017-11-14T20:34:23Z refclock_shm.c:104:(shm_poll) SHM
            sample ignored
                  > mode=1 count=1202324 valid=0
                  > 2017-11-14T20:34:23Z
sources.c:356:(SRC_AccumulateSample)
            ip=[NMEA]
                  > t=1510691656.723338336 ofs=0.080481 del=0.200000
            disp=0.009623 str=0
                  > 2017-11-14T20:34:23Z
sourcestats.c:583:(SST_DoNewRegression)
                  > off=1.007180e-01 freq=6.636850e-05 skew=3.159318e-04
n=16
            bs=0 runs=10
                  > asym=0.000000 arun=0
                  >
                  > On Tue, Nov 14, 2017 at 10:36 AM, Miroslav Lichvar
                  >
                  > > On Tue, Nov 14, 2017 at 07:40:33AM -0500, Joe Smith
                  > > > Thank you for the quick response Bill... The PPS
is
            coming in on
                  > > /dev/pps1
                  > > > which is what I have in the refclock entry in my
            chrony.conf file. When
                  > > run
                  > > > the cat command corresponding to that device I
                  > > >
cat
                  > > > /sys/devices/virtual/pps/pps1/assert
                  > > > 1510661769.997836084#571264
                  > >
                  > > That looks good. The configuration also looks good.
I
            guess the only
                  > > thing that could be wrong is the offset value on the
SHM
            line. Does
                  > > the machine have an internet connection? It might
help if
            you could
                  > > configure it with an NTP server and remove the lock
option
            from PPS to
                  > > see if it works that way and to see if the offset of
the
            NMEA source
                  > > needs to be adjusted.
                  > >
                  > > If that doesn't work, recompiling chrony with debug
            support
                  > > (--enable-debug) and running chronyd with -d -d
should
            show why it's
                  > > ignoring the PPS samples.
Paul J R
2017-11-19 04:32:41 UTC
Permalink
I thought i might add my own $0.02 as this is something i've been
working on for some time (i.e. trying to figure out which gps module is
best for my OSH project).

The MTK3339 is ok, but my current round of hardware design has been
putting the neo6m, Quectel L80 and MTK3339 up against each other and the
MTK3339 is the worst performer of the lot (which is not to say its bad),
but the jitter is higher and the sensitivity lower. To be fair, the neo
has a better antenna then the other two as im using these modules:

Loading Image...
Loading Image...

which are the same size for the L80 and MTK, but for the neo i have
something like this:

Loading Image...

The neo does the best (its also amazingly configurable), followed by the
L80 then the MTK in terms of how jittery they are, but the biggest issue
is the MTK3339 is more prone to dropping out where the other two
continue to maintain a gps signal (some of this can possibly be blamed
on my board design, however both the L80 and MTK use a nearly identical
board design).

Having said all that, when it comes to the time clients, they will often
slighly prefer the neo based unit (and if i take that away its the L80),
but the difference once you hit the network is insignificant (unless the
MTK looses its fix). If your to presume the module goes somewhere with a
good skyview, theres not alot to split the three. The L80 is harder to
get where the neo and mtk are readily available from a million sources
(but i cant get the neo in a form factor that i like for my project).

I've also put these three up against commercial units with interesting
results, but thats another story.

Regards, Paul
Post by Joe Smith
I'm not too concerned about the accuracy of the PPS. This particular
GPS receiver is pretty high quality.
https://learn.adafruit.com/adafruit-ultimate-gps/overview It delivers
the NMEA data and the PPS. A number of online resources describing
similar projects and the GPSD Time Service HOWTO page all speak highly
of it. I just wasn't sure if there was a way to get an idea of the
clock accuracy using chronyc. Mainly just to be sure I didn't do
anything wrong with the settings.
+1(604)822-3273 <tel:%2B1%28604%29822-3273>
+1(604)822-5324 <tel:%2B1%28604%29822-5324>
UBC, Vancouver,BC _|_ Program in Cosmology |____
Canada V6T 1Z1 ____|____ and Gravity ______|_
www.theory.physics.ubc.ca/ <http://www.theory.physics.ubc.ca/>
I'm trying to determine the best way to get an idea of my
clock accuracy now that I'm
getting the PPS signals. Is that "chronyc tracking"? When I do
"chronyc sources" or "chronyc
sourcestats" those seem to indicate NMEA offsets that are on
the order of 40-60ms.
NMEA is a prety terrible clock. a) the receiver decodes and composes the nmea
sentances when it is not busy doing something else. The sentences are delivers
at something like 30Kbaud, ( which is about 3000 bytes per second) The sentences
are about 50 bytes long, so just getting in a sentence takes about a 30ms of
a second. And each sentence has a slightly different length so the arrival of
the end of the sentence varies with its length. All of these things mean that
nmea is useless for accruracy better than about 10ms even if you compensate
for the average time delay.
You cannot estimate the accuracy of the PPS from the nmea
sentences. It is
like trying to estimate the accuracy of a stopwatch by using a water clock.
210 Number of sources = 2
MS Name/IP address         Stratum Poll Reach LastRx Last sample
===============================================================================
#? NMEA                          0   4   377    14 -59ms[ 
-59ms] +/-  107ms
#* PPS                           0   4   377    12
-1985ns[-2545ns] +/- 1792ns
210 Number of sources = 2
Name/IP Address            NP  NR  Span  Frequency Freq Skew 
Offset  Std Dev
==============================================================================
NMEA                       64  29  1009     -8.352  14.888   
-48ms  9366us
PPS                        10   3   145     -0.000   0.136   
 -2ns  3981ns
Reference ID    : 50505300 (PPS)
Stratum         : 1
Ref time (UTC)  : Thu Nov 16 13:04:35 2017
System time     : 0.000000898 seconds slow of NTP time
Last offset     : -0.000000564 seconds
RMS offset      : 0.000011269 seconds
Frequency       : 39.580 ppm fast
Residual freq   : -0.000 ppm
Skew            : 0.138 ppm
Root delay      : 0.000000001 seconds
Root dispersion : 0.000025743 seconds
Update interval : 16.0 seconds
Leap status     : Normal
The "chronyc tracking" output seems to indicate (if I'm
understanding the documentation
correctly) that the accuracy is pretty good. Am I interpreting
this correctly?
The PPS accuracy is largely determined by the interrupt handling time, which
is something like a usec. It depends, so that if the the pps comes in when the
computer is reading a disk (which used non-interruptable
interrupts) it will
be delayed by many microseconds.  But yes, the PPS should be
pretty good. as
tracking says it has a rms offset of about 10us. Most of that is delay, so the
accuracy is probably about 10us, The precision is much better, in the hundreds
of ns range.
The only way you could estimate more accurately is to run the PPS to a scope,
and have the system send out a pulse say on the parallel port at a
predetermined time (say 100 usec after the top of the hour using polling of
the clock to say when to send out that pulse) and see what the actual offset
is on the scope.
On Wed, Nov 15, 2017 at 11:48 AM, Bill Unruh
+1(604)822-3273 <tel:%2B1%28604%29822-3273>
+1(604)822-5324 <tel:%2B1%28604%29822-5324>
      UBC, Vancouver,BC _|_ Program in Cosmology |____
      Canada V6T 1Z1 ____|____ and Gravity ______|_
www.theory.physics.ubc.ca/ <http://www.theory.physics.ubc.ca/>
            Thank you so much!! With the lock NMEA it is no
longer ignoring the
            pulses. I should be able
            to make adjustments to the offset and whatnot to
get the clock
            accuracy down to where I need
            it.
      NMEA can never give better than 10s of ms accuracy. The
problem is that when
      the gps receiver sends out an NMEA sentence is arbitrary
and even the length
      of the sentence is to an extent arbitrary. To get better
accuracy, it is the
      PPS that gives it. However the pps conveys only the
information of when the
      turnover of the second occurs, not which second that is.
That is what the NMEA
      is needed for. (and once the system has that once , it
really no longer needs
      the NMEA) since the system clock is sufficiently regular
that it can figure
      out which second the pulse belongs to for at least many
hours, and usually for
      months.
      Thus: chrony is switched on. Chrony uses the NMEA
sentences ( or infomation
      from network ntp servers) to get the system clock
disciplined to 10's of ms.
      The PPS now takes over, and the clock then gets
disciplined to microsecond
      accuracy. If the PPS is interrupted for some reason, the
system clock carries
      over the seconds information for hours to days until the
PPS works again.
            On Wed, Nov 15, 2017 at 2:02 AM, Miroslav Lichvar
                  On Tue, Nov 14, 2017 at 03:45:41PM -0500,
                  > I rebuilt chrony with --enable-debug and
ran with -d -d
            Below is some
                  > output although I'm not 100% sure what it
means. Tried
            looking at the
                  > source code to see if I could ascertain
the cause but I was
            unable. I let
                  > it run for a bit and here's some sample
output. The pattern
            just seems to
                  > repeat over and over.
                  The "sync=0 dist=1.5" part says the system
clock is not
            synchronized,
                  which suggests it's not trying to lock to
the NMEA source.
            Looking at
                  your config again, I see now that the PPS
refclock is missing
            "lock
                  NMEA".
                  Alternatively, you could try to remove
noselect from the NMEA
            line, so
                  chronyd can synchronize the clock to the
NMEA source first and
            then
                  it can switch to PPS.
                  > 2017-11-14T20:34:22Z
refclock.c:520:(RCL_AddCookedPulse)
            refclock pulse
                  > ignored offset=0.003559951 sync=0
dist=1.500000000
                  > 2017-11-14T20:34:23Z
refclock_shm.c:104:(shm_poll) SHM
            sample ignored
                  > mode=1 count=1202324 valid=0
                  > 2017-11-14T20:34:23Z
sources.c:356:(SRC_AccumulateSample)
            ip=[NMEA]
                  > t=1510691656.723338336 ofs=0.080481
del=0.200000
            disp=0.009623 str=0
                  > 2017-11-14T20:34:23Z
sourcestats.c:583:(SST_DoNewRegression)
                  > off=1.007180e-01 freq=6.636850e-05
skew=3.159318e-04 n=16
            bs=0 runs=10
                  > asym=0.000000 arun=0
                  >
                  > On Tue, Nov 14, 2017 at 10:36 AM, Miroslav
Lichvar
                  >
                  > > On Tue, Nov 14, 2017 at 07:40:33AM
                  > > > Thank you for the quick response
Bill... The PPS is
            coming in on
                  > > /dev/pps1
                  > > > which is what I have in the refclock
entry in my
            chrony.conf file. When
                  > > run
                  > > > the cat command corresponding to that
                  > > >
                  > > >
                  > > > /sys/devices/virtual/pps/pps1/assert
                  > > > 1510661769.997836084#571264
                  > >
                  > > That looks good. The configuration also
looks good. I
            guess the only
                  > > thing that could be wrong is the offset
value on the SHM
            line. Does
                  > > the machine have an internet connection?
It might help if
            you could
                  > > configure it with an NTP server and
remove the lock option
            from PPS to
                  > > see if it works that way and to see if
the offset of the
            NMEA source
                  > > needs to be adjusted.
                  > >
                  > > If that doesn't work, recompiling chrony
with debug
            support
                  > > (--enable-debug) and running chronyd
with -d -d should
            show why it's
                  > > ignoring the PPS samples.
Loading...