• I ran the code below after downloading from the AGPS app and was delighted to see that
    when it is stationary the GPS is really accurate and hdop was coming back as 0.8.
    It took quite a while for the max difference between points to reach 1.
    This means taking a fix every second on a B2 after its had AGPS is not going to cause any issues with apps like run.

    I did something similar on Bangle 1 (but AGPS mind) and it came out as a max of 18m between points.

    { "lat": 54.93713, "lon": -1.59312883333, "alt": 121.5, "speed": 0,
      "course": 0,
      "time": Date: Thu Jan 20 2022 21:59:14 GMT+0000,
      "satellites": 12, "fix": 1, "hdop": 0.8 }
    distance: 0
    avg=0 max_dist 0
    { "lat": 54.93713033333, "lon": -1.59312883333, "alt": 121.5, "speed": 0,
      "course": 0,
      "time": Date: Thu Jan 20 2022 21:59:15 GMT+0000,
      "satellites": 12, "fix": 1, "hdop": 0.8 }
    distance: 0
    avg=0 max_dist 0
    >
    
    let last_fix = {
      fix: 0,
      alt: 0,
      lat: 0,
      lon: 0,
      speed: 0,
      time: 0,
      satellites: 0
    };
    
    function radians(a) {
      return a*Math.PI/180;
    }
    
    function degrees(a) {
      var d = a*180/Math.PI;
      return (d+360)%360;
    }
    
    function distance(a,b){
      var x = radians(a.lon-b.lon) * Math.cos(radians((a.lat+b.lat)/2));
      var y = radians(b.lat-a.lat);
      return Math.round(Math.sqrt(x*x + y*y) * 6371000);
    }
    
    var total_dist = 0;
    var max_dist = 0;
    var avg_dist = 0;
    var fix_cnt = 1;
    
    function onGPS(fix) {
      if (fix.fix) {
        if (fix_cnt < 2) {
          last_fix = fix;
          fix_cnt++;
          return;
        }
        
        fix_cnt++;
        console.log("\n");
        console.log(fix);
        var dist = distance(last_fix, fix);
    
        last_fix = fix;
    
        console.log("distance: " + dist);
        if (dist > max_dist) max_dist = dist;
        total_dist = total_dist + dist
        avg_dist = total_dist / fix_cnt;
        console.log("avg=" + avg_dist + " max_dist " + max_dist);
    
      } else {
        console.log("Sats: " + fix.satellites);
      }
    
    }
    
    Bangle.setGPSPower(1);
    Bangle.on('GPS',onGPS);
    
About

Avatar for HughB @HughB started