Playback FIT file in simulator?

Does anyone use the "Playback File..." functionality when testing their apps? And if so, should the FIT files taken directly from an actual device work properly?

I have been trying to test out a data field and I have been using FIT files from my D2 Bravo, which contains elevation information and should likely contain other information such as temperature, speed (groundspeed) and heading. However, when playing back the file the only thing that seems to be set within the Activity.Info object that is passed to the compute() method is position. Elevation, speed and heading are all zero and/or null. I saw all old thread from 2014/2015 that mentioned something about missing data but surely this isn't *STILL* the case? If it is still the case and FIT file playback is only partially working, then how are other people testing out their apps and/or data fields other than the obvious (and undesirable) option of building for their device and testing in the wild?

Thanks,
Douglas
  • Former Member
    Former Member over 9 years ago
    Hey I just wanted to take a moment to chime in. First, you should definitely be able to playback fit files taken from your watch or exported from Garmin connect. I tried playing back a fit file on my mac here and ran it for a good 15 min without any of the issues you are seeing. Just to make sure I wasn't fooling myself I changed our Simple Data field Sample to take the info.altitude and info.currentSpeed just to try and match the info you were looking for and I was able to display the data without issues. Did you say you tried it with two different fit files (running and flying)? I just want to make sure that I understand correctly. I'm sorry this isn't working for you. I'll do my best to try and reproduce it. Maybe you can send me the .fit you are using and I can see if I'm getting the same thing over here?

    -Coleman
  • Hey I just wanted to take a moment to chime in. First, you should definitely be able to playback fit files taken from your watch or exported from Garmin connect. I tried playing back a fit file on my mac here and ran it for a good 15 min without any of the issues you are seeing. Just to make sure I wasn't fooling myself I changed our Simple Data field Sample to take the info.altitude and info.currentSpeed just to try and match the info you were looking for and I was able to display the data without issues. Did you say you tried it with two different fit files (running and flying)? I just want to make sure that I understand correctly. I'm sorry this isn't working for you. I'll do my best to try and reproduce it. Maybe you can send me the .fit you are using and I can see if I'm getting the same thing over here?

    -Coleman


    Hi Coleman and Brian,

    Thanks for the response. I've been practically (but not literally) pulling my hair out. I'm wasn't sure if it's a Mac thing (or maybe my Mac) or a FIT file or what. I have emailed you one of the flying FIT files I've tried. I've also tried FIT files from running and cycling. I have a FIT file from another device now that I'll try shortly to see if that helps narrow down the issue.

    Cheers,
    Douglas
  • Hi Coleman and Brian,

    Thanks for the response. I've been practically (but not literally) pulling my hair out. I'm wasn't sure if it's a Mac thing (or maybe my Mac) or a FIT file or what. I have emailed you one of the flying FIT files I've tried. I've also tried FIT files from running and cycling. I have a FIT file from another device now that I'll try shortly to see if that helps narrow down the issue.

    Cheers,
    Douglas


    Okay, so I used a FIT file from another device (vivoactive HR) and the data I want/need is properly set within the simulator, with the exception of heading, which makes sense because the vivoactive HR doesn't have a magnetic compass. So I now know that it's not Mac in general (though we knew that since Coleman said he's on Mac) nor is it my individual Mac. However, I don't know if it's related to the fact that I'm using SDK 2.1.3 with a file generated from a Connect IQ 1.2.x device (D2 Bravo) and the file works because the vivoactive HR is now on Biker or if this is specific to the D2 Bravo generated files. I am going to try and get a FIT file from a regular vivoactive and see if that makes a difference.

    Thanks for everyone's help with this.

    Cheers,
    Douglas
  • Former Member
    Former Member over 9 years ago
    Got your file.

    This is definitely a compatibility issue with how the D2 bravo records files. Some of the pieces we can fix in our simulator, and I'll get a ticket created for us to tackle that. Some of the other pieces just don't appear the be getting recorded, so I'm not sure what can be done there. A request could be made to the D2 device team to enable recording of the data.

    Anyway, here's the scoop. I decoded the file you sent, and this is what a record message looks like:


    [table="width: 100%"]
    [tr]
    [td]timestamp[/td][td]836075545[/td][td]s[/td]
    [td]position_lat[/td][td]<redacted>[/td][td]semicircles[/td]
    [td]position_long[/td][td]<redacted>[/td][td]semicircles[/td]
    [td]distance[/td][td]118.03[/td][td]m[/td]
    [td]enhanced_speed[/td][td]60.108[/td][td]m/s[/td]
    [td]enhanced_altitude[/td][td]1418.8[/td][td]m[/td]
    [td]temperature[/td][td]35[/td][td]C[/td]
    [/tr]
    [/table]

    The main problem here is that the D2 is using the fields "enhanced_speed" and "enhanced_altitude" (which makes sense because the default fields were not designed to handle the speeds and altitudes experienced during flying). The FIT file parser doesn't support those fields, so they don't get processed. This is the easy fix. We can add support for those fields to the file parser.

    You can see however, that heading is not being recorded to the file by the D2, so even with added support for the enhanced fields, you aren't going to see that. I thought heading would be provided based on direction of travel if a direct value wasn't available, but you've indicated that isn't the case. We could also look into making an enhancement that would compute that data from the GPS positions. I'm not sure if other products record heading to the file or not. The parser will read it from the file if it is present.
  • Got your file.

    This is definitely a compatibility issue with how the D2 bravo records files. Some of the pieces we can fix in our simulator, and I'll get a ticket created for us to tackle that. Some of the other pieces just don't appear the be getting recorded, so I'm not sure what can be done there. A request could be made to the D2 device team to enable recording of the data.

    Anyway, here's the scoop. I decoded the file you sent, and this is what a record message looks like:


    [table="width: 100%"]
    [tr]
    [td]timestamp[/td][td]836075545[/td][td]s[/td]
    [td]position_lat[/td][td]<redacted>[/td][td]semicircles[/td]
    [td]position_long[/td][td]<redacted>[/td][td]semicircles[/td]
    [td]distance[/td][td]118.03[/td][td]m[/td]
    [td]enhanced_speed[/td][td]60.108[/td][td]m/s[/td]
    [td]enhanced_altitude[/td][td]1418.8[/td][td]m[/td]
    [td]temperature[/td][td]35[/td][td]C[/td]
    [/tr]
    [/table]

    The main problem here is that the D2 is using the fields "enhanced_speed" and "enhanced_altitude" (which makes sense because the default fields were not designed to handle the speeds and altitudes experienced during flying). The FIT file parser doesn't support those fields, so they don't get processed. This is the easy fix. We can add support for those fields to the file parser.

    You can see however, that heading is not being recorded to the file by the D2, so even with added support for the enhanced fields, you aren't going to see that. I thought heading would be provided based on direction of travel if a direct value wasn't available, but you've indicated that isn't the case. We could also look into making an enhancement that would compute that data from the GPS positions. I'm not sure if other products record heading to the file or not. The parser will read it from the file if it is present.


    Hi Brian,

    Thank you *SO* much for digging into this.

    Interesting on the enhanced fields. I'm not familiar with the FIT spec but I'm guessing that the original spec wasn't designed for tracking those of us addicted to powered flight. ;)

    As for compass heading, I guess that it's not tracked per se since you can determine heading/track given two lat/lon points. Not sure it's worth even trying to get added into the recording as it's of little value, other than for simulation.

    Cheers,
    Douglas
  • It's likely you get the heading on the real watch. I have some fit files where the heading is always zero (North), and the apps work correctly on watches with and without a HW compass.
  • It's likely you get the heading on the real watch. I have some fit files where the heading is always zero (North), and the apps work correctly on watches with and without a HW compass.


    Yes, I do get the heading on the real watch (using Info.currentHeading), which only added to the confusion when I was doing all the testing and brought this up yesterday. It was my error to assume it was in the FIT file but without it being saved in the activity file it's just harder for me to test without actually going flying (or writing some code to add in the heading/track for use in the simulator). The odd thing is that if there is no compass/heading/track data then the DF really should be receiving a null value rather than a zero. But that's another issue.

    The important thing here is that I now know that it wasn't me doing something wrong it was the D2 Bravo FIT file output.

    Cheers,
    Douglas
  • For heading, I'm just used to testing on a watch. Don't know if you'll be trying to use the HW Compass (by way of Sensors), but that's something that can only be tested on a real watch unless you provide dummy data.
  • Hi Brian,

    Did you manage to get a trouble ticket in for this? And if so, any idea if it will make it into the next release of the simulator?

    Cheers,
    Douglas
  • Former Member
    Former Member over 8 years ago
    There is a ticket logged to add support for the enhanced speed and altitude values to FIT file parsing, but it is not going to be in the next Simulator release. I think it has a decent chance of being in the one after next, but it is impossible to say for sure.