GarminDB icon indicating copy to clipboard operation
GarminDB copied to clipboard

Error running garmin.py --analyze

Open FL6 opened this issue 4 years ago • 4 comments

System: Debian 10 I don't have a GarminConnect account and want to use the device FIT files only.

  1. I git-cloned the repository,
  2. did "make setup",
  3. used the example json config
  4. and put my FIT files into ~/HealthData/FitFiles/ directory.
  5. Since "make" stops because the credentials for GarminConnect login are wrong, "./garmin.py --all --import" fills the DBs,
  6. 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.

FL6 avatar Apr 01 '20 11:04 FL6

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.

tcgoetz avatar Apr 12 '20 16:04 tcgoetz

Can you try with the develop branch and see if it fixes you issue?

tcgoetz avatar Apr 13 '20 17:04 tcgoetz

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.

FL6 avatar Apr 15 '20 06:04 FL6

The capitalization is not consistent between watches. I will think about a solution.

tcgoetz avatar Apr 17 '20 20:04 tcgoetz