gps issue

Posted on
Page
of 2
Prev
/ 2
  • This could be differences in firmware between your Bangle 1 and Bangle 2 - rather than related to the code above. What versions of firware are you using. I seem to remember that using GPS time was taken out of the firmware or bootcode on Bangle 2.

  • 2v11 in Bangle 2. I've tried putting the bootcode into the actual watch face code, with the same result. If GPS time is not in firmware, does that mean it can't be accessed at all for registering time in the watch?

  • Should a reboot message appear on Version 2 that GPS time is being used?

    No... In fact it shouldn't appear on Bangle.js 1 either if everything is up to date?

    Since the firmware was modified to persist time between reboots I removed the GPS time code since it really wasn't needed. The only time the time would be lost is when the battery ran flat, and at that point the GPS would lose time too

  • Everything's up to date. Apparently running on GPS time, then, watch 1 keeps fairly good time but watch 2 races ahead. Is there a fundamental difference I'm missing?

    Is the set GPS time perhaps not registering in Bangle.js 2?

  • Is the set GPS time perhaps not registering in Bangle.js 2?

    I'm not sure what you mean. By default, GPS time is now not used at all (but to be fair it was never used before unless your clock wasn't set).

    If you want to actually update from GPS time then you'll need to modify the code you posted above so the checks like getFullYear()<2000 are removed, so time is always updated rather than only updating when the clock is obviously not set up

  • The code below takes out the checks mentioned above. The watch (Dozenal Time 2 on Bangle.js 2) still gains 4+ seconds a day. (Bangle.js 1 does not.)

    Can it be determined from this whether it is reading GPS time, continually? Must the GPS be acquired and set before the watch face is uploaded? The reverse? Does it matter?

    I apologize once again for not being a scripter. Most of the rest of the watch code was written by a person who left the project. A little of the most obvious javascript I understand, but that's all.

    // Time fix with GPS
    function fixTime() {
    	Bangle.on("GPS",function cb(g) {
    		Bangle.setGPSPower(0,"time");
    		Bangle.removeListener("GPS",cb);
    		// We have a GPS time. Set time
    		setTime(g.time.getTime()/1000);
    		}
        );
    	Bangle.setGPSPower(1,"time");
    	setTimeout(fixTime, 10*60*1000); // every 10 minutes
    }
    // Start time fixing with GPS on next 10 minute interval
    setTimeout(fixTime, ((60-(new Date()).getMinutes()) % 10) * 60 * 1000);
    
  • You could add some E.showMessage("...") statements so you can see what is happening (or maybe even fit something into the watch face).

    But... you really need to have made sure the GPS has a fix first. If the GPS hasn't got any GPS time yet then it's not going to be able to update the time

  • Thanks. Setting the watch down to be stationary outdoors fixes the fix problem, so to speak! The watch still gains, possibly not at a continuous rate. After setting GPS Time last night, this morning it may have gained 2+ seconds, and after a total of about 24 hours, it has gained 4+ seconds. Does that suggest anything?

    Rebooting the next day put the watch 15 seconds behind. Reloading the watch script fixed that.

    Why this is happening, I don't know, because it isn't happening now with Bangle.js 1.

  • I'm not sure. I guess there's also the question of whether the GPS has accurate timekeeping when it can't see the satellites. It may be that it is less accurate than the Bangle.

    Rebooting the next day put the watch 15 seconds behind.

    If you fully reboot the watch then yes, the time will end up behind. The RTC stops when Bangle.js isn't running, so there's nothing we can do. Honestly it was a massive effort even to make it keep the current time.

    Same for entering the bootloader...

    1. Is there a difference between watch 1 and watch 2 in the way they keep the time steady?

    2. Is there a difference in the way the two watches recognize or adhere to GPS time?

  • Different GPS chips, yes, a whole different set of issues, most of which we won't notice, some we will.

  • For watch 2 I'd like to know a way to invoke GPS time that is likely to work and is necessarily different from what I had in watch 1.

    Of course, GPS time needs to work on watch 2 indoors with no satellite, after an outdoor connection. Is that possible?

  • To follow up, with AGPS and GPS I'm getting a fix, so that problem is solved for good.
    (Using AGPS for "GPS only".)

    However precision is still bad. A lot more than the sprecified 2.5m. In at least four attempts.
    (I've heard that the number of satellites used affects precision, which sounds plausible, so those problems maybe connected. Guess I'll have to use @HilmarSt 's script to get more debugging info.)

  • A lot more than the sprecified 2.5m.

    Where is 2.5m mentioned?

    https://www.gps.gov/systems/gps/performance/accuracy/#:~:text=For%20example%2C%20GPS%2Denabled%20smartphones,receivers%20and%2For%20augmentation%20systems.

    Seems to say:

    GPS-enabled smartphones are typically accurate to within a 4.9 m (16 ft.) radius under open sky. However, their accuracy worsens near buildings, bridges, and trees.

    So I wouldn't expect to get double that accuracy from the Bangle I'm afraid.

  • Hi Gordon,
    Just checking in to say I am back home, a replacement would be great if you have stock of black ones. Also will need return address for this one.
    Regards,
    Mick

  • Hi Mick, sure - I'll drop you an email now

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

gps issue

Posted by Avatar for TMQcard @TMQcard

Actions