Re: [chrony-users] Synchronize system clock to GPS time |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-users Archives
]
- To: "chrony-users@xxxxxxxxxxxxxxxxxxxx" <chrony-users@xxxxxxxxxxxxxxxxxxxx>
- Subject: Re: [chrony-users] Synchronize system clock to GPS time
- From: "Ryan Govostes (he/him)" <rgovostes@xxxxxxxx>
- Date: Fri, 4 Mar 2022 04:43:12 +0000
- Accept-language: en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=whoi.edu; dmarc=pass action=none header.from=whoi.edu; dkim=pass header.d=whoi.edu; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=4HwwISp/hOULqwdsfdjcUQM2bNyzCvzwCRiY5poCs38=; b=R0U/Jdfpt0oC4uhvRJN1+nUUhFRg85Kx/7EQhdF6HHgfXEuXXxWQoo2gBf7+4NXsNmwIJtL/vOZrEh3kg8GOmPXCPcrM6D0wukpj8LIoe+vfNa/Gi1bgxUpkFzo5+mVmHcV3na7fbDVIcM/gbcWekDC7CnvmDOhdZJwPDgIfkoRXpGG0Da0sq3kCaswESLy2zQkPatsI3PD84BvlkEg7MmpSkV5PcuO76ZXGcFnzemmbD7WRzpmibKw+m9hXwVJUa5/m29T7qLMfcErtk08VFVDwkS2wnHyJjMC45Lfj+WHtTry7rmPdkuv9zWFT3ggKoOZ53XekyqC/WFRUskSPgg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZAupcFeDPDBsyzKQTvnidnl126mGrCSeHx1qPnEg3nMu/BzORKljQ/JsBKRoS1PqPIlWrF9R/0pbSmgPkgUjE4kjZCBCkA4Z12+Y6dkA148TIoO/DnXWaVPPRDD46zANstzaRQDP0qDe5a8WrlKVXRrFByMvSEVevZtuz2peMbb++6OEC0DapcxrhGbwUV44LE+hfCdQYCB7YcgetCyEb7r61rsAVboxWUUQQrXJAM7Vt1Fn1k/CdntPrW3TFBDHtSYJpjHpMLJbj8gCneLbFx8OCLfibEajiHWzVse4Pbql/lrq1FHlVhrwIFJZB5FQYAsohnsNjvDcN34ni9mvjA==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=whoi.edu;
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=whoi.onmicrosoft.com; s=selector2-whoi-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=4HwwISp/hOULqwdsfdjcUQM2bNyzCvzwCRiY5poCs38=; b=BTnmYmnGQJxBjZxX/Z8nOuyf6MCoU5EdRoejUpIfMh25l1Eb9bFgZ+qWrKCdpARSMGzDmqtF3TvKFshR6rDljvP6jTY1qEwqQv2nzJ/5gD/l8uCs6vSZbGr8A1UqczUo1lWDst4C8hkxTqEAQuYKBvaEf8AS4yyQSa6OHPpB8Ms=
- Thread-index: AQHYLz5yJ02XEmXpI0OMvC2tC5CZGayumCwAgAAIXQCAAAPDgIAAAeuA
- Thread-topic: [chrony-users] Synchronize system clock to GPS time
Does the PPS ref clock actually provide a time of day or anything, though? I thought it merely told us when to tick the second hand forward. Or is GPSD combining the two and sending a full timestamp over the socket? In which case, do I need the GPS refclock at all?
Or if I need both, how does one calibrate the offset?
> On Mar 3, 2022, at 23:36, Bill Unruh <unruh@xxxxxxxxxxxxxx> wrote:
>
> Teh two sources GPS and PPS have vastly different uncertainties. so the system
> would tend to choose the PPS and ignore the GPS. The GPS will also tend to be
> much more than a few standard deviations away from the PPS. So it will not
> combine the output of the GPS with the PPS. It is like if you had one server
> which gavae you the year and wandered allo f +- half a year, and another
> which gave you nanosecons. You would not want those two averaged to give the
> time.
>
> You need to look at the offset of the GPS with respect to the PPS to get a
> better idea of how much of an offset you should put in for the GPS. .9999 is
> one second, which is almost certainly wrong.
>
>
>
> 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 |____ unruh@xxxxxxxxxxxxxx
> Canada V6T 1Z1 ____|____ and Gravity ______|_ https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.theory.physics.ubc.ca%2F&data=04%7C01%7Crgovostes%40whoi.onmicrosoft.com%7Cd7c24eedb1ac4cd05e8308d9fd98918b%7Cd44c5cc6d18c46cc8abd4fdf5b6e5944%7C0%7C0%7C637819654143563575%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=zqw7eoga2Z%2Fn%2BXQa9JVwPdh265mcK%2FhhnLkrUdcrIm4%3D&reserved=0
>
> On Fri, 4 Mar 2022, Ryan Govostes (he/him) wrote:
>
>> [CAUTION: Non-UBC Email] 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?
>> 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.