Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

SDK Update to Reflect Garmin Segment FIT File Format

Rank

Total Posts: 4

Joined 2014-07-07

PM

Hi,
I'm looking at the .fit files used in the Garmin Edge 1000 to define Segments (equivalent to Strava Segments). I've checked the v11 ANT SDK documentation and Java source and the SDK does not yet support this format. Specifically, of the 6 fit message definitions in a segment file, the third (General Message Number 148), fourth (149), fifth (142) and sixth (150) are not defined.
Is the SDK going to be updated to support these definitions and is their a timeline? Or are these "vendor specific" additions which will not be documented in the core SDK and where might documetation for them exist?
Either way, it's not exactly healthy for a specification to have non-standard and undocumented usage in use for months in retail products before the documentation exists.
Sample segment file attached in zip - should now work.      

File Attachments

Avatar
RankRankRankRank

Total Posts: 296

Joined 0

PM

Your file attachment doesn't seem to work - I can't download the file.

Cheers,
OMB      
Rank

Total Posts: 4

Joined 2014-07-07

PM

Noted. Re-adding the file to the original post via both IE and Firefox resulted in nothing useful so I'm pasting a hexdump of the file here, as well as re-attaching the .fit and a .png of the hexdump in the hope that one of them will show up!

Zip file appears to have added OK to original post.

From my parsing I think there are Message Definitions starting at offsets 0x000E, 0x0036, 0x0046, 0x0094, 0x00C9 and 0x0146 with respective global message nos of 0x00 (0, file_id), 0x31 (49, file_creator), 0x94 (148, ?), 0x95 (149, ?), 0x8E (142, ?) and 0x96 (150, ?). None of thos last 4 appear to exist in the SDK documentation or Java source (MesgNum.java).

Apologies if this is incorrect - I only started looking at fit files yesterday.

00000000  0e 10 ff 03 cd 01 00 00  2e 46 49 54 9f 8f 40 00  |.........FIT..@.|
00000010  01 00 00 06 00 01 00 01  02 84 02 02 84 04 04 86  |................|
00000020  03 04 8c 05 02 84 00 22  00 01 ff fe 2e 0c 01 4b  |.......".......K|
00000030  00 00 00 01 00 01 41 00  01 00 31 02 01 01 02 00  |......A...1.....|
00000040  02 84 01 00 00 00 42 00  01 00 94 06 03 01 00 00  |......B.........|
00000050  0d 07 04 04 86 02 01 00  01 21 07 06 01 02 02 01  |.........!......|
00000060  54 65 73 74 4e 6f 43 68  65 65 73 65 00 00 1a ff  |TestNoCheese....|
00000070  9b 02 41 46 32 38 45 39  43 46 42 37 35 32 34 43  |..AF28E9CFB7524C|
00000080  34 38 42 38 36 31 46 30  32 43 31 42 30 46 43 38  |48B861F02C1B0FC8|
00000090  36 38 00 01 43 00 01 00  95 05 03 04 86 02 04 86  |68..C...........|
000000a0  fe 02 84 04 04 86 01 01  00 03 1c 40 31 3e ff ff  |...........@1>..|
000000b0  ff ff 00 00 00 00 40 a8  00 03 1c 40 46 5b ff ff  |......@....@F[..|
000000c0  ff ff 00 01 00 00 41 d1  01 44 00 01 00 8e 0e 41  |......A..D.....A|
000000d0  21 07 15 02 84 16 02 84  1b 04 85 1c 04 85 19 04  |!...............|
000000e0  85 1a 04 85 fe 02 84 03  04 85 04 04 85 05 04 85  |................|
000000f0  06 04 85 09 04 86 17 01  00 04 41 46 32 38 45 39  |..........AF28E9|
00000100  43 46 42 37 35 32 34 43  34 38 42 38 36 31 46 30  |CFB7524C48B861F0|
00000110  32 43 31 42 30 46 43 38  36 38 00 00 05 00 00 24  |2C1B0FC868.....$|
00000120  3d 84 43 ff 87 ae 16 24  3d b0 85 ff 87 fb b3 00  |=.C....$=.......|
00000130  01 24 3d b0 85 ff 87 ae  16 24 3d 84 43 ff 87 fb  |.$=......$=.C...|
00000140  b3 00 00 3e 64 02 45 00  01 00 96 06 01 04 85 02  |...>d.E.........|
00000150  04 85 fe 02 84 04 02 84  03 04 86 05 08 86 05 24  |...............$|
00000160  3d b0 85 ff 87 ae 16 00  00 0a 61 00 00 00 00 00  |=.........a.....|
00000170  00 00 00 00 00 00 00 05  24 3d a9 e2 ff 87 b3 1f  |........$=......|
00000180  00 01 0a 5e 00 00 06 dd  00 00 05 e0 00 00 05 d9  |...^............|
00000190  05 24 3d a2 4c ff 87 bd  12 00 02 0a 5c 00 00 10  |.$=.L.......\...|
000001a0  0c 00 00 0d dd 00 00 0d  a8 05 24 3d 92 54 ff 87  |..........$=.T..|
000001b0  db bf 00 03 0a 5c 00 00  27 75 00 00 23 e4 00 00  |.....\..'u..#...|
000001c0  25 18 05 24 3d 84 43 ff  87 fb b3 00 04 0a 62 00  |%..$=.C.......b.|
000001d0  00 3e 64 00 00 3e b1 00  00 41 1a 4d 0a           |.>d..>...A.M.|
000001dd 
     

Image Attachments

Untitled.pngTestNoCheese_segment.fit.png

Click thumbnail to see full-size image

Avatar
RankRankRankRank

Total Posts: 296

Joined 0

PM

Don't know if this is of any help for you, but here's the output of my .FIT file parser.
You see the messages and the field values (value, followed by field number and type info in paranthesis).
I've hidden the two strings - don't know if disclosing these obvious ids might cause any problems.

Cheers,
OMB
FIT File:
  
Protocol version1.0
  Profile version
10.23
  Data length
461 bytes
Data message
File Id
  File type
"34"
  
Manufacturer"Garmin"
  
Product"Garmin Connect"
  
Serial Number"0x00000001"
  
DateTime24.06.2014 10:04:59
  Number
"0x0001"
Data messageFile Creator
  Software version
0
  Hardware version
0x00
Generic Data Message
Type 148 (148)
  
"TestNoCheese"                            (#0, STRING, 13 bytes)
  
"AF******************************"        (#1, STRING, 33 bytes)
  
0x02 (2)                                  (#2, ENUM, 1 bytes)
  
0x01 (1)                                  (#3, ENUM, 1 bytes)
  
0x001AFF9B (1769371)                      (#4, UINT32, 4 bytes)
  
0x01 (1)                                  (#6, UINT8, 1 bytes)
Generic Data MessageType 149 (149)
  
0x00 (0)                                  (#1, ENUM, 1 bytes)
  
invalid                                   (#2, UINT32, 4 bytes)
  
0x1C40313E (473968958)                    (#3, UINT32, 4 bytes)
  
0x000040A8 (16552)                        (#4, UINT32, 4 bytes)
  
0x0000 (0)                                (#254, UINT16, 2 bytes)
Generic Data MessageType 149 (149)
  
0x01 (1)                                  (#1, ENUM, 1 bytes)
  
invalid                                   (#2, UINT32, 4 bytes)
  
0x1C40465B (473974363)                    (#3, UINT32, 4 bytes)
  
0x000041D1 (16849)                        (#4, UINT32, 4 bytes)
  
0x0001 (1)                                (#254, UINT16, 2 bytes)
Generic Data MessageType 142 (142)
  
0x243DB085 (608022661)                    (#3, SINT32, 4 bytes)
  
0xFF87AE16 (-7885290)                     (#4, SINT32, 4 bytes)
  
0x243D8443 (608011331)                    (#5, SINT32, 4 bytes)
  
0xFF87FBB3 (-7865421)                     (#6, SINT32, 4 bytes)
  
0x00003E64 (15972)                        (#9, UINT32, 4 bytes)
  
0x0005 (5)                                (#21, UINT16, 2 bytes)
  
0x0000 (0)                                (#22, UINT16, 2 bytes)
  
0x02 (2)                                  (#23, ENUM, 1 bytes)
  
0x243DB085 (608022661)                    (#25, SINT32, 4 bytes)
  
0xFF87FBB3 (-7865421)                     (#26, SINT32, 4 bytes)
  
0x243D8443 (608011331)                    (#27, SINT32, 4 bytes)
  
0xFF87AE16 (-7885290)                     (#28, SINT32, 4 bytes)
  
"AF******************************"        (#65, STRING, 33 bytes)
  
0x0001 (1)                                (#254, UINT16, 2 bytes)
Generic Data MessageType 150 (150)
  
0x243DB085 (608022661)                    (#1, SINT32, 4 bytes)
  
0xFF87AE16 (-7885290)                     (#2, SINT32, 4 bytes)
  
0x00000000 (0)                            (#3, UINT32, 4 bytes)
  
0x0A61 (2657)                             (#4, UINT16, 2 bytes)
  
[0x00000000 (0), 0x00000000 (0)]          (#5, UINT32[2], 8 bytes)
  
0x0000 (0)                                (#254, UINT16, 2 bytes)
Generic Data MessageType 150 (150)
  
0x243DA9E2 (608020962)                    (#1, SINT32, 4 bytes)
  
0xFF87B31F (-7884001)                     (#2, SINT32, 4 bytes)
  
0x000006DD (1757)                         (#3, UINT32, 4 bytes)
  
0x0A5E (2654)                             (#4, UINT16, 2 bytes)
  
[0x000005D9 (1497), 0x000005E0 (1504)]    (#5, UINT32[2], 8 bytes)
  
0x0001 (1)                                (#254, UINT16, 2 bytes)
Generic Data MessageType 150 (150)
  
0x243DA24C (608019020)                    (#1, SINT32, 4 bytes)
  
0xFF87BD12 (-7881454)                     (#2, SINT32, 4 bytes)
  
0x0000100C (4108)                         (#3, UINT32, 4 bytes)
  
0x0A5C (2652)                             (#4, UINT16, 2 bytes)
  
[0x00000DA8 (3496), 0x00000DDD (3549)]    (#5, UINT32[2], 8 bytes)
  
0x0002 (2)                                (#254, UINT16, 2 bytes)
Generic Data MessageType 150 (150)
  
0x243D9254 (608014932)                    (#1, SINT32, 4 bytes)
  
0xFF87DBBF (-7873601)                     (#2, SINT32, 4 bytes)
  
0x00002775 (10101)                        (#3, UINT32, 4 bytes)
  
0x0A5C (2652)                             (#4, UINT16, 2 bytes)
  
[0x00002518 (9496), 0x000023E4 (9188)]    (#5, UINT32[2], 8 bytes)
  
0x0003 (3)                                (#254, UINT16, 2 bytes)
Generic Data MessageType 150 (150)
  
0x243D8443 (608011331)                    (#1, SINT32, 4 bytes)
  
0xFF87FBB3 (-7865421)                     (#2, SINT32, 4 bytes)
  
0x00003E64 (15972)                        (#3, UINT32, 4 bytes)
  
0x0A62 (2658)                             (#4, UINT16, 2 bytes)
  
[0x0000411A (16666), 0x00003EB1 (16049)]  (#5, UINT32[2], 8 bytes)
  
0x0004 (4)                                (#254, UINT16, 2 bytes) 
     
Rank

Total Posts: 4

Joined 2014-07-07

PM

Thanks OMB, nice parser!

Type 150 looks to be a segment track point with lat, long, time etc.
Type 142 looks to be the segment track summary with start and end point.
Type 148 a segment description.
Type 149 might be current leader/personal best times for a leader board

Wondering if the AF******* etc is a polyline for quick rendering.

BTW, based on experience, do you know if this is likely to be something that would be included in an SDK update or would be a Garmin specific addition that and as such would remain outside the SDK?
     
Avatar
RankRankRankRank

Total Posts: 296

Joined 0

PM

No clue,
there have been several undocumented messages in Garmin .FIT files, which later on found their way into the spec (FIT SDK). There are some others that have been in .FIT files for years and still aren't documented by thisisant.com.
In this case, not only some message types, but the file type itself (no. 34) isn't specified in the SDK.

By the way: where and how did you get this .FIT file from?
The file creator says "Garmin Connect", but I'm not aware that you can get .FIT files from GC.

Cheers,
OMB      
Rank

Total Posts: 4

Joined 2014-07-07

PM

The fit files are placed on the Edge 1000 in the NewFiles directory by Garmin Express when syncing segments from Garmin Connect to the Edge. After a power cycle the files are digested and turn up in the Segments directory, still with the same content. So I got them by syncing them to the Edge and then copying them off before and after a power cycle for comparison.

WRT to SDK documentation..... nothing like a challenge. Cheers for the help.      
RankRank

Total Posts: 44

Joined 2013-04-07

PM

Dack - 07 July 2014 02:03 PM

... General Message Number 148, 149, 142, 150 are not defined ...
Is the SDK going to be updated to support these definitions and is their a timeline?


have a look @ FIT SDK Release 15.10 June 2015