dtcooper / python-fitparse

Python library to parse ANT/Garmin .FIT files
http://pythonhosted.org/fitparse/
MIT License
738 stars 183 forks source link

Parsing Error - invalid local message type 2 #105

Closed tjaeuth closed 4 years ago

tjaeuth commented 4 years ago

Hi, thanks for this great project.

We use fitparse mainly for Garmin and Wahoo files. Sometimes it happens that it stops reading the file with following error: Got data message with invalid local message type 2

I am not allowed to upload files here. It would help if someone could tell me what this error message is supposed to say.

tnikkel commented 4 years ago

Just a guess: the fit sdk has been updated and this library hasn't been updated with the new changes and the files you are using use something new spec?

tjaeuth commented 4 years ago

@tnikkel thank you for your answer.

We haven't updated the profile since downloading fitparse. If I understood you correctly, we must update the profile in fitparse, since the profile probably does not match the spec of the files.

I will give it a try by downloading latest SDK and generating a new profile: python3 scripts/generate_profile.py /path/to/fit_sdk.zip fitparse/profile.py

tjaeuth commented 4 years ago

Updating the profile did not help. However, the files were corrupted because they were truncated by some bytes.