¿ªÔÆÌåÓý

RTC vs GPS w/PPS ?


Douglas Pervine
 

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.?


 

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

Get


 

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

Get


 

¿ªÔÆÌåÓý


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:

The crony system DOES have the ability to do this via it's "rtcsync" option -

Anyway, here is a decent high level read about the various NTP tools with Linux:

--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.?