MauroDruwel / Node-RED-Cowboybike-Strava-sync

This project will collect your cycling activities from Cowboy and will automatically upload them to Strava.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Node-RED Cowboybike Strava sync

First of all a big thanks to Samuel Dumont who gave me a start for this project.

Setup

The first step is to create a folder where you will store all your files.

  • On Linux it will look something like this /home/pi/CowboyMauro/
  • On Windows it will look something like this C:\Users\mauro\Documents\CowboyMauro\

After you created this folder, download all the files and extract them in here.

image

(You can delete the README.md)

Cowboy Part

In the Cowboy-Info.json file write down your Cowboy email and password.

Strava Part

Create a Strava application. This is how you do it:

Create.Strava.Application.mp4

In the Strava-Info.json file write down your Strava client_id and your client_secret from the application you just created.

Open your browser and go to this URL: https://www.strava.com/oauth/authorize?client_id=YOURCLIENTID&redirect_uri=http://localhost&response_type=code&approval_prompt=auto&scope=activity:write,read

DONT FORGET TO CHANGE THE CLIENT ID

Click Authorize.

image

Copy YOUR code in the search balk

image

Open Postman, create a post request to https://www.strava.com/api/v3/oauth/token with these params:

Key Value
client_id ReplaceWithYourClientID
client_secret ReplaceWithYourClientSecret
code ReplaceWithYourCode
grant_type authorization_code

image

Click the big blue SEND button.

Click Save Response, Save to a file:

Postman

Put it in your folder as Strava-Token.json

Python Part

Make sure that you have Python 3 installed.

Also make sure that these libraries are installed:

  • Lxml
  • Python_dateutil
  • Requests

Last but not least, the Node-RED Part

To import the Node-RED files, you just do this:

2022-04-02.17-24-05.mp4

All you need to do now is for every block that says: CHANGE FILE LOCATION, open that block and change /home/pi/CowboyMauro to the path from the folder that you created at the beginning from this manual.

Screenshots

Screenshot_20220402-192420_Strava

image

About

This project will collect your cycling activities from Cowboy and will automatically upload them to Strava.


Languages

Language:Python 100.0%