Additional data - pulse, temperature

A place for the community to help each other out with getting the most out of the Combine FIT, GPX or TCX files for Strava Upload Tool.
Post Reply
Malcerz
Posts: 4
Joined: Sun Nov 10, 2024 11:12 am

Additional data - pulse, temperature

Post by Malcerz »

I have pulses and temperature data in the GPX file. But when GPX conversion to FIT, this data is lost. Only the route and time remains, without things saved in the field for extensions.
Do you have to mark something in the conversion so as not to lose additional data? Even when it saves GPX as GPX, this data is omitted
User avatar
fulmar2
Site Admin
Posts: 255
Joined: Wed Nov 25, 2020 4:21 am
Contact:

Re: Additional data - pulse, temperature

Post by fulmar2 »

Can you please upload your GPX? Just so you know, GPX does not natively support any of those fields. Strava uses the “cluetrust” schema which allows users to add those fields in… but it’s not part of GPX. TCX is better for this (however TCX does not support temperature). Gotoes, being written for Strava, reads and writes GPX using the Cluetrust schema.. but only Strava could read the values.

Instead, it is best to work with TCX - or better yet FIT… especially if you’re using a platform other than Strava.
Malcerz
Posts: 4
Joined: Sun Nov 10, 2024 11:12 am

Re: Additional data - pulse, temperature

Post by Malcerz »

My GPX:
<trkpt lat="54.331373" lon="18.601743">
<ele>71.664035</ele>
<time>2024-11-09T07:40:36.557000Z</time>
<extensions>
<extensions>
<gpxtpx:TrackPointExtension>
<gpxtpx:hr>92</gpxtpx:hr>
<gpxtpx:atemp>4</gpxtpx:atemp>
</gpxtpx:TrackPointExtension>
</extensions>
</extensions>
</trkpt>

After uploading it to Strava all data is visible.
gpx.jpg
But after going through gotoes additional data is lost. Fit only has distance and time.
fit.png
Attachments
Morning_Ride.gpx
(538.99 KiB) Downloaded 32 times
User avatar
fulmar2
Site Admin
Posts: 255
Joined: Wed Nov 25, 2020 4:21 am
Contact:

Re: Additional data - pulse, temperature

Post by fulmar2 »

Ok, yes, that is roughly the cluetrust schema, however it appears that the extensions tag is duplicated (it shows up twice). So, gotoes hasn’t been trained yet to detect this error in the file.

Where did you get the file? A direct export from Strava? In the near-term, you could delete out the double extensions tag:

Code: Select all

<extensions>
…
…
…
</extensions>
There should only be one of each of these. Your file has two, which is causing another layer of nesting.

In the long term, especially if this is a new “glitch” introduced by Strava’s export, I can write a work-around to detect these improperly formatted files. Oftentimes, I’ve had to add in “workarounds” for bad coding on websites. Usually, they correct their code eventually, but it is faster for gotoes to just work around the issue.

I’m not able to use a computer for a few days (on a bike tour now), but when I get home, I can write the workaround for you. Alternatively, you can write to whoever generated that GPX and let them know there is a bug in their export.
Malcerz
Posts: 4
Joined: Sun Nov 10, 2024 11:12 am

Re: Additional data - pulse, temperature

Post by Malcerz »

The data is from the AmazFit watch, which records the heart rate but does not record temperature data. It generates this itself in Python.

I modified Python to add HR and atemp in a single extension (this is probably in accordance with the GPX standard?) but still after saving to Fit this data disappears

<extensions>
<gpxtpx:TrackPointExtension>
<gpxtpx:hr>103</gpxtpx:hr>
<gpxtpx:atemp>5</gpxtpx:atemp>
</gpxtpx:TrackPointExtension>
</extensions>
But when exporting to GPX they stay and the file imports correctly to Strava

Have a successful bike trip;)
User avatar
fulmar2
Site Admin
Posts: 255
Joined: Wed Nov 25, 2020 4:21 am
Contact:

Re: Additional data - pulse, temperature

Post by fulmar2 »

Ok, so just to be clear, this is from a GPX file that you made? A custom GPX, so to speak? It’s not that the data is being lost during the gotoes conversion to FIT… it’s never being read into gotoes in the first place.

I would like to help you, however, I think that the best way to solve this would be for the GPX to be formatted correctly, as opposed to gotoes adding in a workaround for a one-off, non compliant file.

Here is the Strava blog on how they chose to extend GPX:

https://developers.strava.com/docs/uploads/

Please scroll down to the section about GPX. Gotoes has made the decision to read Garmin GPX and also use the Cluetrust extension like Strava. You will see that Strava additionally will try and parse anything in the extension tags. If you would like for gotoes to be able to read your GPX, please click the Cluetrust link on the Strava page, and have your python script generate a compatible GPX file.

I’m open to changing the gotoes parser if it will help lots of people, but my guess is that you’re the only one in this situation, right?
Malcerz
Posts: 4
Joined: Sun Nov 10, 2024 11:12 am

Re: Additional data - pulse, temperature

Post by Malcerz »

The source GPX file itself is original from the watch, and I only add temperature data to it.
I have already corrected the errors and I get the correct fit file with complete data.
Now I just have to sign the power measurement. Strava generates the supposed power itself, but without the possibility of exporting
User avatar
fulmar2
Site Admin
Posts: 255
Joined: Wed Nov 25, 2020 4:21 am
Contact:

Re: Additional data - pulse, temperature

Post by fulmar2 »

Hi there... So, you are saying that AmazFit watch produced this export with the double <extensions> tag? That seems weird because I think that only Strava is using these non-standard gpxtpx tags. Are you sure you didn't export this file from Strava?

Regardless, I went ahead and changed the GOTOES code to also be able to interpret this malformed <extensions><extensions> tag.

Now, what are you asking for when you say that you need to "sign the power measurement"? Let me know how I can help with that.
Post Reply