BangleRun - distance staying at 0

Posted on
  • Hi everyone,

    just received my Bangle.Js and as an avid runner, I took it for a run.
    The displayed distance stayed at 0 for all my run, but when I downloaded the GPX track, it was correct.

    Did I miss something?
    I waited for the GPS fix to be there (green "GPS") and started the run with BTN1, then paused it once finished with BTN1 again, and hold BTN3 for some seconds to exit.

    Thanks!
    Nico

  • Hi Nico,

    Thanks for letting us know - sorry about this. Honestly, we've had a lot of pain with BangleRun recently - the original developer is in proper Covid lockdown and hasn't had a chance to test out his changes, and I've been poking around trying to fix some problems (it's only yesterday that I got the logging and time working again).

    I'll have another look and see if I can figure out what's going on with distance.

  • Thanks for the quick answer Gordon, and not to worry.
    If that helps, I can test newest versions and report here - or DM me if needed.

    Thanks again!

  • Right, so I did another run today, and can confirm that the GPS trace is OK - although there's ~400m difference between what Bangle.JS recorded (9.7 Kms) vs. my Apple watch (10.1 Kms).

    So the issue has really to do with the display:

    • distance stays at 0,
    • cadence is wrong (at ~70) - but it was good for the first 20 min or so (~150),
    • number of steps is clearly wrong - 3948 steps for 10K, I don't have that long strides ;)

  • so after importing the BangleRun GPX file into SmashRun: the distance is almost the same (10.09 vs 10.10 Kms), however the HRM is wrong and has not been added to the trace (stays at 60) - is there something to do to enable HRM while running?

    the elevation gain/loss is also "interesting": +507m / -509m, whereas it's pretty flat where i live (and my running watch reports +90m/-87m, which looks more realistic).

  • Ok, it's good to hear about the distance being the same once you got the data in... That implies that actually there's no need for the Kalman filtering.

    Where did you get the 9.7km figure from? BangleRun?

    Altitude accuracy using GPS is always a difficult one - because the satellites are generally either side of you, altitude precision is far less than lat/lon. My guess is your running watch may have a barometer in it, which would help it get far more accurate data.

    In terms of HRM, it should be recorded. If you open the GPX file in a text editor I bet you'll find the data there. It may just be in the file in a form that SmashRun doesn't recognise. If you could post an example file that does contain HRM data that SmashRun recognises then I might be able to tweak the export so it works.

    The step counting is something I know isn't great (it uses a very simple algorithm right now) but I'm actively looking into improvements for that and I'm hopeful that version 2v09 firmware will be a lot better.

    Having looked into BangleRun a bit, it seems cadence is literally just total steps / run duration when I guess realistically it should be looking at that figure, but just based on the past 5 minutes?

  • Thanks Gordon.

    Where did you get the 9.7km figure from? BangleRun?

    That was in GPXsee, a fat client I'm using on my laptop

    In terms of HRM, it should be recorded. If you open the GPX file in a text editor I bet you'll find the data there. It may just be in the file in a form that SmashRun doesn't recognise. If you could post an example file that does contain HRM data that SmashRun recognises then I might be able to tweak the export so it works.

    No, the HR data is always at 60, like in the example below:

          <trkpt lat="xx.yyyyyy" lon="z.zzzzz">
            <ele>55.4</ele>
            <time>2021-02-04T10:50:11.999Z</time>
            <extensions>
                <gpxtpx:TrackPointExtension>
                    <gpxtpx:hr>60</gpxtpx:hr>
                    <gpxtpx:distance>0</gpxtpx:distance>
    
                </gpxtpx:TrackPointExtension>
            </extensions>
          </trkpt>
    

    So I guess this is the HRM which didn't record properly - is there anything to do when starting a run in BangleRun, or should the HRM record directly?

    The step counting is something I know isn't great (it uses a very simple algorithm right now) but I'm actively looking into improvements for that and I'm hopeful that version 2v09 firmware will be a lot better.

    got it, thx

    Having looked into BangleRun a bit, it seems cadence is literally just total steps / run duration when I guess realistically it should be looking at that figure, but just based on the past 5 minutes?

    I think the calculation method is fine, provided it's accurante :)
    That'd be average cadence, as opposed to lap cadence

  • Ok, now that's odd. I mean, HRM isn't that accurate but it'd be all over the place, not 60 the whole time! Looks like BangleRun does some filtering: https://github.com/espruino/BangleApps/b­lob/master/apps/banglerun/src/hrm.ts#L21­

    I wonder whether because you were moving the whole time and the Bangle reported a low confidence in the reading, BangleRun never actually updated it from the default value?

  • maybe the watch was too loose on my wrist, I'll make sure it's more tight next time I test it while running and will report here.

  • Would just like to chime in and confirm that I see the same behaviour: Distance stays at 0, Pace: --:--

    It worked fine in the past, does this have to do with an update?

  • Hi - yes, there was an update from the original dev that changed the way GPS data was handled to make it more efficient, and that appears to have broken the 'kalman filter' code. The original dev doesn't seem to have time to work on it I made some changes to at least make logging work, but it still seems broken.

    As far as I can tell the filter isn't really helping (there's one in the GPS anyway) so today I'm going to add a change that just removes it, and hopefully that'll fix any issues there currently are.

  • Very interesting, I had to read up on the kalman filter topic. Thank you so much for putting your energy into this (also thanks to cartron for his input)! Let me know how I can test it when you have committed the change.

  • Ok, fixed hopefully! You can try the new BangleRun version now at https://espruino.github.io/BangleApps/

    I'll push to the main app loader later in the week

  • Thanks for the lightning fast fix. Speaking of lightning fast: I just tried it for a quick run and now the pace shows a value, but it is half of what it should've been and I don't think I broke the sound barrier just yet. The exported GPS file shows the correct distance and time though.

  • Did the pace work before? As far as I can see, the pace is set to '1000 * duration / distance' - but both of those seem ok now?

  • The pace worked last year, I can't say when exactly it stopped working. I just went for another run and the pace displayed seemed to be off by a minute. Might it take the distance covered earlier into account when calculating pace? Because I rode my bicycle first, but presset BTN1 only after arriving at the start location. The resulting GPX was correct again :-).

  • Might it take the distance covered earlier into account when calculating pace?

    Did the distance and duration shown in the UI start from 0? As far as I can tell the pace comes from exactly those values, so I guess one of them must be off.

    I did notice that without the kalman filter code, the reported distance does seem to be a bit higher than I remember it being before - so that could be it.

    The problem I have is I'm receiving conflicting reports! I had someone earlier tell me that what seemed to be the uncorrected distance calculated from the GPS trace matched up exactly with an Apple watch, so I thought I'd just use that. But it seems that maybe the GPS trace does need some kind of filtering now (or maybe altitude shouldn't be taken into account since that does fluctuate a lot due to GPS being less accurate for height).

  • Hi, last week I saw that BangleRun had been updated to version 0.10, with release notes mentioning:

    Removed kalman filtering to allow distance log to work
    Only log data every 5 seconds (not 1 sec)
    Don't create a file until the first log entry is ready
    Add labels for buttons

    I ran with both my running watch and my BangleJS, and the results are better, see https://twitter.com/cartron/status/13713­84344133177351?s=20

    The algorithm for counting steps is still not perfect, but at least the distance is correctly displayed (albeit not super precise).

  • Ok, great! The step counting is something that hopefully will improve at some point - that'll end up being a firmware change though so it should improve step counting in all apps

  • Hi all,

    I made the first upload of BangleRun app with versione 0.0.4.
    It was displaying all counters and was updating as expected.

    I've searched for differences between latest version and 0.0.4, but no luck due to history stopped at 0.0.5.

    Looking at line 48 into:

    https://github.com/espruino/BangleApps/b­lob/master/apps/banglerun/src/gps.ts

    if (!isFinite(dt)) dt=0;
    

    I can't find that function in code and its not imported.

    Could be it the cause of strange behaviour?

    Please apologize me if I'm saying something stupid.

    Thanks for all of your great work.

    Massimiliano

  • it is implemented, you find it here http://www.espruino.com/Reference#l__glo­bal_isFinite

  • Hi - what do you mean by 'history stopped'?

    There's a list of what changed in the ChangeLog (https://github.com/espruino/BangleApps/b­lob/master/apps/banglerun/ChangeLog) since 0.04 there were a lot of changes though!

  • Hi @Gordon, simply I wasn't able to find code before 0.0.5 version commit.
    I'm not so expert sorry.

    I'll look more deeply for change that has broken distance logging.

  • No problem at all - so what is broken? The 'distance' field on the watch screen?

    That's something that was a problem since 0.05 as you say, but it was fixed in 0.10 - or is something else broken?

  • Hi @Gordon,

    you are giving me a one of the most beautiful info of this new week.
    Updated version to 0.10 now.
    I haven't seen new version, sorry.

    Next sunday I'll enjoy my Bangle again.

    Thanks to all for all.

    Massimiliano

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

BangleRun - distance staying at 0

Posted by Avatar for cartron @cartron

Actions