The goal of this project is to automatically download all activities from your Garmin Forerunner 305 the moment you connect it via USB to your computer. After all activities have been downloaded, it will convert all new runs to a TCX format (instead of the binary gmn format created by the garmin-forerunner-tools) and any new TCX file that is created is automatically uploaded to your Strava account (if you have provided a strava key with write-access).
Because the script has been modified to work directly with Docker, communication about the destination directory and the Strava API key are communicated with the script via the following two environment variables:
- GARMIN_DATA_DIR: Under this directory, all gmn files and tcx will be stored.
- STRAVA_KEY: Provide the script with your Strava API key. Details about how to set this up will be added to this Readme
As I recently got started playing around with Docker, I decided that after the script was finished I was going to make it my first Docker project also!
You can run the docker container as follows:
docker run --privileged \ -v /dev/bus/usb:/dev/bus/usb \ -v ~/.garmin-strava-uploader:/data \ -i \ -e STRAVA_KEY='<FILL IN YOUR STRAVA API KEY>' \ -e GARMIN_DATA_DIR='/data' \ -t gdiepen/garmin-strava-uploader
Please note that I am still working on learning about docker and have not yet figured out all the details about the data containers/volumes. At the moment I map the /data directory in the container to the host directory ~/.garmin-strava-uploader by using an additional volume mapping:
Note that you need to map the host /dev/bus/usb directory to the container and allow the container to access the devices by using the privileged argument
Strava API Key
In order for any application to upload the activity details, you will need to create an app as a developer and get the OAuth2 key for this. How to get this key is a set of steps you need to follow. It is explained if you search on google, but not always in the clearest way. I will update this README to contain the instructions for this in the future