Re: [chrony-users] Trouble with PPS

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


Hi!

I've tried your configuration (main difference was only the offset values). It sometimes seems to work, but not always.

Here's a series of 'sources' requests output:
#* GPS                           0   4    77    18    +90ms[ +306ms] +/- 6773us
#? PPS                           0   4     6    39   -290ms[  -74ms] +/- 1622us

#* GPS                           0   4    77    21    +90ms[ +306ms] +/- 6985us
#? PPS                           0   4     6    42   -290ms[  -74ms] +/- 1834us

#* GPS                           0   4    77    24    +90ms[ +306ms] +/- 6985us
#? PPS                           0   4     6    45   -290ms[  -74ms] +/- 1834us

#* GPS                           0   4   177    10   +176ms[ +131ms] +/-   22ms
#? PPS                           0   4    14    56   -245ms[  -74ms] +/- 1841us

#* GPS                           0   4   377    28    +51ms[ +140ms] +/- 7070us
#? PPS                           0   4    30    90   -334ms[  -74ms] +/- 1863us

#* GPS                           0   4   377    21    -33ms[-8808us] +/-   14ms
#? PPS                           0   4   140   127   -436ms[  -74ms] +/- 1970us

#* GPS                           0   4   377    11  -6962us[  -53ms] +/- 6869us
#? PPS                           0   4   200   155   -396ms[  -74ms] +/- 2138us

So up to now, it seems like PPS is being read correctly, although it really takes some time for it (shouldn't LastRX be never bigger than 1 second?). And then, suddenly:
#* GPS                           0   4   377    27    +19ms[  +39ms] +/- 6878us
#? PPS                           0   4     0   193   -393ms[  -74ms] +/- 2336us

Reach turns to 0.

I've restarted all daemons (gpsd, chronyd), and it's been now like this for a while:
#* GPS                           0   4   377    22  -1160us[-1267us] +/- 6691us
#? PPS                           0   4     0     -     +0ns[   +0ns] +/-    0ns

So in this instance it hasn't received any PPS signal, but I know that's false, because I see kernel messages showing pps0 access.




2018-04-14 4:03 GMT+02:00 Simon Haines <simon@xxxxxxxxxxxxxxxx>:
Here is the configuration I use for a device that is not network-connected, and uses GPS+PPS to derive accurate time. Note the offset for the GPS clock so that the PPS signal can be aligned to the correct GPS time message.

refclock PPS /dev/pps0 poll 4 refid PPS lock GPS
refclock SHM 0 poll 4 offset 0.1 refid GPS 
makestep 0.001 -1
maxupdateskew 1
lock_all
log refclocks
logdir /var/log

Simon.


On Fri, Apr 13, 2018 at 8:31 PM Alvaro Gamez <alvaro.gamez@xxxxxxxxxx> wrote:
Hi!

I'm trying to make chrony sync against a GPS and PPS signal, but it seems like the PPS is being ignored.

I run gpsd attached to the serial console which has the GPS connected, and for PPS I want to use chrony, so this is the configuration I've set:

# cat chrony.conf
refclock SHM 0 refid GPS
refclock PPS /dev/pps0 lock GPS refid PPS
makestep 100 5
logdir /tmp/logs
log measurements tracking statistics refclocks

I got in-kernel pps debug enabled, so when I start chronyd I can see on the console that the PPS signal is arriving and that there's someone (chronyd) accesing /dev/pps0:

pps pps0: PPS_FETCH
pps_core: ACCESS OK: READ  at 0xbf85eb6c (size 0x3c), seg 0xbfffffff
pps pps0: timeout 0.000000000
pps pps0: PPS event at 1523615280.496954999
pps pps0: capture assert seq #902
pps_core: ACCESS OK: WRITE at 0xbf85eb6c (size 0x3c), seg 0xbfffffff
pps pps0: PPS event at 1523615281.472931499
pps pps0: capture assert seq #903
pps pps0: PPS_FETCH
pps_core: ACCESS OK: READ  at 0xbf85eb6c (size 0x3c), seg 0xbfffffff
pps pps0: timeout 0.000000000
pps_core: ACCESS OK: WRITE at 0xbf85eb6c (size 0x3c), seg 0xbfffffff
pps pps0: PPS event at 1523615282.472780341
pps pps0: capture assert seq #904
pps pps0: PPS_FETCH
pps_core: ACCESS OK: READ  at 0xbf85eb6c (size 0x3c), seg 0xbfffffff
pps pps0: timeout 0.000000000
pps_core: ACCESS OK: WRITE at 0xbf85eb6c (size 0x3c), seg 0xbfffffff
pps pps0: PPS event at 1523615283.472628439
pps pps0: capture assert seq #905

However, chrony doesn't seem to understand /dev/pps0 output, because this is what 'sources' command reports:

210 Number of sources = 2
MS Name/IP address         Stratum Poll Reach LastRx Last sample              
===============================================================================
#* GPS                           0   4   377    22    +50ms[  +59ms] +/- 8042us
#? PPS                           0   4     0     -     +0ns[   +0ns] +/-    0ns

As such, refclocks.log shows only entries for GPS Refid, but none for PPS, as it seems even though it's connected, it isn't able to decipher what is being sent to it.

Any ideas?

Thanks, best regards!


--
Álvaro Gámez Machado



--
Álvaro Gámez Machado


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