Skip to content

Wahoo iOS app generated fit file isse #107

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

Closed
erwinfs opened this issue Jun 18, 2020 · 1 comment
Closed

Wahoo iOS app generated fit file isse #107

erwinfs opened this issue Jun 18, 2020 · 1 comment

Comments

@erwinfs
Copy link

erwinfs commented Jun 18, 2020

Hi,
Thank you for your very useful program.

I had an issue with a file generated by the Wahoo iOS app (files from my Garmin watch work fine).
I printed the field names and units in add_dev_field_description:

field_name: calibration
units: adc
field_name: charge
units: %
field_name: running_smoothness
units: %
field_name: time_ms
units: ms
field_name: ant_device_num
None
field_name: crank_length
units: mm x 10
field_name: glucose
units: mg/dL
field_name: avg_smoothness_x
units: avg per/step
field_name: avg_smoothness_y
units: avg per/step
field_name: avg_smoothness_z
units: avg per/step
field_name: travel_assist_level
None
field_name: lev_travel_assist_level_time_in_zone
units: ms

The fields that lack units cause the problem.

Replacing line 453 in records.py with the following solved the problem for me
if message.get('units'): units = message.get('units').raw_value else: units = ''

@gschramm
Copy link

gschramm commented Jul 15, 2020

I have the same problem with a file recorded and exported from the Stava Android app.
It seems that some messages don't have the unit field such that message.get('units').raw_value fails as described above.

An example message is:
<DataMessage: field_description (#206) -- local mesg: #0, fields: [developer_data_index: 0, field_definition_number: 1, fit_base_type_id: string, field_name: activity_type]>

The issue can be fixed, by testing if the output from message.get('units') is equal to None.

if message.get('units') is not None:
    units = message.get('units').raw_value
else:
    units = None

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

Successfully merging a pull request may close this issue.

2 participants