RTC Questions

I use a Raspberry PI to run the WeeWX Weather Staion software. The weather staion it is connected to is a Vantage Pro2.

The Pi as we all know does not have a real time clock and gets its time from the network.

WeeWX sets the clock on the Vantage at startup.

WeeWX starts up before the network is up and if there has been a power outage it sets the time wrong. The Pi then picks up the corrects time and there is a conflict of times.

I could have written a delay into WeeWX but thought I would have go at adding a RTC.

formatting link

Is the one I got. Very simple to set up and get running.

When the RTC is installed, as per instructions, I wated till the correct time had been picked up from the network and then I used sudo hwclock -w to set the correct time on the RTC. I then uninstalled the Fake Hardware Clock.

Now the questions!

1) Is there anyway to check the battery level on one of theses (I suspect not)

2) I assume that the RTC will not be updated with the network time automatically. If this is correct I will need to correct the drift. Is there a way to check for drift or should I just used crontab to do a regular sudo hwclock -w if so how often? Hourly, daily, weekly or monthly!

Thanks

Reply to
Simple Simon
Loading thread data ...

Just aptitude install ntp. This will set the clock both at boot and on a continuing basis when it drifts.

Reply to
Roger Bell_West

Agreed - you only need a hardware RTC if your RPi isn't usually connected to the 'net.

--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

You should be able to set the rtc when the pi gets an update from ntp. Adafruit also has a couple of 'learn' articles about working with rtc on the pi.

It's always been my experience that rtc's on computers - even expensive ones - don't keep time as well as a $5 watch.

Reply to
ray carter

Doesn't the pi run ntp?

Oh. Later versions are running some devils spawn of systemd

formatting link

Looks like that is the 'supported' way to go

formatting link

--
Truth welcomes investigation because truth knows investigation will lead  
to converts. It is deception that uses all the other techniques.
Reply to
The Natural Philosopher

He gave a reason.

Reply to
A. Dumas

Fair enough - I'd have put a delay in the WeeWX startup.

To the OP - if the RPi + weather station is normally run 24x7, then the RTC battery will probably die of old age rather than because it got drained. I see that AdaFruit say it should last 5 years, which looks as though that's its shelf life. Don't forget that the RTC uses little power and that the coin cell only powers the RTC when the RPi is powered off.

Given that the RTC you've chosen isn't temperature compensated, whether its driver will periodically sync it to Internet time would concern me more than monitoring its backup battery, but of course ymmv.

--
Martin    | martin at 
Gregorie  | gregorie dot org
Reply to
Martin Gregorie

Exactly.

Additional money, power, size, complexity in order to save a few seconds when WeeWX is (rarely) restarted is a poor tradeoff.

--
-michael - NadaNet 3.1 and AppleCrate II:  http://michaeljmahon.com
Reply to
Michael J. Mahon

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.