-
• #2
Basic logic of how this widget reaches under 10 ms accuracy with
setTime
(in versionv0.00-beta-026
):- Internal clock error counter is updated periodically according to given clock drift.
- If clock error exceeds given threshold then clock update is attempted.
setTime
can only set time to full seconds. To set time more accurately
a short delay is done until next full second, and thensetTime
is used.- Sometimes this delay can be longer than intented, e.g. if watch is
busy doing something else. In this casesetTime
after too long delay
would be inaccurate and so it is skipped and retried again later.
- Internal clock error counter is updated periodically according to given clock drift.
-
• #3
To others: I am testing this widget. It is working well.
-
• #5
But the documentation of
setTime
says thatSet the current system time in seconds (to the nearest second).
i.e. it discards fractional part of the given value and only uses integer seconds
-
• #6
oh wow, looks like documentation is completely wrong and
setTime
actually does set fractional seconds also - this completely changes how this widget should usesetTime
.I didn't even think of testing this before as I trusted documentation.
-
• #7
I'll update the docs for the next release. Generally the docs are fine but occasionally they do end up out of date, which I think is what must have happened here.
I'm making a widget which adjusts Bangle.js 2 clock continually in the background to counter clock drift.
Widget doesn't attempt to determine clock drift in anyway. You need to measure clock drift yourself and then enter that value to the widget.
Beta version is available from my app loader for now as this still needs more testing before adding to main app loader.
I'll also publish source a bit later in GitHub as there are still few things I want to fix first. Of course code is available in my app loader (widget.js) if you want to see it. (Code includes some initial support for temperature correction but that isn't enabled yet.)
ps. Update interval setting doesn't do anything yet, interval is currently fixed to 10 seconds. That is the next bug I'll fix. (EDIT: Fixed in version
v0.00-beta-018
)