This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SOLVED - Garmin coach not recognizing completed workout

For anyone searching for an answer to this in the future, there is a way to resolve this issue but unless you are confident with command-line, CSV interpretation / manipulation or have developer experience I can't say how much success you'll have. You may end up corrupting the data, just a forewarning. But for those interested, I thought I'd provide a rough walkthrough.

Basically, there is a tool which allows us to convert the original FIT file to a CSV and provide the necessary additional data rows to attribute a given activity with a workout / training plan.

To access, you will need to download and install the FIT SDK available here at the time of posting. Once downloaded, you'll need to extract the SDK .zip file to a location somewhere on your computer. I'm sure that there's some info regarding installation help / instructions provided by Garmin probably here. I'm not going to cover platform specific zip extraction in this overview because I doubt many people will even get to this point in this guide I'm writing, lol.

Going forward, we only need one utility from the SDK called FitCSVTool located at [SDK installation path root]/FitSDKRelease_XX.XXX.XX/java/FitCSVTool.jar

Therefore, you want to open up a local terminal session and navigate via the terminal into that directory, so we're correctly setting our local command path root e.g. I'm using bash so...

cd [path_to_extracted_SDK]/FitSDKRelease_XX.XXX.XX

Then you can just follow this guide to execute the necessary commands to convert binary FIT files to and from a readable CSV format. NB I think Garmin provides alternate ways to convert the FIT files using drag-n-drop if that's your flavor.

If you've gotten this far, the next step is to basically export the activity in question from Garmin's Connect web application in it's "Original" format. At the time of posting, go to Activities > All Activities and select the activity that you want to retrospectively log against your training plan. Then select the settings cog icon from the top-right of the page and the "Export Original" option from the dropdown menu.

(I'm sure there's personal data I should be obfuscating but if you can find a way to exploit this then you probably deserve the fruits of your labour.)

Once you've done that, you want to extract the downloaded file to a location somewhere on your computer again because it will be a compressed zip file (which is understandable because Garmin are hosting your data for you without an ongoing subscription cost).

Um, so next you want to follow Garmin's instructions for converting the binary FIT file to CSV using the SDK utility that you diligently prepared above. You will also want to follow the same steps in order to export a legit activity that was logged against your training plan, because you will use the data from this entry to populate the activity that you want to associate with your training plan. I'll explain more in a sec...

Okay! If you actually made it this far, open the two CSVs. On Windows I can snap the two excel instances side-by-side which helps visualize what's missing from the activity in question and why it doesn't register against your training plan.

Below, there's a sequence of screenshots and descriptions I've provided to help you get setup for preparing to modify your activity (bash is running from the system PATH variable against a "bash for windows" instance in case your wondering why I'm using bash syntax in a PowerShell session - Ignore this if it means absolutely nothing to you as it's not relevant at all). It's basically visually depicting the file conversion, comparison and modification steps.

Above: I'm converting the reference activity I downloaded from Garmin into a csv. I will use the data from this csv to populate the activity that I want to convert.

Above: Here I'm converting the activity that I want to retrospectively log against my training plan.

NOTE- By default, the converted file will be dropped into the same directory as the FIT file. You can look at the command line arguments to supply an output location for the CSV if you want.

Above: The confirmation you should expect if you've successfully converted a FIT file into CSV.

 

Above: Here I open the CSV files side-by-side in MS Excel and I've highlighted the difference between the two files. On the left are the fields that we want to copy / paste into the activity that is not being registered against your training plan. The difference basically dictates why your activity is not being logged against your training plan and there's more info from Garmin here. Specifically, look at the info on these data fields:

Above: Info from Garmin on the meaning of the Workout and Workout Step data fields within an activity entry.

Cool, so if you actually made it this far there's bugger-all to do now. We want to copy the good data from the rows indicated in the screenshots above into the same rows on the file that we want to modify. Then IMPORTANTLY we want to modify the following so we can attribute the activity in question with our training plan for the correct date / time. See screenshots below on the fields you need to modify and below each screenshot will explain what you're changing:

The highlighted cell (in green) should match the timestamps indicated above (in red circles). This indicates the activity log time and the timestamp in our workout session should correspond with the activity log time. I'm not sure what format this is logged-in since it doesn't seem to match any ISO standard I'm familiar with. Just copy your legit timestamp to override the copy / pasted timestamp we took from our other activity.

Beyond this, I personally didn't need to change anything else because my copied workout matched in all other respects i.e. both days were Easy Run and Easy Pace with a single step. But as an example, I did check the following fields to ensure that they exactly matched the workout I was supposed to do. From left-to-right and top-to-bottom those fields indicate:

  • the distance in meters of the planned workout;
  • the name of the workout;
  • distance in cm of the workout;
  • workout step name; workout name.

I'm not going to cover this in any more detail though, since there are so many more variables / fields you will need to validate depending on if you're training plan involves running, swimming, cycling, walking etc. etc. You'll need to refer to Garmin's (pretty decent) developer documentation to figure out how to correctly manipulate the target fields depending on your situation.

Your final step is to convert the modified CSV back to a FIT file, for which you can refer to the referenced Garmin documentation if you run into problems. Below I'm just showing a contrived example using bash again executing commands from within the extracted SDK folder:

java -jar .\java\FitCSVTool.jar -c [path-to-the-csv-you-have-modified] [destination-path]

Once you've done that, you can simply drag-n-drop your modified FIT file into the Garmin Connect web application via the cloud icon and selecting 'Import Data' from the dropdown. As per below:

Okay! I hope this example and walkthrough gives you the foundational knowledge to go forth and hack your activities Slight smile.  I guess I'd be amenable to answering questions / troubleshooting if it's not completely ludicrous. But like I mentioned, there are so many different variables which could differ between your situation and mine that it would be impossible to cover every scenario. The aim here was to empower you to find the information you need depending on your situation and to also illustrate just how ludicrous this is to undertake. 

That being said, I now understand why it's also so difficult for the Garmin devs to add this "retrospective workout logging" feature.

Peace!

  • Wow - Amazing solution, nice Job! For me, this problem has happened two times in a twelve week training plan, not much but still a weird bug that shouldn't happen. Frustrating to complete an activity and not have it recorded in the plan. Thanks for the response.

  • Thanks for writing this up.

    Unfortunately the steps did not work for me. The missed workout had the same metadata as a workout that was actually tracked. Even after copying it over, it also failed to be recognized.

    I also needed to do an extra step, using "java/ActivityRepairTool.jar" on the file after converting it from CSV back to FIT, or else garmin wouldn't recognize it.

    Either way, the coach never recognizes it. For me it was also "Easy run" with the exact same distances as you, funny enough.

    Ultimately, I just deleted the schedulde run from my training plan, it was the last run of the week anyways.

    One peculiarity with my situation is that the run that wasn't recognized was one that I had rescheduled in my training plan from another day. Perhaps Garmin doesn't test this edge case for workout matching or something...

  • Hi!

    Sorry for the delayed reply. I'm so pleased that this article is helping anybody. But yeah, that's a strange situation @1209917 and it sucks that you had to delete a session from your activity schedule. I wonder if there was some missing metadata from the amended file which created problems with the conversion from csv to FIT. As I mentioned, it's a complex undertaking with a number of fragile data points that manipulation without understanding the impact, could completely corrupt an exercise entry. For myself, I had to rebuild the FIT file from backups on multiple occasions, just to understand the value of a particular data point.

    In any case, thanks for adding to the pool of knowledge regarding this subject. It's all very useful circumstantial data that will help the community trouble-shoot such problems ongoing. Slight smile