logoalt Hacker News

montrosertoday at 6:13 PM3 repliesview on HN

What I really want is one of these powered by gps. The time already comes for free in the signal, and from your location you can derive the time zone. That way DST is accounted for automatically, but you don't have to set up and rely on wifi. This would be truly zero-config and always correct.


Replies

ssl-3today at 7:09 PM

GPS isn't too hard, either.

The receivers are inexpensive ($5-$10 for the kind of accuracy that's useful here) and it's not hard to parse the NMEA strings and PPS they output into a spooky-accurate internal clock. It only takes a few connections and an antenna to integrate GPS into an MCU like an ESP (or an SBC like a Raspberry Pi or a whatever).

Like, really: The hardware is ridiculously easy.

The only difficult part is the code. But as we can see from this posting, the clock-driving bits are already written and are available for use.

Just graft in the GPS parts instead of the NTP parts, add your DST/location rules if you really must (hint: that part is harder than it sounds), and send it.

(And if the code still seems arduous, then remember: This is the kind of work that a reasonably-focused person who is armed with a decent bot can put together over a cup of coffee or two, even if they don't speak C. It may be popular here to poo-poo the bot here, but it's completely OK to get some help. Don't let pride get in the way of having fun, learning things, and building neat stuff.

The tailor doesn't lament the invention of the cotton gin.)

womodtoday at 6:21 PM

There's quite a few clocks available that get their time over the air from the NIST WWVB radio station[0]. They usually have a little switch on the back if your area does/doesn't observe daylight savings.

[0] - https://www.nist.gov/pml/time-and-frequency-division/time-di...

IncreasePoststoday at 6:43 PM

You would still need some kind of configuration because the start of DST can change year to year, and this is not accounted for in the time signal from GPS

show 1 reply