Fixing clock drift on the Watchy
I'm getting increasingly annoyed with SQFMI's Watchy. The documentation is terrible, the device is fragile, and now it turns out that the "Real Time Clock" loses several seconds per day! Which means, after a couple of weeks the watch is a couple of minutes fast.
Ugh.
But, on the other hand, you can reprogram it in C++. So swings and roundabouts...
Anyway, this is the code you need to stick into your watch face to have it perform an NTP sync at, for example, 5am:
Cif ( minute == 0 ) {
if ( hour == 5 ) {
if (connectWiFi()) {
syncNTP();
WiFi.mode(WIFI_OFF);
btStop();
}
}
}
You will need to have first configured your WiFi. You will also need to set your NTP server and preferred timezone in settings.h
:
C#define NTP_SERVER "pool.ntp.org"
#define GMT_OFFSET_SEC 3600 * +1 // GMT is 0, BST is +1
Now every morning you will start with a freshly sync'd watch - with minimal impact on the battery life.
Ben Charlton said on morehammer.uk:
@Edent it’s extremely weird because it claims to use the ds3231, I have those in other projects and they’re extremely accurate (and temperature compensated). Is the watch definitely setting the rtc time correctly after ntp, and reading the time from the rtc rather than relying on the time as the cpu is tracking it?
Ivan says:
The NTP Pool is interesting in that anyone can (and is encouraged to) set up their NTP clients to access pool.ntp.org https://www.ntppool.org/en/use.html, but making it a default setting in a device or a piece of program is not allowed, and vendors are asked to apply for a vendor zone at .pool.ntp.org https://www.ntppool.org/en/vendors.html.
Sam J Sharpe said on mastodon.me.uk:
@Edent back in pre-history (by which I mean before you and I were born) this wasn't a problem. Nobody cared if you were 3 seconds late each day and nobody cared if once a month, you needed to reset your watch from the church bells.
For times where this was a problem, very expensive ("Railroad Quality") watches with highly accurate movements were available.
They cost much more relative to the avg. income of the time than your Watchy cost you. So much so that they were often employer-provided...
More comments on Mastodon.