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.11k stars 137 forks source link

Failed to translate device info #26

Closed gabefortin closed 5 years ago

gabefortin commented 5 years ago

Any ideas on the below error?

Failed to parse /Users/Gabe/HealthData/FitFiles/Activities/3228757138.fit: Failed to translate device_info Traceback (most recent call last): File "garmin.py", line 289, in main(sys.argv[1:]) File "garmin.py", line 282, in main import_data(debug, test, latest, weight, monitoring, sleep, rhr, activities) File "garmin.py", line 173, in import_data gfd.process_files(db_params_dict) File "/Volumes/MainExternal/Gabe/OneDrive/Coding/GarminDB/import_garmin_activities.py", line 48, in process_files fp.write_file(Fit.File(file_name, self.english_units)) File "/Volumes/MainExternal/Gabe/OneDrive/Coding/GarminDB/FitFileProcessor.py", line 64, in write_file self.write_message_types(fit_file, fit_file.message_types()) File "/Volumes/MainExternal/Gabe/OneDrive/Coding/GarminDB/FitFileProcessor.py", line 50, in write_message_types self.write_message_type(fit_file, message_type) File "/Volumes/MainExternal/Gabe/OneDrive/Coding/GarminDB/FitFileProcessor.py", line 40, in write_message_type function(fit_file, message_type, messages) File "/Volumes/MainExternal/Gabe/OneDrive/Coding/GarminDB/FitFileProcessor.py", line 32, in write_generic function(fit_file, message) File "/Volumes/MainExternal/Gabe/OneDrive/Coding/GarminDB/FitFileProcessor.py", line 386, in write_device_info_entry raise ValueError('Failed to translate device_info') ValueError: Failed to translate device_info make: *** [update_garmin] Error 1

tcgoetz commented 5 years ago

There should be another log line just before that fits this format:

logger.warning("device_info: %s - %s", repr(parsed_message), str(e))

It should contain the original error. Any chance you can upload 3228757138.fit to a file sharing site like Dropbox and share it with me? That would be the fastest way for me to fix. Most likely issue is that your device has some internal sensor that are not listed in: https://github.com/tcgoetz/Fit/blob/master/FieldEnums.py

gabefortin commented 5 years ago

Here is the fit file in question: https://1drv.ms/u/s!AkpM1sjcEL_xhshgoxTS5fOF_jau5A

I don’t see a logger.warning line in the output. Here’s everything from before what I sent in the other message:

python garmin.py --all --download --import --analyze --latest Geting activities: '/Users/Gabe/HealthData/FitFiles/Activities' (100) 100% (100 of 100) |###############################################################################################################################################################| Elapsed Time: 0:00:00 Time: 0:00:00 unzip_files: /Users/Gabe/HealthData/FitFiles/Activities Automatically downloading monitoring data from: 2019-05-20 07:59:59 Automatically downloading sleep data from: 2017-03-20 Geting sleep: 2017-03-20 (791) 100% (792 of 792) |###############################################################################################################################################################| Elapsed Time: 0:20:25 Time: 0:20:25 Automatically downloading weight data from: 2016-02-10 Geting weight: 2016-02-10 (1195) 100% (1196 of 1196) |#############################################################################################################################################################| Elapsed Time: 0:27:32 Time: 0:27:32 Automatically downloading rhr data from: 2016-03-21 Geting rhr: 2016-03-21 (1155) 100% (1156 of 1156) |#############################################################################################################################################################| Elapsed Time: 0:27:09 Time: 0:27:09 Processing profile data 100% (1 of 1) |###################################################################################################################################################################| Elapsed Time: 0:00:00 Time: 0:00:00 Processing weight data 100% (1243 of 1243) |#############################################################################################################################################################| Elapsed Time: 0:00:22 Time: 0:00:22 Processing daily summary data Processing daily extra data Processing daily FIT data 100% (7993 of 7993) |#############################################################################################################################################################| Elapsed Time: 0:16:58 Time: 0:16:58 Processing sleep data 100% (1243 of 1243) |#############################################################################################################################################################| Elapsed Time: 0:05:12 Time: 0:05:12 Processing rhr data 100% (1243 of 1243) |#############################################################################################################################################################| Elapsed Time: 0:00:12 Time: 0:00:12 100% (1000 of 1000) |#############################################################################################################################################################| Elapsed Time: 0:00:21 Time: 0:00:21 100% (1000 of 1000) |#############################################################################################################################################################| Elapsed Time: 0:00:19 Time: 0:00:19 0% (2 of 1000) |

On May 20, 2019, at 12:51 PM, Tom Goetz notifications@github.com wrote:

There should be another log line just before that fits this format:

logger.warning("device_info: %s - %s", repr(parsed_message), str(e))

It should contain the original error. Any chance you can upload 3228757138.fit to a file sharing site like Dropbox and share it with me? That would be the fastest way for me to fix. Most likely issue is that your device has some internal sensor that are not listed in: https://github.com/tcgoetz/Fit/blob/master/FieldEnums.py https://github.com/tcgoetz/Fit/blob/master/FieldEnums.py — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tcgoetz/GarminDB/issues/26?email_source=notifications&email_token=ADEPV56VSJBLTOMGMGFZKYDPWL6KVA5CNFSM4HOE3NVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVZ4L5I#issuecomment-494126581, or mute the thread https://github.com/notifications/unsubscribe-auth/ADEPV5Y4BOUC6E2LLNOB66LPWL6KVANCNFSM4HOE3NVA.

tcgoetz commented 5 years ago

What can you tell me about this device:

Writing Device: {'product': <UnknownProduct.UnknownProduct_2: 2>, 'device_index': 2, 'cum_operating_time': datetime.time(0, 0, 0, 62), 'software_version': '0.00', 'timestamp': datetime.datetime(2018, 12, 15, 19, 9, 9), 'manufacturer': <Manufacturer.scosche: 83>, 'battery_voltage': None, 'ant_related': 8157, 'hardware_version': 5, 'unknown_8': None, 'unknown_9': 95, 'source_type': <SourceType.antplus: 1>, 'ant_device_number': 25138, 'battery_status': None, 'ant_transmission_type': 225, 'serial_number': 2882363954, 'device_type': <AntplusDeviceType.heart_rate: 120>, 'unknown_23': None, 'unknown_16': 458, 'ant_network': <AntNetwork.antplus: 1>} - {'serial_number': 2882363954, 'product': 'UnknownProduct_2', 'manufacturer': <Manufacturer.scosche: 83>, 'hardware_version': 5, 'timestamp': datetime.datetime(2018, 12, 15, 19, 9, 9)}

Looks like a heart rate monitor manufactured by a company named scosche.

gabefortin commented 5 years ago

ha, that would make sense, that's a heart rate monitor I use from time to time. SCOSCHE RHYTHM+ BLE/ANT+ ARMBAND HRM (https://www.mec.ca/en/product/5042-057/Rhythm%2B-BLE-ANT%2B-Armband-HRM) that's the exact model.

gabefortin commented 5 years ago

That did it, thanks again!