Updating FIT files

Recently I had to update my Edge830 Totals.fit file to match the number in garmin-connect application.

I saw that there are several tools to convert FIT files to CSV and back to FIT. For some reason I could not find any of these tools. So, I decided to write my own tools using the GARMIN SDK.

The tools are 2 c files fit2csv.c and csv2fit.c. Their source files are in https://github.com/YoramF/FIT2CSV2FIT_tools and anyone who needs them can copy the files, extract the GARMIN SDK and compile & link according to README.md.

Good luck :)

  • Nice approach, man!

    The official tools FitCSVTool.jar is actually capable of converting CSV back to FIT, however, we need to install java which is so sad, I wish they create binary version of it so we can run it regardless the platform without requiring us to install java, especially if we don't write java program.

    Since your tool is written in C we can compile it into a binary program to targeted platform, which is very nice!

    With the same energy as yours, I created it similar tool to convert CSV back to FIT in Golang, however I am using my own FIT SDK since Garmin has no official SDK for Go. I created other tools as well such as a tool to combine multiple activity FIT files into one continuous activity so we could upload it to Garmin Connect or Strava as a single activity, maybe it would interest you: https://github.com/muktihari/fit, just sharing, enjoy! :)

  • Hi,

    I checked the FitCSVTool.jar and it generate lots of "Unknown" messages for FIT messages with global_mesg_num which are not defined in the SDK. 

    These CSV files with those unknown messages can't be converted back to FIT.

    That is why I preferred to generate a sort of a FIT dump file in CSV format. Of course anyone who needs to update the CSV file, must have some knowledge with the FIT SDK and the different messages formats.

    For my needs (updating the values in Totals.fit), these two C files are good enough.

    I am sure someone can take these sources and build a more robust tools.

    Your project seems why more robust, though.

    Cheers.

  • Ah you are right! Those "unknown" messages and fields could not be converted back to FIT as FitCSVTool.jar does not print the mesg number for instance "unknown(68)".

    Being able to convert "unknown" messages is excellent. I believe your project will be very helpful to someone who needs this tool.

    My program is currently only able to print the "unknown" with mesg number, however converting the unknowns back to FIT is not yet supported. Will update later when I have time as well, you give me the idea to improve it.

    Cheers!