Live data from Hacker News

Going in circles without a real-time clock

rachelbythebay.com

61–70 of 157 posts

Re: Going in circles without a real-time clock

#61

Tangential: I have a pi 4 running openwrt and a wireguard interface that is routed over the WiFi access point. If you connect to this network it's as if you are connecting in another country. I have outbound traffic only going over wireguard. If wireguard is down then no internet (to avoid any leakage). However if pi loses power the clock resets, wireguard can't handshake with that much clock skew, NTP can't connect…

I also use wireguard a lot. I didn't know that clock sensitivity could be an issue here. I've never seen an issue before. Now that I know it could be one I'll make a point of deploying all cellular based systems with a GPS synched time source as well and avoid that sort of problem.

Re: Going in circles without a real-time clock

#62
post #15

Earlier quoted context omitted.

and you certaintly get what you pay for, DS3231s fry almost as easily as MAX3232s, (And you can do the same thing were you write the time to the RTC before you have the correct time)

I have used these in product designs before with zero failures. Where exactly did you buy your samples? We found they drift less than 28s a year in standalone mode. Also, were repeatable within +-18ms when using a NTP client. Microchip RTCs are harder to setup, but also seem to work just as well (ignoring the goofy epoch). Chip shortage caused people to do unspeakable things.... ;-)

You could buy an rtc and put up with that kind of clock drift, or.... for the same money or less you could be a GPS and have none of that drift.

Re: Going in circles without a real-time clock

#64

I had this happen before. I used it as an excuse to learn how to setup NTP with a GPS receiver. I made a little blog on it if anyone is interested in the results. Be sure to click the sandwich menu for some real-time data: https://www.developerdan.com/ntp/

Quick question, because I've followed a number of how tos before that don't, if you disconnected all network connectivity, would it sync to the PPS source? Second, have you tested this, I only ask because 1# I found a lot of time sync was really slow, and #2 some of them reported that they had sub-microsecond time sync but when tested they were several milliseconds out.

Anyway, I solved these problems with sbts-aru, but maybe it's interesting for you to test if you haven't already done this.

Re: Going in circles without a real-time clock

#65

I know I’ve brought this up before, but I can’t remember exactly where. It would be nice if DHCP could provide the current time as one of the pieces of information it provides with a lease. If you’re already trusting it for your IP address, you might as well trust it with the current UTC time: The current 64-bit timestamp would be enough to get timestamp-sensitive things working.

> It would be nice if DHCP could provide the current time as one of the pieces of information it provides with a lease. [0]

DHCP can provide the IP address of one or more NTP servers to consult for time queries. I use this feature so that all of the machines on my LAN (at least the ones that can be configured to ask for and/or use this information) have the same general idea of what time it is.

[0] See subsection 8.3 here: https://www.rfc-editor.org/rfc/rfc2132#section-8>

Re: Going in circles without a real-time clock

#66
post #60

Earlier quoted context omitted.

> But there is no way to know how much juice is left in the BIOS battery, True, but its voltage can be used as an estimate. Most PC MB still around monitor the supply voltages, some also of the battery feeding the RTC. If you have the (Debian) package 'lm-sensors' installed, look for sensors[ ]: Vbat: +2.91 V (min = +2.70 V, max = +3.63 V) ALARM in /var/log/syslog.

Ran `sensors` and it only shows CPU core temps. I guess my MB does not report RTC battery voltage?

One thing are the sensors, 'nother thing is the software. Have you configured the lm-sensors package (by running `sensors-detect`) yet?

https://hwmon.wiki.kernel.org/lm_sensors also has a FAQ.

Re: Going in circles without a real-time clock

#68

Note that the Pi 5 has a real time clock - you just need to add a small battery and it will keep the time when powered off: https://picockpit.com/raspberry-pi/raspberry-pi-5-has-a-real...

I guess that's what the article meant here: "This particular Pi doesn't have a real-time clock. The very newest ones (5B) do, but you have to actually buy a battery and connect it. "

Re: Going in circles without a real-time clock

#69
Its weird that people work OK without knowing exactly what time it is. Sure it helps us but if a person lost track of the date for a few days in a city they would still be able to perform basic functions. We only have had timekeeping devices for a tiny part of our history but we invented alot of stuff without precise synchrony.

Re: Going in circles without a real-time clock

#70
post #48
post #35

Install sbts-aru as a base system and it will keep your Pi accuracy to sub-microsecond error. https://github.com/hcfman/sbts-aru Problem solved.

IF you get a DCF77 (stratum 0) signal, there are receivers for Pi below 10€.

Getting time from DCF77 seems like the best solution for timekeeping on a lot of computers, but there don't seem to be nicely packaged ones over USB etc. I had a quick look for Pi receivers and none of them looked to be nicely packaged, but with an external antenna.
Post reply on HN