Time sync issues bangle js 2 (ios)

Posted on
  • Hello!

    I noticed today that my time is off by a couple of minutes.
    The initial time sync first time I paired it seemed to work, but even after resetting my watch to factory settings, I didn't even get new time when pairing it to my iPhone.

    I've tried using GPS time and auto GPS time but they don't seem to find GPS satellites (clear blue sky today and I was on a walk as well.

    Any suggestions?
    I've seen a couple of threads about it on different places, but none seem to resolve it (some mention that rebooting should request new time, but it doesn't change for me).

  • I can't help much because I use Android. In my case it synchronize the time correctly. About GPS, ¿are you updating AGPS data in the previous 24 hours? There is an app that updates the data periodically and allows downloading it manually. It also seems to help using GPS only instead of more than one satellite system.

  • Haha, always fun to see upside down question mark in non-spanish ;)

    What app would that be?
    I've installed GPS time and auto GPS time widget, the GPS time just says that it can't find a satellite.

  • ¡Damn! My bad (anyway, it was a normal question mark, the upside down one was at the end of the question). I was talking about "A-GPS Data Downloader App" but it seems that it only works with Gadgetbridge on Android. You can use "Assisted GPS Updater (AGPS)" which is not really an app but downloads A-GPS data from the App Loader.

  • So, just downloading that should help?
    Or is it in combination with GPS time?

  • I think that my banglejs2 synchronizes to my android phone's time when connecting to Gadgetbridge. The A-GPS data tip was for getting a GPS fix. I suppose that you need "GPS Time" to sync to the GPS time or "GPS auto time" to synchronize every time you get a GPS fix.

  • Ok, thanks!
    I'll see if it diffs in time in a few days I'll suppose =)

    And yes, I've seen elsewhere that gadgetbridge solves that part.
    iOS integration is primarily handling notifications, and that's not a way to send time unfortunately.

  • In general the Bangle may lose/gain 2 seconds a day of time when not connected to anything, but it shouldn't be much more than that - it's pretty standard unfortunately as most oscillators used for microcontrollers are only 20ppm (parts per million) accurate.

    If you connect with the app loader then that can update the time for you (there is a setting, as usually doesn't mess with the time unless it's obviously not set at all).

    I didn't even get new time when pairing it to my iPhone.

    No... however firmware 2v19 does actually provide the functionality (https://www.espruino.com/Reference#l_NRF­_CTS) it's just not handled in the JavaScript on the watch yet as it's pretty recent.

    So if you're staying connected to the iPhone then it should be trivial.

  • So, basically, should be improved later on =)?
    Sounds good!

    GPS stuff does seem to be impactful to battery life.

  • Yes, hopefully it should get better soon!

    And yes, GPS is one of the biggest power hogs on the Bangle so ideally it's best not to use it unless it's totally needed

  • Sounds good!
    I suppose this will come from the an "iOS integration" update at some point then?

  • Yes - in fact, if you use the development app loader and update iOS from there then I just added it: https://espruino.github.io/BangleApps/

    You have to enable it from Settings -> Apps -> iOS Integration -> Time Sync and right now it'll sync every time you change apps (which is probably overkill).

    There was also a bug in 2v19 (fixed in cutting edge builds) which got the month wrong. I think I've worked around it now though

  • Hmm, time sync has broken again.
    I checked and time sync IS enabled in 0.15.0.

    It's drifted a couple of minutes, not sure how long it has been failing =(

  • My time sync with iOS is not working either. It would appear CTS (Current Time Service) isn’t active on my phone because when I run ‘NRF.ctsGetTime()’ from the console it returns ‘Uncaught Error: CTS not active’.

    I’m using webBLE to connect to the bangle if that helps narrow down the problem.

    Thanks!

  • I did some more digging and found that the following steps will allow time sync to work:

    1. Select the watch and then 'Forget This Device' from the Bluetooth settings on the iPhone.
    2. From the web IDE using the WebBLE app, connect to the Bangle but do not pair.
    3. Enter NRF.setServices({}, {cts: true}) into the console.
    4. Disconnect from within the web IDE and reconnect, but this time pair with iOS and allow notifications.

    After these steps it will update the boot code after switching between apps, and the time will then be synced. However, this only seems to last for one connection, and the whole process has to be done again if it's disconnected at all.

    I tried adding that NRF.setServices line into boot.js for the ios app, but it did not seem to help.

  • And you're saying this worked previously? Because I haven't touched the current time service or ANCS code since I mentioned this 3 months ago, so I wonder if iOS has changed something under the hood...

    In the development app loader I've just made sure cts is enabled by the iOS integration app, so you could try updating that and give it a go?

  • No, I don't think it ever worked for me previously.

    I can confirm this newest version works though. Thank you!

  • I was pretty sure it worked in 0.15 at some point.
    I've now updated to 0.16, then change time to one hour wrong and nothing is happening.

    Option for time sync is checked.

    Am I missing anything?

    Edit: Hmm, now I poked around a bit in settings, went into time, and it was suddenly fine =)
    How often or at what points does it sync?

  • I checked on my Android and Time is off about 5 seconds. Is that normal?

  • How often or at what points does it sync?

    If you've enabled time sync in settings I think it requests the time every time you load a new app.

    I checked on my Android and Time is off about 5 seconds. Is that normal?

    You mean the time on your Android phone?

  • The time on the Android phone is about 5 seconds off to the watch. The hhone time is only about half a second off to the NTP servers. So the watch seems to be lagging.

  • You could try going to the App Loader from within Gadgetbridge and doing Set Bangle.js time from that.

    I guess there's a possibility that if your phone takes a few seconds to connect, by the time it's managed to connect the time that was going to be sent to it is slightly out of date.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Time sync issues bangle js 2 (ios)

Posted by Avatar for Andtalath @Andtalath

Actions