Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zwift inProgressActivity.fit file #21

Open
rveachkc opened this issue Nov 21, 2021 · 0 comments
Open

Zwift inProgressActivity.fit file #21

rveachkc opened this issue Nov 21, 2021 · 0 comments

Comments

@rveachkc
Copy link

I'm trying to parse a Zwift fit file from an activity in progress, and I'm not having any luck with it. I fear Zwift isn't writing a valid file at this point, but is there something else going on?

Source File from 5 minute ride: inProgressActivity.zip

fittxt output: fittxt_out.txt

In my code, I'm opening up the file just like your example:

with fitdecode.FitReader(in_progress_file) as fit:

Error:

(venv) C:\Users\user\Documents\project\src>python project.py
DEBUG:Located in progress fit file: C:\Users\user\Documents\Zwift\Activities\inProgressActivity.fit
Traceback (most recent call last):
  File "C:\Users\user\Documents\project\venv\lib\site-packages\fitdecode\reader.py", line 645, in _read_data_message
    def_mesg = self._local_mesg_defs[record_header.local_mesg_num]
KeyError: 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\user\Documents\project\src\project.py", line 97, in <module>
    z.run()
  File "C:\Users\user\Documents\project\src\project.py", line 85, in run
    for record in records:
  File "C:\Users\user\Documents\project\venv\lib\site-packages\fitdecode\reader.py", line 232, in __iter__
    yield from self._read_next()
  File "C:\Users\user\Documents\project\venv\lib\site-packages\fitdecode\reader.py", line 363, in _read_next
    record = self._read_record()
  File "C:\Users\user\Documents\project\venv\lib\site-packages\fitdecode\reader.py", line 530, in _read_record
    message = self._read_data_message(chunk, record_header)
  File "C:\Users\user\Documents\project\venv\lib\site-packages\fitdecode\reader.py", line 647, in _read_data_message
    raise FitParseError(
fitdecode.exceptions.FitParseError: FIT parsing error @ 167: local message 2 not defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant