RTC vs GPS w/PPS ?


Douglas Pervine, N1OBU
 

I have RPi setups with RTC or GPS w/PPS.

I'm just wondering which is the better setup for maintaining accurate time.

Does the RTC get updated regularly via the NTP source on the Internet?  Or is the time stored in the RTC only provide time during boot/lack of NTP source?

On my other system.  GPS w/PPS provides accurate time but it takes a few minutes to achieve this fix.

I was just wondering.  I'd like to configure my RPi's the same.

Any assistance would be greatly appreciated. 


N5XMT
 

When set up for RTC, the pi takes the time from the RTC module at boot.  The pi also periodically checks the RTC and adjusts itself to it and has a "drift" file that it uses to correct itself.  You can set it up in cron to check the ntp servers and save the time to the RTC as well


 

The GPS with PPS is more accurate but any property configuration with GPS and/or NTP (using chrony) should be close enough. The RTC just helps retain that me during boot. 


On Sun, Oct 30, 2022, 07:29 N5XMT <dacooley@...> wrote:
When set up for RTC, the pi takes the time from the RTC module at boot.  The pi also periodically checks the RTC and adjusts itself to it and has a "drift" file that it uses to correct itself.  You can set it up in cron to check the ntp servers and save the time to the RTC as well


David Ranch
 


For the most ultra-accurate time, a GPS with PPS (packet per second) setup will be the most accurate.  The next most accurate would be a machine using NTP via the Internet.  A GPS receiver without a PPS signal might be a bit more accurate but I'm not a time expert (a very very deep topic btw).   The least accurate would be to solely use an RTC setup for accurate time.

To your second question about if an RTC's time gets updated from NTP, the answer here is rather convoluted as it depends on your chosen time synchronization tool (usually chosen by your choice of distro).  If you're using a modern systemd based distro, the systemd-timesyncd tool currently does NOT have a feature to keep the RTC's time current.  You can work around this with simple cron or shutdown scripts (this is what I do).  For example: https://unix.stackexchange.com/questions/285674/rtc-and-system-clock-not-in-sync

The crony system DOES have the ability to do this via it's "rtcsync" option - https://chrony.tuxfamily.org/faq.html

Anyway, here is a decent high level read about the various NTP tools with Linux: https://opensource.com/article/20/6/time-date-systemd

--David
KI6ZHD



On 10/29/2022 03:42 PM, Douglas Pervine wrote:

I have RPi setups with RTC or GPS w/PPS.

I'm just wondering which is the better setup for maintaining accurate time.

Does the RTC get updated regularly via the NTP source on the Internet?  Or is the time stored in the RTC only provide time during boot/lack of NTP source?

On my other system.  GPS w/PPS provides accurate time but it takes a few minutes to achieve this fix.

I was just wondering.  I'd like to configure my RPi's the same.

Any assistance would be greatly appreciated.