Announcement

Collapse
No announcement yet.

How to Import TCX Files from Fitbit to Garmin Connect

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to Import TCX Files from Fitbit to Garmin Connect

    Anyone who has tried to export a tcx file from Fitbit and subsequently import into Garmin Connect has probably experienced the "An error occurred with your upload. Please try again." error.
    For example: https://forums.garmin.com/showthread...CX-from-Fitbit

    I've found that you can get it to import successfully if you make the following changes to the .tcx file (which can be opened in a text editor)...

    1. The first line will look something like this...
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    Remove the standalone="yes" part so it looks like this...
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    2. The end of the file will look something like this...
    Code:
                        </Trackpoint>
                    </Track>
                </Lap>
                <Creator xsi:type="Device_t" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                    <Name>Fitbit Charge 2</Name>
                    <UnitId>0</UnitId>
                    <ProductID>0</ProductID>
                </Creator>
            </Activity>
        </Activities>
    </TrainingCenterDatabase>
    Remove the following section of the above block...
    Code:
    <Creator xsi:type="Device_t" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <Name>Fitbit Charge 2</Name>
        <UnitId>0</UnitId>
        <ProductID>0</ProductID>
    </Creator>
    It should now look like this...
    Code:
                        </Trackpoint>
                    </Track>
                </Lap>
            </Activity>
        </Activities>
    </TrainingCenterDatabase>
    If you make these two simple changes, the file should import just fine.

    Unfortunately, the total calories burned value gets lost in the import... so you'll have to add that manually. I couldn't figure out how to fix that.
    Last edited by demarcmj; 04-20-2017, 10:31 AM.

  • #2
    Update: Only a couple days have passed since I posted the above, but it seems like something has changed and those two things alone don't do it anymore.

    Now, a third change appears to be needed in addition to the two given above.

    It seems Garmin Connnect doesn't like this type of time notation...
    Code:
    2017-04-03T16:36:57-04:00
    You need to do a find and replace to convert all of the "-04:00" to "Z"
    So the above should look like...
    Code:
    2017-04-03T16:36:57.000Z
    Note: Depending on your time zone, your files may have a number other than "4" in "-04:00"

    I'm 100% sure I didn't have to do this a couple days ago, but that seems to be par for the course with this crazy Garmin Connect import tool.
    Also interesting is the fact that, in my imports a couple days ago, the total calories figure wasn't being imported, but now it is. ¯\_(ツ)_/¯

    Something to note about this new wrinkle...
    Because you're effectively removing the time zone information, the time of your activity will import wrong. In my example above... 2017-04-03T16:36:57-04:00 should be 4:36PM in my local time, but because I removed the time zone information, Garmin imports it as 12:36PM. Since I have many files that I need to import, I am scripting the whole thing. So it's not a big deal to add the 4 back to the time number when I remove the "-04:00" If you're just importing a handful of these, you'd probably just need to fix it manually.

    Comment


    • #3
      Fitbit TCX to Garmin Converter

      Hey demarcmj,

      Thanks for figuring out what it takes to make this work! I used the info you gathered and wrote up a quick powershell to help others convert fitbit TCXs to a Garmin acceptable format.

      I added in a function to convert the -04:00 timezone format to the UTC zulu format the Garmin uses. Hopefully this will preserve accurate run times

      ConvertFitbitTCXFilesToGarmin.zip

      Here are some basic instructions for the non powershell saavy.

      Author: Michael Abair
      Date: 2017-05-04
      Usage:
      1.) Save ConvertFitbitTCXFilesToGarmin.ps1 file from the zip above to your C:\ folder (for simplicity's sake)
      2.) Click Start->Run->Powershell
      3.) Type CD C:\ into the powershell window and hit enter (this changes the directory to the C:\ where you saved the ConvertFitbitTCXFilesToGarmin.ps1 File)
      4.) Type . .\ConvertFitbitTCXFilesToGarmin.ps1 and hit enter (this is how powershell loads the functions from the ps1 file)
      ### Notice that the above is period space period slash filename;
      5.) Type Convert-AllTCXFilesInFolder("C:\tcx") and hit enter.. Replace C:\tcx\ with the folder that has all of your unconverted tcx files or create a c:\tcx and put all your files there
      6.) Your files will all be converted and saved to C:\ConvertedTCXFiles. When you go to import on garmin connect just look for them there.

      I hope this will help someone else throw out their fitbit and enjoy their new Garmin!

      Comment


      • #4
        Nice.
        I did mine in MATLAB, so it didn't seem like too many people would get use out of it if I posed it. ¯\_(ツ)_/¯

        Comment


        • #5
          Thank you very much. It works perfectly!!!!

          Comment


          • #6
            I did this and it worked great. Thanks!

            Comment

            Working...
            X