[Toybox] https://landley.net/notes-2022.html#18-12-2022

Rob Landley rob at landley.net
Thu Jan 26 02:43:40 PST 2023


On 1/25/23 20:27, enh via Toybox wrote:
> "I applied an snmp patch and I'm curious if Elliott was just reading through the
> code or if Android actually has a use for SNTP?"
> 
> the former, on my own time, for a hobby project.

Cool.

> specifically i was trying to build a clock using https://www.adafruit.com/product/2278 and
>https://www.adafruit.com/product/4745.
> there's a _lot_ of rtc drift, and i didn't want to be going out to the internet
> for the time every 5 minutes or so (and ideally not at all), so i was trying to
> work out "what's late 2022's equivalent of the DAYTIME service?".

Well the RFC's for the old services are still there in 2022. :)

> i was imagining i'd set up broadcast sntp locally, but then realized that would
> still leave me needing to deal with time zones, which micropython/circuitpython
> seems to ignore (along with threads!), and even though i could just pull in
> tzdata and write my own python code for it (a) yuck, python and (b) now i have
> the "how do i update the tzdata?" problem.

Neither rdate, sntp, nor ntp assume the server in the same time zone as the
client querying them. Out of scope for all three...

> in the end, i enabled the DAYTIME service on one of my boxes and just query that
> every 5 mins. gross, but no observable rtc drift, and no need to talk directly
> to the internet, and both ntp/sntp and timezone nonsense is outsourced to a real
> computer running a real OS.

Eh, you could do sntp on a wind-up toy: the simplest one-packet implementation
is basically just rdate with a fractional part, you can even cheat by saying my
current time is unix epoch and taking the returned offset as current unix epoch
time to set.

It just wouldn't help here, still doesn't tell you what time zone you're in. "I
could write a tiny version of the thing that doesn't do what you want" isn't
helpful.

> which, funnily enough, could have been an Android device --- repurposing an old
> Android device and its screen would probably have made more sense overall, but
> that big 64x32 LED matrix does look pretty cool if you're into the whole public
> transport information board vibe and/or have fond memories of
> the https://en.wikipedia.org/wiki/Mullard_SAA5050 like i do :-)

This wandered by on Mastodon a couple months back:

https://www.hackster.io/news/kevin-chung-reverse-engineered-nyctrainsign-and-their-api-after-the-iot-company-vanished-7de09a355234

Rob


More information about the Toybox mailing list