Watchy fetches time information from pool.ntp.org
and then adjusts it for display using the timezone provided by the OpenWeather API
That adjustment is done here
It's not currently working correctly - my watch seems to think I'm in New York (or somewhere else 4 hours behind me).
Activity
14-Jun-23 16:05
assigned to @btasker
14-Jun-23 16:19
We can reconstruct the call that'll be being made by using the api key from the settings file
Along with the way the url is constructed
So that should be (we'll fix the units later)
So yeah, it puts me in the US (presumably because of the provision of that city id).
It looks like OpenWeather's API doesn't support geolocation (I'd assumed it did), you have to provide a City ID (deprecated) or lat+lon.
In the short-term, I can fix my watch's NTP reads by updating
config.h
to use the city ID for my location, but I'd actually quite like it to dynamically update depending on where I am (although I guess that would imply I'm reconfiguring it to connect to other Wifi's when out and about).Could look at having it fetch timezone from
http://ip-api.com/json/
instead.For now, though, I'll just override the city ID
14-Jun-23 16:27
Updating
settings.h
to(Actually I swapped out my API key as well)
14-Jun-23 16:43
That worked, NTP sync gave me the correct time - score.
14-Jun-23 21:19
This is working correctly.
Although setting up geolocation would be cool, really it's not likely to get used much. The watch can only remember one Wifi network at a time (and is configured via a browser on another machine) so, realistically, I'm unlikely to configure it to join any other networks.
Worst case scenario, if I'm away for some reason, I'll just have to manually adjust the time on it or plan ahead and flash a new location onto it.
Closing this as done.