Coder Social home page Coder Social logo

Unable to enter date about garmindb HOT 12 CLOSED

tcgoetz avatar tcgoetz commented on July 17, 2024
Unable to enter date

from garmindb.

Comments (12)

tcgoetz avatar tcgoetz commented on July 17, 2024

Notice that there is no value after the '-d' in the command that make is executing. That's because that part of the Make target is "-d $(GC_DATE)". You have no variable GC_DATE. You set your date to the variable GC. you want to run:

make GC_DATE='01/01/2018' GC_DAYS=35 GC_USER=[email protected] GC_PASSWORD=gcpassword scrape_monitoring

from garmindb.

thebaldgeek avatar thebaldgeek commented on July 17, 2024

Sorry, my bad cut/paste, I have been including that, here is a example from today;

make GC_DATE='01/01/2018' GC_DAYS=35 GC_USER=[email protected] GC_PASSWORD=gcpassword scrape_monitoring
python scrape_garmin.py -d -n 35 -u [email protected] -p gcpassword -m "/home/pi/HealthData/FitFiles/Incoming"
Traceback (most recent call last):
File "scrape_garmin.py", line 297, in
main(sys.argv[1:])
File "scrape_garmin.py", line 225, in main
date = datetime.datetime.strptime(arg, "%m/%d/%Y").date()
File "/usr/lib/python2.7/_strptime.py", line 325, in _strptime
(data_string, format))
ValueError: time data '-n' does not match format '%m/%d/%Y'
Makefile:90: recipe for target 'scrape_monitoring' failed
make: *** [scrape_monitoring] Error 1

from garmindb.

tcgoetz avatar tcgoetz commented on July 17, 2024

Ok, so your getting that error because the command make actually runs:

python scrape_garmin.py -d -n 35 -u [email protected] -p gcpassword -m "/home/pi/HealthData/FitFiles/Incoming"

has no date after the '-d' so it is interpreting the '-n' as the date. Looking at the Makefile code, that command comes from:

scrape_monitoring: $(DB_DIR) $(MONITORING_FIT_FILES_DIR)
python scrape_garmin.py -d $(GC_MON_DATE) -n $(GC_DAYS) -u $(GC_USER) -p $(GC_PASSWORD) -m "$(MEW_MONITORING_FIT_FILES_DIR)"

and this is the problem: " -d $(GC_MON_DATE)". It's actually looking for GC_MON_DATE. I generalized the date to GC_DATE when I added more things that use date and didn't change that one. I commit a change to fix that tonight after work.

from garmindb.

thebaldgeek avatar thebaldgeek commented on July 17, 2024

Thanks for your update last night.
I am no longer getting the error about the date.
Here is the error today;

python scrape_garmin.py -d 01/21/2018 -n 35 -l /usr/bin/sqlite -u [email protected] -p gcpassword -m /home/pi/fit -w /home/pi/fit
Missing arguments:
scrape_garmin.py -d [ -n | -l ] -u -p [-m | -w ]
-d <date ex: 01/21/2018> -n fetch n days of monitoring data starting at date
-l check the garmin DB and find out what the most recent date is and fetch monitoring data from that date on
-m fetches the daily monitoring FIT files for each day specified, unzips them, and puts them in outdit
-w fetches the daily weight data for each day specified and puts them in the DB

I have tried many (many) different combinations of the suggested commands, (including putting quotes around the date - it makes no difference) but get the same error.
My path to sqlite is /usr/bin sqlite (and I have tried adding that with the -l option).

What arguments am I missing?

from garmindb.

tcgoetz avatar tcgoetz commented on July 17, 2024

You might want to wait for the weekend till I have a chance to finish some changes. I need to start working in a branch and leave the master branch stable now that someone else is using this.

Part of what your seeing is that '-l' doesn't take a parameter anymore since I started adding mysql support. The --sqlite option takes the path to the DBs, not to Sqlite itself. The Python code handles finding Sqlite. Also, the script does not currently support getting weight data and monitoring data in one run. Run it one time for each. So '-m' or '-w', but not both.

from garmindb.

thebaldgeek avatar thebaldgeek commented on July 17, 2024

