[ntp:questions] NTP with GPS and RTC

unruh unruh at invalid.ca
Thu Apr 25 17:55:23 UTC 2013


On 2013-04-25, Biebaut Sven <sven.biebaut at be.thalesgroup.com> wrote:
> Hello,
>
> I found confirmation that the kernel updates the RTC every 11 minutes when synchronised with an external source. This leaves me with using my RTC as a reference clock in ntpd.

Why in the world would you want to use the rtc as a reference driver for
rtc. Firstly, as you say, ntpd resets the rtc every 11 min. It does not
drift it. It jumps the time on the rtc. This makes it useless as a
reference. 

>
> I found references on the web that is can be achieved with reference driver 43. When I configure ntpd like this, it returns with something like "no reference ids found" .
> In the log file /var/log/ntp I can find : refclock_newpeer: clock type 43 invalid
>
> I think this means that there are no valid devices found for the driver to use ?
>
> My RTC is a DS3231 I2C based RTC, with a custom driver. Do I need a special clock driver for this or can I parametrize one of the other reference clock drivers ? Or does my custom driver need extra calls to allow ntp to read its values ?
>
> I cannot find the interface used by ntpd reference clock drivers towards the device clock drivers on the other hand  ( which calls, device node, ..)

Read the source?
The standard rtc is bitch to program properly. TO set the time you have
to set it .5 sec before the time you want. It is only good to the
second, except it has an interrupt every second which could be used
except that Linux at least does not allow that interrupt anymore. So you
have to waste time polling the refclock to see when it turns over. It is
pretty useless for anything but approximately setting the system clock
at startup. 
DO NOT USE IT.

If you have your own special rtc which is better you will simply have to
write a refclock driver for it. 


>
> Any help is greatly appreciated,
>
> Thanks,
>
>
>
> Sven Biebaut
> Senior Software Engineer
>
> THALES BELGIUM, S.A.
> Rue Freres Taeymans 28
> B-1480 Tubize
>
>
> _____________________________________________
> From: BIEBAUT Sven
> Sent: 22 April, 2013 10:01
> To: 'questions at lists.ntp.org'
> Subject: NTP with GPS and RTC
>
>
> Hello,
>
> on an (x86-based) embedded linux system I would like to synchronize with ntp to a GPS.
> When the GPS is present, the local time is updated.
> However I would also like that when thus synchronized, that my RTC is also updated, and vice versa, when unsynchronized, that my local time is kept in line with my RTC (that was chosen for precision).
>
> I searched the web far and wide and found staments that both the kernel (every 11 minutes) and ntp ( every 60 minutes) would update the RTC. Unfortunately, I never found documentation or manuals that actually confirm this and how to activate/deactivate one or the other, neither if these staments apply on all or on some versions of ntp or the linux kernel.
>
> My configuration is ntp 4.2.6p2 and my linux kernel is 2.6.34 .
>
> Any help on how this is achieveable is greatly appreciated.
>
> Thanks,
>
> Sven
>
>
>
> Sven Biebaut
> Senior Software Engineer
>
> THALES BELGIUM, S.A.
> Rue Freres Taeymans 28
> B-1480 Tubize
>
>
>
>
> Sven Biebaut
> Senior Software Engineer
>
> THALES BELGIUM, S.A.
> Rue Freres Taeymans 28
> B-1480 Tubize



More information about the questions mailing list