Re: [Gpsbabel-code] Fwd: [Gpsbabel-misc] Garmin Edge 800 FIT format won't convert after firmware up
Brought to you by:
robertl
From: Nils <int...@gm...> - 2012-05-14 19:16:46
|
Hi Robert, thanks... I have another update with a few more cleanups in the debugging messages. I'll attach it, might be worthwhile diffing and seeing if you want to apply it. The reason I overdid the debugging was to be able to understand the datastream ad D9, lower levels were to not flood the user so much, but if the format changes again, or something screws up, the full D9 is useful to track the bug. Thanks Nils On 2012-05-14 17:02, Robert Lipe wrote: > Thanx. I've applied a variation of this and added your original test > files to the test suite. > > I did sedate some of the debug warnings. There's no reason to scare the > user by default with billions of warnings that aren't their fault, that > they can do nothing about, and that are harmless. > > gpsbabel-code is the place to discuss bits and bytes. You're correct > that discussing it on -misc tends to scare end users. :-) > > RJL > > > On Sat, Apr 14, 2012 at 1:36 AM, Nils <int...@gm... > <mailto:int...@gm...>> wrote: > > Hi Robert, > > I added a bunch of debugging code to the gpsbabel_fit parser, and a > debug function to fatal.c > > The problem seems to be in the garmin unit, there is a definition > message at the end of the .fit file saying that the next message will > have 6 fields, the next data message also claims 6 fields, but then the > parser runs out of stuff to parse, even though the length definitions > given in the data message are correct. > > Run with -D 9 to see the debug stuff in detail. > > My "fix" is to just return a 0x0 on truncated packets if the parser has > run out of stuff to read... since this can only happen on the last item > in the file, the fix should be safe enough if not pretty. > > One question though: > fit_getuint8(void) reads an int > fit_getuint16(void) reads a char[2] > fit_getuint32(void) reads a char[4] > ...isn't the first function reading too much data (int == 2 bytes?) ? > The pointer decrementing is correct (--, -=2, -=4), but the data value > in the first one could be messed up, or am I missing something obviouus? > > Files attached; let me know if you need anything else, and also where to > post messages like this, I didn't want to send it to -misc. > > Thanks > Nils > > On 2012-04-12 19:19, Nils wrote: > > Hi Paul, > > > > Robert recommended asking you, since you wrote the fit support > > initially... any chance you could have a look at this? > > > > Thanks > > Nils > > > > -------- Original Message -------- > > Subject: [Gpsbabel-misc] Garmin Edge 800 FIT format won't convert > after > > firmware upgrade > > Date: Thu, 12 Apr 2012 16:42:24 +0200 > > From: Nils <int...@gm... <mailto:int...@gm...>> > > To: gps...@li... > <mailto:gps...@li...> > > > > Hello, > > > > I have a Garmin Edge 800, and since upgrading the unit to the latest > > firmware, the .fit format seems to have changed, I can't convert > to GPX > > anymore. > > > > gpsbabel -D9 -i garmin_fit -f 2012-04-12-14-53-58.fit -o gpx -F > > 2012-04-12-14-53-58.fit.gpx > > GPSBabel Version: 1.4.3 > > fit: record truncated > > > > ...and that's it. Attached are a file that works (with the older date > > and converted gpx), and one that doesn't. > > > > gpsbabel is compiled from todays SVN sources, Firmware in the unit is > > 2.40, I'm not sure what the old version was, but it wasn't too old > as I > > bought the unit just last summer. > > > > Any ideas? > > > > Thanks > > Nils > > > > > > |