Re: [chrony-users] Synchronize system clock to GPS time

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



> On 4 Mar 2022, at 2:52 pm, Ryan Govostes (he/him) <rgovostes@xxxxxxxx> wrote:
> 
> Hi Adrian,
> 
> Thanks for the pointers.
> 
> asdf.xyz was indeed just a throwaway host instead of my real NTP server. I removed that server line but it did not seem to have an effect.
> 
> Then I tried removing the offset 0.9999 from the GPS ref clock — this was recommended in some tutorial somewhere and obviously is not the correct value to use, and when I removed it, the system clock updated right away.
> 
> Though now the GPS says it is “not combined” while the PPS is “current synced.” Perhaps that is the expected behavior?

I see this:

Aeon 14:57:~> chronyc sources
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
#* PPS1                          0   5   377    16   +379ns[ +429ns] +/-  122ns
#x GPS0                          0   4   377    10   +133us[ +133us] +/-   74us
^- aeternitas.cheese             1  10   377   568    -12us[  -12us] +/-  216us

I think x means “not combined”.

I think that is ok. The accuracy of the PPS far exceeds the GPS serial comms. +/- 122ns vs +/- 74us. So you wouldn’t want it to be ‘combined'. But the GPS informs the PPS driver. But I could be wrong... I was where you are a few months ago. I am grateful that the Last Sample value above gets quite small at times. And then I start wanting it to be better...

Cheers, Adrian


> 
> Ryan
> 
>> On Mar 3, 2022, at 22:52, Adrian Murphy <amurphy@xxxxxxxxxxxx> wrote:
>> 
>> Hi Ryan,
>> 
>> Can I ask:
>> 
>>  You have ‘prefer’ option added to the 'server asdf.xyz’ line.
>> 
>>  Could that be stopping chronyd from trusting the GPS?
>> 
>> Also, asdf.xyz does resolve to an NTP server for me, but maybe you are hiding the real hostname.
>> 
>> On Ubuntu Raspberry Pi4 I use:
>> 
>>  refclock SOCK /run/chrony.pps0.sock refid PPS1 poll 5 prefer
>>  refclock SHM 0 refid GPS0 precision 1e-20 offset 0.036790 delay 0.0
>> 
>>  server Aeternitas iburst
>>  …
>> 
>> Also the end of your conf file was garbled. Is that real?
>> 
>> Cheers, Adrian
>> 
>> 
>>> On 4 Mar 2022, at 7:07 am, Ryan Govostes (he/him) <rgovostes@xxxxxxxx> wrote:
>>> 
>>> I have a GPS receiver with PPS connected to an embedded Linux system. GPSD feeds Chrony time updates from the GPS receiver over the Chrony socket.
>>> 
>>> The system clock is behind by a few months, and Chrony does not want to update the clock to the time reported by GPSD.
>>> 
>>> I have read the FAQ and a few threads on the same topic but the solutions presented don’t work for me. I have tried setting maxdistance to an absurdly high number, and allowing  makestep 1 -1.
>>> 
>>> The “chronyc sources” command suggests that Chrony thinks that the GPS is in error. There is no console message that says that Chrony is attempting to adjust the clock.
>>> 
>>> Can I force Chrony to accept the time from the GPS?
>>> 
>>> Thanks,
>>> Ryan
>>> 
>>> 
>>> $ chronyc sources
>>> 210 Number of sources = 3
>>> MS Name/IP address         Stratum Poll Reach LastRx Last sample               
>>> ===============================================================================
>>> #x GPS                           0   4   377    11   -2002h[ -2002h] +/-  100ms
>>> #x PPS                           0   4   377    10   -2002h[ -2002h] +/- 2919ns
>>> ^? asdf.xyz                      0   9     0     -     +0ns[   +0ns] +/-    0ns
>>> 
>>> $ chronyc tracking
>>> Reference ID    : 00000000 ()
>>> Stratum         : 0
>>> Ref time (UTC)  : Thu Jan 01 00:00:00 1970
>>> System time     : 0.000000041 seconds fast of NTP time
>>> Last offset     : +0.000000000 seconds
>>> RMS offset      : 0.000000000 seconds
>>> Frequency       : 404.716 ppm fast
>>> Residual freq   : +0.000 ppm
>>> Skew            : 0.000 ppm
>>> Root delay      : 1.000000000 seconds
>>> Root dispersion : 1.000000000 seconds
>>> Update interval : 0.0 seconds
>>> Leap status     : Not synchronised
>>> 
>>> $ cat /etc/chrony/chrony.conf 
>>> server asdf.xyz iburst prefer
>>> 
>>> # This directive specify the file into which chronyd will store the rate
>>> # information
>>> driftfile /var/lib/chrony/chrony.drift
>>> 
>>> # 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
>>> 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 -1
>>> 
>>> # 
>>> maxdistance 100000000
>>> 
>>> refclock SOCK /run/chrony.ttyCOM2.sock refid GPS precision 1e-1 offset 0.9999
>>> refclock SOCK /run/chrony.ppsCOM2.sock refid PPS precision 1e-7N‹§ēæėrļ›y隊W!Ū‰ōšĮŦē·Šđë-rčŸ+nÅöĶŠ\ĻŪ "ķ§ēæėrļ›z)í
>>> ë.n7œīZ+
>>> éizfĒ•ČkĒ|Ūąęė­ęŪzË\†š'ĘÛą}ĐĒ—*+ƒ­†ĨĶ)í
>>> ë.n7œĩ:čđđ^fĒ–XŽķfŽĩę܆š'ĘÛą}ĐĒ—*+
>> 
>> 
>> -- 
>> To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
>> with "unsubscribe" in the subject.
>> For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx 
>> with "help" in the subject.
>> Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.
>> 
> 


--
To unsubscribe email chrony-users-request@xxxxxxxxxxxxxxxxxxxx
with "unsubscribe" in the subject.
For help email chrony-users-request@xxxxxxxxxxxxxxxxxxxx
with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


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