GarminDB
GarminDB copied to clipboard
Error running garmin.py --analyze
System: Debian 10 I don't have a GarminConnect account and want to use the device FIT files only.
- I git-cloned the repository,
- did "make setup",
- used the example json config
- and put my FIT files into ~/HealthData/FitFiles/ directory.
- Since "make" stops because the credentials for GarminConnect login are wrong, "./garmin.py --all --import" fills the DBs,
- but "./garmin.py --analyze" fails with the following error:
fl6@localhost:~/projects/GarminDB$ python3 garmin.py --analyze Analyzing Data Traceback (most recent call last): File "garmin.py", line 341, in
main(sys.argv[1:]) File "garmin.py", line 328, in main analyze_data(args.trace) File "garmin.py", line 235, in analyze_data analyze = Analyze(db_params_dict, debug - 1) File "/home/fl6/projects/GarminDB/analyze_garmin.py", line 38, in init self.unit_strings = Fit.units.unit_strings[self.measurement_system] TypeError: hash method should return an integer
I reproduced the same error with the above steps in a fresh installed virtualbox Ubuntu environment.
Sorry for the slow response. I've been otherwise occupied.
The problem is that your DB does not have an entry in the Attributes table for measurement_system. Those entries come from device messages currently. Not all Fit files have device messages. I will enhance the code to also set the measurement_system attribute from the user_profile message.
Can you try with the develop branch and see if it fixes you issue?
Thanks for the response,
i got the same error with the fix, but after playing around a bit, I found out that apparently
placing the FIT files in the HealthData/FitFiles dir is not sufficient.
I did ./garmin.py --import --all --copy
with the GARMIN dir in GarminConnectConfig.json . I got FileNotFoundError for the GARMIN/garmin/settings directory, the query seems to be case sensitive, since my Forerunner 30 files/directories are all in capitals. I changed SETTINGS, ACTIVITY and MONITOR to lower case and added 'sleep' directory and --copy command was successful. After that --analyze runs without error.
The capitalization is not consistent between watches. I will think about a solution.