Third party fitness tracking applications

Posted on
  • Hey all!

    Currently my Bangle.JS 2 performs great as a HRM tracker using the Run app and a BT HRM chest band.

    I only have one issue I'd like to talk through before trying to tackle it myself. The standard .CSV export is not usable with 3rd party fitness tracking apps. I always have to copy the HRM readouts to another template following the CyleOps .CSV standard. Then I have to populate the Minutes column. See example.csv on the site of TrainingPeaks, my fitness tracking app, for more info: https://help.trainingpeaks.com/hc/en-us/­articles/204070354-Compatible-Device-Fil­es.

    I've been digging around the code and it seems that .CSV exports are build up through the bangle.JS/store and that apps can add columns to files on the Bangle.JS. Would it be feasible to somewhere in an extra export app redefine the heading row of a .CSV export? That could hugely increase operability with other fitness platforms.

    Another alternative: would implementing Garmin's FIT protocol be feasible? This seems to be more of a stretch, but I'm no expert programmer at all.

    So: what are your thoughts on this matter? How should I try and tackle this?

  • Dream of syncing Bjs with Strava. In order not to manually copy activity files.

  • As far as I remember, .fit is well documented but proprietary format. My Garmin watch uses it and I like that it gives infos about heart rate zones directly to the app I use for my running data. But I'm ok to sacrifice that to have a free format file.

  • Aha, then I'd rather stay away from .fit as well.

    This brings me to the other solution: changing the CSV export to be more similar to the format below. Where in the code should I best attempt this?

    Minutes, Torq (N-m),Km/h,Watts,Km,Cadence,Hrate,ID
    0.017,0,6.2,0,0.006,4,0,0
    0.033,0,8.4,0,0.008,17,67,0
    0.05,0,10.7,0,0.01,0,67,0
    0.067,0,12.6,0,0.014,0,62,0
    0.083,0,12.6,0,0.018,0,62,0
    0.1,0,15.1,0,0.022,0,62,0
    0.117,0.3,14.7,37,0.027,0,62,0
    0.133,1.2,13.8,132,0.031,35,62,0
    0.15,1.3,13.9,147,0.033,53,62,0
    0.167,1.2,14.7,149,0.037,59,62,0
    0.183,1.2,15.1,150,0.041,63,62,0
    
  • So you are using the Recorder app already to get the CSV data?

    Because when you click the 'interface' button in the App Loader for Recorder you should have the option to download the tracks in the raw CSV form, but also GPX or KML format (which include entries for BPM/other stuff which are compatible with Strava).

    You could easily add a new export type there (code is at https://github.com/espruino/BangleApps/b­lob/master/apps/recorder/interface.html#­L15-L135) but it may well be that the GPX/KML export does what you need anyway?

    edit: It'd be easy to modify that code to re-order the CSV output style (maybe leave an option to have it as-is), but I wouldn't change the format that the data is stored in on the watch because it could potentially break other apps.

  • KML and GPX won't work for me, as I don't have any GPS data points whilst training at the gym. Also, the GPS of the bangle.js is toont unreliably for datapoints within a 400m biking track if I go outside.

    Then it seems like would need to hardcode the .CSV headers and do some error checking if they actually correspond to anything in the data store.

    I'm not a developer and I'm certainly willing to give it a go, but I don't feel like this is a clean, "upstreamable" solution. I might be mistaking, though.

    I guess it would be more feasible to feed (0,0) coordinates to the GPX file, so at least all HRM data points get exported?

    What's your take on this? Wat would you consider the best idea

    Edit: E.g. TrainingPeaks doesn't support Bangle.JS's GPX-output, giving feedback that it's not formatted as expected by the standard.

  • hardcode the .CSV headers

    I think it's definitely an option especially if that meant the file could be loaded by multiple different programs (we could have a drop-down for the CSV export format) - but when doing this initially it felt like CSV wasn't really a 'standard' in the way that GPX/KML was.

    I guess it would be more feasible to feed (0,0) coordinates to the GPX file

    Ahh, that's a good point about missing GPS data. It looks like the interface file currently just strips out data points where there is no GPS data: https://github.com/espruino/BangleApps/b­lob/master/apps/recorder/interface.html#­L17

    It'd be pretty easy to add an option that was something like 'use these coordinates when GPS unavailable', which might (hopefully) solve most issues for you.

    TrainingPeaks doesn't support Bangle.JS's GPX-output, giving feedback that it's not formatted as expected by the standard.

    Does it give any explanation of what's wrong? Do you have any example files that do work? Because I'm pretty sure the data was imported by Strava just fine (and I think I took the data format from an example Strava file).

  • …. But when doing this initially it felt like CSV wasn't really a 'standard' in the way that GPX/KML was.

    No worries, it still isn't. It's just that TrainingPeaks only accepts CSVs as formatted by specific training hardware. I do believe that GPX is the superior format anyways. I know of no program that uses KML, so I'm neglecting that one. :P

    It'd be pretty easy to add an option that was something like 'use these coordinates when GPS unavailable', which might (hopefully) solve most issues for you.

    I've tested a GPX file of a training I've done outside. This seems to work out — pun intended — just fine. It's the superior option what I'm concerned. The main problem then is that the HR readouts are only exported given GPX-values are set.

    I've edited a GPX-readout from my watch to only show realistic time and HR values.
    It seems to work out just fine. Setting all coordinates to zero also keeps the HR and time values. Keeping coordinates as an empty string is no problem either.

    I believe the problem is fixed by removing the check in this line: https://github.com/espruino/BangleApps/b­lob/0f25f341d4217ff29b8818e61f71210d29d0­d41d/apps/recorder/interface.html#L94

    Attached are the GPX-readouts.

    P.S.: I see there is even extra, commented out plausible data entries. Cool, so we just need to perform some data checks and enable them? :D

    Thanks for your personal support, Gordon. I might be nitpicking, but take that as a compliment. I love my Bangle.JS 2. All your hard work is appreciated.


    2 Attachments

  • Ok, great - I'll see about putting an option in there for including GPS entries. I think I ended up taking them out because some apps complained so I can't just leave them in by default.

    P.S.: I see there is even extra, commented out plausible data entries. Cool, so we just need to perform some data checks and enable them?

    Basically, yes :) If we have the data from Bangle.js we could put that in. There may be others too I guess.

    TrainingPeaks doesn't support Bangle.JS's GPX-output, giving feedback that it's not formatted as expected by the standard.

    Has that error gone away now then?

    And thanks! I'm glad you like it! It's always good to try and get it working with as much stuff as possible :)

  • I indeed have no errors with the files I've attached above.

    Thanks a bunch for looking into this!

  • Just added - so if you try the development app loader I'd be interested to see how you get on

  • You're a hero. I'll give it a whirl!

  • When there's completely no GPS info, only HR info, the export button to GPX doesn't show up. Even when I enable the toggle "Include GPX/KML entries even when there's no GPS info."

    This is suboptimal for indoors training, so I hope this is a helpful first test run. 😁

  • Oops - try now!

  • This fix works out just fine. Thanks, Gordon!

    (Ceterum censeo TrainingPeakam delendam esse.)

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

Third party fitness tracking applications

Posted by Avatar for 7rozen_7ear_ @7rozen_7ear_

Actions