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.


Share this post on…

  • Mastodon
  • Facebook
  • LinkedIn
  • BlueSky
  • Threads
  • Reddit
  • HackerNews
  • Lobsters
  • WhatsApp
  • Telegram

3 thoughts on “Fixing clock drift on the Watchy”

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

    Reply | Reply to original comment on morehammer.uk
  2. 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...

    Reply | Reply to original comment on mastodon.me.uk

What are your reckons?

All comments are moderated and may not be published immediately. Your email address will not be published.

Allowed HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <p> <pre> <br> <img src="" alt="" title="" srcset="">