Remix.run Logo
montroser 7 hours ago

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.

ssl-3 6 hours ago | parent | next [-]

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

womod 7 hours ago | parent | prev | next [-]

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

IncreasePosts 6 hours ago | parent | prev [-]

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

montroser 5 hours ago | parent [-]

Good point that DST dates can technically change -- but in practice it doesn't really change on a year-to-year basis. The current law establishing the start and end dates in the US has been in effect unchanged for the last ~20 years.