Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

FIT workout scheduling problem

Rank

Total Posts: 3

Joined 0

PM

Hello,
I'm having problems implementing the FIT workout scheduling specification. I attached 4 FIT files (compressed) to the e-mail, the two with a name ending "GF" were generated from my application and the two ending with "GTC" we're generated using Garmin Training Center. Although all versions of the files are valid with respect to the public specification, only the versions coming from GTC work on the device. The version I generate appear on the device (a 610XT from a user) but the name appears corrupted in the "workout of the day" menu and selecting the scheduled workout crashes the device. Given the name is not present in the schedule file I'm very confused and I feel it has to do with the file_id.time_created parameter which has given me problems in the past because of Garmin's usage of this field.

I would really appreciate some help on this issue.
Thanks a lot

P.S. I know the files are not optimized but my C# implementation of the SDK is much simpler this way. [file name=Schedules.zip size=1405]http://www.thisisant.com/images/fbfiles/files/Schedules.zip[/file]      
Rank

Total Posts: 3

Joined 0

PM

I triedd two things yesterday but I'm stil lgetting the same result.

1) Update my profile version to the latest (4.10 instead of 1.0)
2) Remove unnecessary data from the file_id message as stated in the spec (manufacturer & type only)

Still getting the corrupted name on the device.      
Avatar
Rank

Total Posts: 7

Joined 2012-02-22

PM

I don't have access to a 610 at the moment but I decoded your fit files and had a look.

File_id shouldn't contain both file number and time_created fields. I think time_created is the appropriate one in this instance. Try dropping the number field from both your schedule.file_id & workout.file_id messages.

Your time_created fields also seem strange. Schedule.file_id.time_created seems ok (717678744 ~27/09/2012), but Schedule.schedule.time_created is 373927518 and workout.file_id.time_created is 282267369, both a really long time ago. I guess the actual values don’t matter but I think part of your problem is they mismatch.

The schedule message in the schedule file references the file_id message in the desired workout file (see figure 14-2 in the FIT File Types document found in the FIT SDK archive). Both schedule.schedule and workout.file_id should contain matching values for the following 4 fields: manufacturer, product, serial_number and time_created.

I think the reason the 610 is crashing is because it can’t find a workout file with a file_id message that matches the values specified in your schedule message. The time_created values disagree and there is no serial_number field at all. Try making your schedule message match the file_id message in your workout file (manufacturer, product, serial_number and time_created).

Although you define and redefine your workout_step messages somewhat differently than the GTC file, the steps seem equivalent to me. I think this section is fine.

HTH      
Rank

Total Posts: 3

Joined 0

PM

Hello and thanks for the answer,
First of all, you are right about the mismatching data between workout & shecule files. I must have confused different exports with all these tests, sorry for the confusion. As for the "weird" file_ids.time_created, there is a simple reason for this. Garmin treats this fild as a unique identifier for workouts but since the field is in seconds it causes problems when exporting multiple workouts (computers are fast nowadays... it's easy to export multiple files within one second). Therefore, I hash the workout name to get a unique identifier that is used as the file_id.time_created field. GTC does teh same thing but with a different hash algorithm. Finally, There is no mention in the spec that number & time_created are mutually exclusive, in fact I remember being told that the combination of both was a unique identifier... What is it all about?

With that said, I worked on the issue in the mean time and have progressed thanks to a FR610 I burrowed to help test. I have modified my implementation to make the files match more closely. This means that I order messages & fields like GTC and now the only difference between my files and the ones generated by GTC is the Workout.file_id.time_created (and CRC obviously) as explained above.

Still, the ANT Agent "fails" to upload the Schedules file to the device I have. I put 'fails' in quotes because it says that it fails and it stops synching but when I delete the Schedules file from the ANT sync folder and complete the sync, I find all the scheduling information on the watch. I get the exact same behavior with an export from GTC unfortunately but this doesn't help my users one bit since all most users will see is a failed sync. Is there a way to get a log of the synching to see what is going wrong?

Thanks

P.S. I attached an updated version of the workout & schedules files from my app and GTC is it helps you tests & reproduce the problem. [file name=Schedules-b2975cf4a2261ae5d11c4eb55c1c4385.zip size=894]http://www.thisisant.com/images/fbfiles/files/Schedules-b2975cf4a2261ae5d11c4eb55c1c4385.zip[/file]