Corrupted Garmin file and correction

After many rides with both my Garmin and also Strava on my iPhone, I had stopped recording rides on Strava on the phone as it eats the battery.

But I was caught out at the weekend as one of my Garmin files was corrupted, and wouldn’t upload to Garmin’s site or to Strava. Disaster! 😉

I thought I would follow up on my idea that the tcx (xml) file, which I looked at in Dreamweaver (I’m a part-time and very old-age web developer!) was corrupted, but probably very slightly.

The Dreamweaver diagnosis is full of unrecognised tags, but then it would be because it is set up to look for html tags, not exercise application tags. It did throw up some syntax points, but hard to spot the wood for the trees.

So I researched the web for a dedicated xml file validator / editor, and found one which did both (most only validate). The one I used was Altova, on a 30 day free licence.

Unfortunately, most applications are Windows based, and I use a Macbook, but I have a Windows partition on it (Bootcamp) for just this kind of situation, and so sent the corrupt Garmin file to myself to open in email there (for obvious security reasons you can’t write to Bootcamp partition from the OSX partition) and went to work for what I thought might be a lot of wasted time.

But GOOD NEWS!

There was ONE error in the file, an extra tag between an ending and a beginning tag.

I tried simply deleting the tag thinking it couldn’t be that simple, but IT WAS! The file then saved with no errors (ALTOVA warns you if you try to save an invalid xml file) and I immediately tried and upload to Strava, and that WORKED.

Click here to see that ride. It looks exactly what I was expecting, and completes my Spring Classic challenge (hence my urgency! – how childish…).

Looking back, I think the reason for this has been pausing and un-pausing the Garmin too quickly – when it is off-course, you gat a visual waring of that, but lose the screen space for warnings that you have paused or unpaused it; there is only a slightly different audible tone for pausing vs. unpausing, and I did it a few times at one point on the ride just to make sure it was on. I can’t be certain, but I think something like that must have happened. I guess the Garmin starts a new track every time it pauses or auto-pauses? And it opened a but didn’t have time to close it? Maybe…

Anyway, I attach the corrected text for your delectation!

If I can be of any help to anyone else who gets this issue, let me know (I’m sure an exported .fit file, as a binary file, even if I could have corrected it, would not have responded to such easy treatment. Flat, text-based xml files (tcx in this case) are a lot easier to handle.

I’d be interested in your comments and any further light anyone can throw on it.

PS Here is the offending piece of file, with the orphan tag in bold:

Corrupt Garmin code segment
Corrupt Garmin code segment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: