tcgoetz / GarminDB

Download and parse data from Garmin Connect or a Garmin watch, FitBit CSV, and MS Health CSV files into and analyze data in Sqlite serverless databases with Jupyter notebooks.
GNU General Public License v2.0
1.18k stars 142 forks source link

"No conversion for units u" when doing first data download #242

Open juliorl opened 3 months ago

juliorl commented 3 months ago

Describe the bug Programme completes execution but I checking the output I found error messages regarding activities not being processed.

To Reproduce Steps to reproduce the behavior: run garmindb_cli.py --all --download --import --analyze

Logs Processing [<FileType.activity: 4>] FIT data from /Users/julio/HealthData/FitFiles/Activities 4%|█▋ | 64/1455 [00:24<08:17, 2.80files/s]Failed to parse /Users/julio/HealthData/FitFiles/Activities/1647637335_ACTIVITY.fit: No conversion for units u 8%|██▉ | 115/1455 [00:36<08:00, 2.79files/s]Failed to parse /Users/julio/HealthData/FitFiles/Activities/1647636773_ACTIVITY.fit: No conversion for units u 30%|██████████▉ | 430/1455 [02:36<06:45, 2.53files/s]Failed to parse /Users/julio/HealthData/FitFiles/Activities/1650881457_ACTIVITY.fit: No conversion for units u 33%|████████████ | 473/1455 [02:54<04:02, 4.05files/s]Failed to parse /Users/julio/HealthData/FitFiles/Activities/1631590303_ACTIVITY.fit: No conversion for units u 37%|█████████████▊ | 543/1455 [03:15<02:41, 5.64files/s]Failed to parse /Users/julio/HealthData/FitFiles/Activities/1619509164_ACTIVITY.fit: No conversion for units u 57%|█████████████████████▏ | 834/1455 [05:10<03:47, 2.73files/s]Failed to parse /Users/julio/HealthData/FitFiles/Activities/1698726503_ACTIVITY.fit: No conversion for units u 65%|████████████████████████▏ | 952/1455 [05:40<01:33, 5.39files/s]Failed to parse /Users/julio/HealthData/FitFiles/Activities/1683635013_ACTIVITY.fit: No conversion for units u 71%|█████████████████████████▋ | 1036/1455 [06:06<01:12, 5.75files/s]Failed to parse /Users/julio/HealthData/FitFiles/Activities/1670275236_ACTIVITY.fit: No conversion for units u 76%|███████████████████████████▍ | 1109/1455 [06:33<01:32, 3.72files/s]Failed to parse /Users/julio/HealthData/FitFiles/Activities/1647637184_ACTIVITY.fit: No conversion for units u 91%|████████████████████████████████▋ | 1322/1455 [07:40<00:24, 5.43files/s]Failed to parse /Users/julio/HealthData/FitFiles/Activities/1650881606_ACTIVITY.fit: No conversion for units u 98%|███████████████████████████████████▍| 1430/1455 [08:27<00:07, 3.30files/s]Failed to parse /Users/julio/HealthData/FitFiles/Activities/1622925901_ACTIVITY.fit: No conversion for units u 99%|███████████████████████████████████▌| 1438/1455 [08:30<00:08, 2.07files/s]Failed to parse /Users/julio/HealthData/FitFiles/Activities/1687478240_ACTIVITY.fit: No conversion for units u

bugreport.txt

Cannot attach bugreport.zip and garmin.log because they're >25mb (max allowed by GitHub).

tcgoetz commented 2 months ago

Can you share 647637184_ACTIVITY.fit with me? Upload it to something like dropbox and share a link?

juliorl commented 2 months ago

Thank you for your patience, notification got lost.

Here are the files for the activity you mentioned: https://wormhole.app/a3aYj#EH_hRhpZGw98PKuj5lbx5A

Thank you for paying attention to this!

tcgoetz commented 2 months ago

Here are the files for the activity you mentioned: https://wormhole.app/a3aYj#EH_hRhpZGw98PKuj5lbx5A

Looks like that share link expires in 24 hours and I didn't get to it in time. Do you have somewhere you can share where it will persist longer?

juliorl commented 2 months ago

Sorry about that

Here's 1647637184_ACTIVITY.fit https://mega.nz/file/sMQhXDhS#gELbgDQK14HixFox7546op0n-uvHwwHckbzrDlQNzqI And here's bugreport.zip https://mega.nz/file/5Q5BGLoZ#h8VM1DA_w_0AZlLxM5etRnJLfl1uoF88hAwwUAeXSyk

tcgoetz commented 2 months ago

What can you tell me about this file? I can see that it was made by a ForeRunner 230, but where there additional sensors or a customer app involved?

Data [0]: DataMessage: <MessageType.file_id: 0>: {'serial_number': 3935269152, 'time_created': datetime.datetime(2017, 3, 30, 0, 33, 37, tzinfo=datetime.timezone.utc), 'product_name': '4294967295', 'manufacturer': <Manufacturer.Garmin: 1>, 'product': <GarminProduct.fr230: 2157>, 'number': None, 'type': <FileType.activity: 4>}

It has some fields that I'm not sure what to do with:

arsed record RecordHeader: Local definition message 14 (Compressed False) Definition [14]: DefinitionMessage: <MessageType.field_description: 206> 10 Little_Endian fields Record 29: consumed 1183 of 19376 <DisplayMeasure.statute: 1> Parsed record RecordHeader: Local data message 14 (Compressed False) Data [14]: DataMessage: <MessageType.field_description: 206>: {'field_name': 'distance', 'units': 'u', 'fit_base_unit_id': <UnknownEnumValue.UnknownEnumValue_65535: 65535>, 'native_message_num': 20, 'developer_data_index': 0, 'field_definition_number': 23.0, 'fit_base_type_id': 'float32', 'scale': None, 'offset': None, 'native_field_num': None} Parsed <MessageType.field_description: 206> Record 30: consumed 1274 of 19376 <DisplayMeasure.statute: 1> Parsed record RecordHeader: Local data message 14 (Compressed False) Data [14]: DataMessage: <MessageType.field_description: 206>: {'field_name': 'pace', 'units': 's/100u', 'fit_base_unit_id': <UnknownEnumValue.UnknownEnumValue_65535: 65535>, 'native_message_num': 20, 'developer_data_index': 0, 'field_definition_number': 1.0, 'fit_base_type_id': 'float32', 'scale': None, 'offset': None, 'native_field_num': None} Parsed <MessageType.field_description: 206> Record 31: consumed 1365 of 19376 <DisplayMeasure.statute: 1> Parsed record RecordHeader: Local data message 14 (Compressed False) Data [14]: DataMessage: <MessageType.field_description: 206>: {'field_name': 'distance', 'units': 'm', 'fit_base_unit_id': <UnknownEnumValue.UnknownEnumValue_65535: 65535>, 'native_message_num': 20, 'developer_data_index': 0, 'field_definition_number': 0.0, 'fit_base_type_id': 'float32', 'scale': None, 'offset': None, 'native_field_num': 5} Parsed <MessageType.field_description: 206> Record 32: consumed 1456 of 19376 <DisplayMeasure.statute: 1> Parsed record RecordHeader: Local data message 14 (Compressed False) Data [14]: DataMessage: <MessageType.field_description: 206>: {'field_name': 'Stroke Rate', 'units': 'spm', 'fit_base_unit_id': <UnknownEnumValue.UnknownEnumValue_65535: 65535>, 'native_message_num': 20, 'developer_data_index': 0, 'field_definition_number': 2.0, 'fit_base_type_id': 'uint16', 'scale': None, 'offset': None, 'native_field_num': 4} Parsed <MessageType.field_description: 206> Record 33: consumed 1547 of 19376 <DisplayMeasure.statute: 1> Parsed record RecordHeader: Local data message 14 (Compressed False) Data [14]: DataMessage: <MessageType.field_description: 206>: {'field_name': 'heading', 'units': 'rad', 'fit_base_unit_id': <UnknownEnumValue.UnknownEnumValue_65535: 65535>, 'native_message_num': 20, 'developer_data_index': 0, 'field_definition_number': 3.0, 'fit_base_type_id': 'float32', 'scale': None, 'offset': None, 'native_field_num': None} Parsed <MessageType.field_description: 206> Record 34: consumed 1638 of 19376 <DisplayMeasure.statute: 1> Parsed record RecordHeader: Local data message 14 (Compressed False) Data [14]: DataMessage: <MessageType.field_description: 206>: {'field_name': 'Free memory', 'units': 'bytes', 'fit_base_unit_id': <UnknownEnumValue.UnknownEnumValue_65535: 65535>, 'native_message_num': 20, 'developer_data_index': 0, 'field_definition_number': 29.0, 'fit_base_type_id': 'uint32', 'scale': None, 'offset': None, 'native_field_num': None} Parsed <MessageType.field_description: 206> Record 35: consumed 1729 of 19376 <DisplayMeasure.statute: 1> Parsed record RecordHeader: Local data message 14 (Compressed False) Data [14]: DataMessage: <MessageType.field_description: 206>: {'field_name': 'enhanced_speed', 'units': 'm/s', 'fit_base_unit_id': <UnknownEnumValue.UnknownEnumValue_65535: 65535>, 'native_message_num': 20, 'developer_data_index': 0, 'field_definition_number': 11.0, 'fit_base_type_id': 'float32', 'scale': None, 'offset': None, 'native_field_num': 73} Parsed <MessageType.field_description: 206> Record 36: consumed 1820 of 19376 <DisplayMeasure.statute: 1> Parsed record RecordHeader: Local data message 14 (Compressed False) Data [14]: DataMessage: <MessageType.field_description: 206>: {'field_name': 'Sample rate', 'units': 'c', 'fit_base_unit_id': <UnknownEnumValue.UnknownEnumValue_65535: 65535>, 'native_message_num': 20, 'developer_data_index': 0, 'field_definition_number': 18.0, 'fit_base_type_id': 'float32', 'scale': None, 'offset': None, 'native_field_num': None} Parsed <MessageType.field_description: 206> Record 37: consumed 1911 of 19376 <DisplayMeasure.statute: 1> Parsed record RecordHeader: Local data message 14 (Compressed False) Data [14]: DataMessage: <MessageType.field_description: 206>: {'field_name': 'speed', 'units': 'm/s', 'fit_base_unit_id': <UnknownEnumValue.UnknownEnumValue_65535: 65535>, 'native_message_num': 20, 'developer_data_index': 0, 'field_definition_number': 19.0, 'fit_base_type_id': 'float32', 'scale': None, 'offset': None, 'native_field_num': 6} Parsed <MessageType.field_description: 206>

In particular, note the first two fields. One with name "distance" and units "u". The second with name "pace" and units "s/100u".

juliorl commented 2 months ago

Kind of surprised that has odd fields. It was recorded with my very first Garmin watch, a long time ago already! No sensors involver, nor customer apps other than Garmin connect.