Recovering partial Garmin recordings

Just a little more after I lost the last part of a ride yesterday on my Garmin 520, which seems to be misbehaving lately. For the second time, most of my ride was recorded, but possibly as the battery life began to drop, or through some other cause, the last section of my ride after the last rest point wasn’t recorded.

Now that Strava has a new facility called “add someone who didn’t record”, if you WERE riding with someone else, they can send you their ride fit file through Strava, and you can upload that instead.

Strava "add friend" option

Strava “add friend” option

The issue with that (although it does give a good fall-back option) is that aspects of the ride personal to the other rider, such as heart rate will be missing, so you get no “suffer score” and power data.

If only part of the ride is missing, there’s another approach.

Ask a friend you were riding with to download their own ride file from their Garmin Connect as a .tcx file (it contains ALL the ride  data). Their original Garmin file in their device will probably be a .fit file (for modern Garmins), not easily editable, but downloaded  .tcx and .gpx ride files are alphanumeric tagged XML files, and they can be edited with a text editor. I use the free TextWrangler editor (there’s a more advanced chargeable version called BBEdit, but that isn’t necessary). I posted about TexWrangler at http://www.briansutton.uk/?p=330

Once you have your own incomplete .tcx file, and also your co-rider’s complete .tcx file, just look at the last timestamp tag in your own file between the <Trackpoint> and </Trackpoint> tags, in my case;

<Time>2018-04-08T13:40:55.000Z</Time>

and then find the next recorded trackpoint in your friend’s file;

<Time>2018-04-08T13:40:56.000Z</Time>

and copy that and all the subsequent trackpoints, and included tagged variables, from their file, and paste into a new file.

Then copy their preamble (everything before their first trackpoint);

<?xml version=”1.0″ encoding=”UTF-8″?>
<TrainingCenterDatabase
xsi:schemaLocation=”http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2 http://www.garmin.com/xmlschemas/TrainingCenterDatabasev2.xsd”
xmlns:ns5=”http://www.garmin.com/xmlschemas/ActivityGoals/v1″
xmlns:ns3=”http://www.garmin.com/xmlschemas/ActivityExtension/v2″
xmlns:ns2=”http://www.garmin.com/xmlschemas/UserProfile/v2″
xmlns=”http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2″
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:ns4=”http://www.garmin.com/xmlschemas/ProfileExtension/v1″>
<Activities>
<Activity Sport=”Biking”>
<Id>2018-04-08T07:55:25.000Z</Id>
<Lap StartTime=”2018-04-08T07:55:25.000Z”>
<TotalTimeSeconds>4386.0</TotalTimeSeconds>
<DistanceMeters>23199.67</DistanceMeters>
<MaximumSpeed>13.734999656677246</MaximumSpeed>
<Calories>289</Calories>
<AverageHeartRateBpm>
<Value>132</Value>
</AverageHeartRateBpm>
<MaximumHeartRateBpm>
<Value>172</Value>
</MaximumHeartRateBpm>
<Intensity>Active</Intensity>
<TriggerMethod>Manual</TriggerMethod>
<Track>

and postamble (everything ATER their last trackpoint);

</Track>
<Extensions>
<ns3:LX>
<ns3:AvgSpeed>5.133999824523926</ns3:AvgSpeed>
</ns3:LX>
</Extensions>
</Lap>
<Creator xsi:type=”Device_t”>
<Name>Edge 820</Name>
<UnitId>3933472402</UnitId>
<ProductID>2530</ProductID>
<Version>
<VersionMajor>8</VersionMajor>
<VersionMinor>80</VersionMinor>
<BuildMajor>0</BuildMajor>
<BuildMinor>0</BuildMinor>
</Version>
</Creator>
</Activity>
</Activities>
<Author xsi:type=”Application_t”>
<Name>Garmin Connect API</Name>
<Build>
<Version>
<VersionMajor>18</VersionMajor>
<VersionMinor>6</VersionMinor>
<BuildMajor>0</BuildMajor>
<BuildMinor>0</BuildMinor>
</Version>
</Build>
<LangID>en</LangID>
<PartNumber>006-D2449-00</PartNumber>
</Author>
</TrainingCenterDatabase>

which contain generic and summary information about the xml version and other data, and add those into the front and back respectively of the partial trackpoint file for you friend’s ride you just created and saved from.

Now you have two ride files available, with complete preambles and postambles – your own original one finishing (say) with the last trackpoint at:

<Trackpoint>
<Time>2018-04-08T13:40:55.000Z</Time>
<Position>
<LatitudeDegrees>56.172812059521675</LatitudeDegrees>
<LongitudeDegrees>-4.150870582088828</LongitudeDegrees>
</Position>
<AltitudeMeters>34.599998474121094</AltitudeMeters>
<DistanceMeters>103168.5390625</DistanceMeters>
<HeartRateBpm>
<Value>139</Value>
</HeartRateBpm>
<Extensions>
<ns3:TPX>
<ns3:Speed>0.0</ns3:Speed>
</ns3:TPX>
</Extensions>
</Trackpoint>

and your friend’s data, from the part of the ride after that, starting with the trackpoint, say:

<Trackpoint>
<Time>2018-04-08T13:40:56.000Z</Time>
<Position>
<LatitudeDegrees>56.1728245485574</LatitudeDegrees>
<LongitudeDegrees>-4.150878209620714</LongitudeDegrees>
</Position>
<AltitudeMeters>24.799999237060547</AltitudeMeters>
<DistanceMeters>103187.5</DistanceMeters>
<HeartRateBpm>
<Value>140</Value>
</HeartRateBpm>
<Extensions>
<ns3:TPX>
<ns3:Speed>0.8209999799728394</ns3:Speed>
</ns3:TPX>
</Extensions>
</Trackpoint>

You will see that the Lat/Long match pretty well at the changeover point, as does the altitude, allowing for slight differences as they were recorded on different devices.

Adding the preamble and postamble data to your friend’s latter part of the ride makes it a properly constituted XML file.

Save, in your text editor, the newly created file with a .tcx extension (instead of the default .xml, to make it a recognisable ride file for Garmin and Strava.

Now go to www.gotoes.org (as I have posted about before at http://www.briansutton.uk/?p=472) and upload, and combine your own ride file, and the partial one created from your friend’s file, using the very simple dialog on that site. Just to be safe, accept the option to randomise the file ID (as if you already uploaded your original incomplete file, Strava will probably refuse another file with the same start time and owner.

That site can automatically upload the file to Strava, and this is what I used yesterday to post my Callander Sportive ride. I had already (quickly!!) made the incomplete one private, so as not to gather “kudos” onto the wrong ride posting. I have also now deleted it so as not to gather double distance on my own Strava activity reporting.

True, the last part has my friend’s heart rate etc, but we rode together, and all the location and speed data is correct; and since my own Garmin recorded everything about my ride up to 105kms or so, out of a total of 140kms, most of the data in the ride is good for me.

Finally – all ride pictures found their way into the right places on the new Strava posting. Unfortunately, Relive’s record of the ride was based on the incomplete 1o5kms ride – but hey….first world problems!

 

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*
Website