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.
Ivan says:
More comments on Mastodon.