domneedham / pico-clock-green-python

A MicroPython implementation of the Waveshare Pico-Clock-Green.
Apache License 2.0
10 stars 7 forks source link

NTP sync #21

Closed bellingeri closed 1 year ago

bellingeri commented 1 year ago

HI.

I added NTP sync with time zone management and daylight saving time. It use my localPTZtime MicroPython module, and the definition of the zone must be entered in Posix Time Zone notation, like "CET-1CEST,M3.5.0,M10.5.0/3" for Rome or "EST5EDT,M3.2.0,M11.1.0" for New York.

Now the update occurs only at startup; one could think of repeating it every hour...

domneedham commented 1 year ago

That is great thanks!

bellingeri commented 1 year ago

Thank you.

I would like to add some more changes (when I have time): A problem with the network connection shouldn't be blocking - but I'd like to be notified. It would be useful to perform time synchronization cyclically.

I'd like to add also some changes (first of all "Added 'day of week' setting") by @klaymens, who forkd a few months ago, but I don't know how to do it or how to contact him...

domneedham commented 1 year ago

Agreed, I am going to get my hands on a Pico WH shortly so I can actually implement the wireless stuff and test it, had no means of doing so.

I think I can bring the changes he has made, will give it a go now.

EDIT: Merged the changes.

EDIT 2: Feel free to suggest any future changes if you want to collab. Thanks