Avatar for HughB

HughB

Member since Dec 2020 • Last active Jan 2022
  • 90 conversations
  • 724 comments

Been in IT for 40 years. Love interprative programming languages. Wrote my own small Emacs in 2000 lines of C (see Atto on Github). Best way to contact me regarding Bangle stuff is through this forum or the private Message service in the forum.

Most recent activity

  • in Bangle.js
    Avatar for HughB

    Wondering what exactly Bangle.getStepCount() returns. Step count from what point ?
    Also wonder what other options exist for Bangle.getHealthStatus(arg);

    >Bangle.getStepCount();
    =15200
    >
    >Bangle.getHealthStatus("day").steps
    =3768
    >
    >WIDGETS.wpedom.getSteps();
    =3733
    >
    >Bangle.getHealthStatus("week");
    Uncaught Error: Unknown range name "week"
     at line 1 col 30
    Bangle.getHealthStatus("week");
                                 ^
    >Bangle.getHealthStatus("month");
    Uncaught Error: Unknown range name "month"
     at line 1 col 31
    Bangle.getHealthStatus("month");
                                  ^
    > 
    
  • in Bangle.js
    Avatar for HughB

    this looks like a photoshop job, it almost feels like you could peel the sticker off the front of the watch :)

  • in Bangle.js
    Avatar for HughB

    Like it ! Could you have an option to put the time at the bottom, for when you can't be bothered to work it out :)

  • in Bangle.js
    Avatar for HughB

    The B2 screen has limitations in terms of how crisp images can be made, so many of these watch faces will look pretty dissappointing when attempted. The B2 has a 178x178 display where as most of these watches will be 380x380 or 400x400. The Amazfit GTS2 is 348x442.

  • in Bangle.js
    Avatar for HughB

    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);
    
  • in Bangle.js
    Avatar for HughB

    Thanks will add it as a feature request for when you are stuck for something to do :)

    I do appreciate this is not a high priority.

  • in Bangle.js
    Avatar for HughB

    Lunchtime testing.

    Etrex 1.3m
    Amizfit 1.27m
    Run 1.2miles - but I suspect the locale is truncating and not rounding.

    I also noticed the distance is in meters to start with (as in 560m) . Then it switches to miles (as in 1.1mi) - very odd.

    Currently I am avoiding the GPS gitter by taking every 10th fix. I will try at every 5 seconds and then 2 but feel a fix every 1 second is bound to introduce errors - due to the snowflake effect I described earlier. I this an update every 5 seconds is enough in practice. Every 10 secnds is too long if you want to see it flip over when you are running.

Actions