dtcooper / python-fitparse

Python library to parse ANT/Garmin .FIT files

Home Page:http://pythonhosted.org/fitparse/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hitting "Invalid .FIT File Header" on FR245 Music and sometimes on FR210

jmrnilsson opened this issue · comments

Should I switch to the egg? Maybe the SDK is old on the PYPI package.

I hit the following failure state on all my Garmin Forerunner 245 Music, and some of my Garmin Forerunner 210 fit files. Unknown if Garmin 245 Music previously had this issue. But there has been firmware updates for this device recently.

        if header_data[8:12] != b'.FIT':
            raise FitHeaderError("Invalid .FIT File Header")

raise FitHeaderError("Invalid .FIT File Header")

Version: Pypi fitparse==1.1.0

Thanks for the excellent library 🥇. These binary formats are a real head-scratchers.

I hit the following failure state on all my Garmin Forerunner 245 Music, and some of my Garmin Forerunner 210 fit files. Unknown if Garmin 245 Music previously had this issue.

Can you share some .fit binaries from these devices? Even a 2-second-long empty activity should suffice.

        if header_data[8:12] != b'.FIT':
           raise FitHeaderError("Invalid .FIT File Header")

This header is a very basic fundamental part of the .fit format, and I don't understand how it could diverge on such a common Garmin device. 🤷‍♂️

Yeah. I suppose. Though I have some few things to reinstall. Give me a few days.

I’ve been looking into this. But with a lot of changes in my own code and different version of fitparse. It doesn’t seem like I have this issue anymore.

You could probably close this issue for now, and I can repost if anything shows again.

TL;DR
I’m did some weird work around the file handle since I want to use streaming requests behind Flask. This might very well have messed with encoding or something else.