I am not interested in weight data (I already have that from a script that pulls Nokia health and inserts into MySQL), so omitted that many times, but since the error was 'missing arguments' and it was one of the suggested arguments, I put it in to try it out.

Only too happy to wait. We are out of town all next week, so can't test it again till I get back (but we will be running with the Garmin while away).
Thank-you again for your assistance. These scripts are exactly what I have been wanting to do with the Garmin data, so am grateful for your help.

from garmindb.

tcgoetz avatar tcgoetz commented on July 17, 2024

Have you been able to make any progress?

from garmindb.

thebaldgeek avatar thebaldgeek commented on July 17, 2024

from garmindb.

tcgoetz avatar tcgoetz commented on July 17, 2024

I've made some more changes. It should say which argument is missing now.

from garmindb.

thebaldgeek avatar thebaldgeek commented on July 17, 2024

Unfortunately it is still reporting the same arguments as 'missing'.
python scrape_garmin.py -d '01/21/2018' -n 35 -l -u [email protected] -p gcpassword -m /home/pi/fit -w
Missing arguments:
scrape_garmin.py -d [ -n | -l ] -u -p [-m | -w ]
-d <date ex: 01/21/2018> -n fetch n days of monitoring data starting at date
-l check the garmin DB and find out what the most recent date is and fetch monitoring data from that date on
-m fetches the daily monitoring FIT files for each day specified, unzips them, and puts them in outdit
-w fetches the daily weight data for each day specified and puts them in the DB

from garmindb.

thebaldgeek avatar thebaldgeek commented on July 17, 2024

Trying on another Linux PC, I get the same Fit error as the other user;

opto@opto-touch:$ git clone git://github.com/tcgoetz/GarminDB.git
Cloning into 'GarminDB'...
remote: Counting objects: 729, done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 729 (delta 16), reused 23 (delta 7), pack-reused 688
Receiving objects: 100% (729/729), 994.61 KiB | 0 bytes/s, done.
Resolving deltas: 100% (482/482), done.
Checking connectivity... done.
opto@opto-touch:
$ cd GarminDB/
opto@opto-touch:~/GarminDB$ sudo make setup
git submodule init
Submodule 'Fit' (git://github.com/tcgoetz/Fit.git) registered for path 'Fit'
Submodule 'garmin-connect-export' (git://github.com/tcgoetz/garmin-connect-export.git) registered for path 'garmin-connect-export'
Submodule 'python-tcxparser' (git://github.com/tcgoetz/python-tcxparser.git) registered for path 'python-tcxparser'
git submodule update
Cloning into 'Fit'...
remote: Counting objects: 247, done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 247 (delta 12), reused 19 (delta 8), pack-reused 220
Receiving objects: 100% (247/247), 96.92 KiB | 0 bytes/s, done.
Resolving deltas: 100% (166/166), done.
Checking connectivity... done.
fatal: reference is not a tree: 5b58d4f5b7e59f859a69200fc51819ecc748d0ef
Cloning into 'garmin-connect-export'...
remote: Counting objects: 81, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 81 (delta 0), reused 1 (delta 0), pack-reused 78
Receiving objects: 100% (81/81), 43.80 KiB | 0 bytes/s, done.
Resolving deltas: 100% (35/35), done.
Checking connectivity... done.
Submodule path 'garmin-connect-export': checked out '87f0d101000e90ad590ddb526544138f704833b9'
Cloning into 'python-tcxparser'...
remote: Counting objects: 170, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 170 (delta 4), reused 7 (delta 2), pack-reused 161
Receiving objects: 100% (170/170), 446.56 KiB | 0 bytes/s, done.
Resolving deltas: 100% (94/94), done.
Checking connectivity... done.
Submodule path 'python-tcxparser': checked out '443862e5563ec3e5da4ed021caac50f1b03f516e'
Unable to checkout '5b58d4f5b7e59f859a69200fc51819ecc748d0ef' in submodule path 'Fit'
Makefile:56: recipe for target 'submodules_update' failed
make: *** [submodules_update] Error 1

from garmindb.

tcgoetz avatar tcgoetz commented on July 17, 2024

Should be fixed now. A commit wasn't pushed up to github in the Fit repo.

from garmindb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.