This project addresses the issue of the malfunctioning barometric sensor in Garmin Fenix devices, causing inaccurate elevation data to be displayed (it's a widespread issue in the Garmin Fenix 3 range). By leveraging Strava's correction feature for elevation data, the project aims to provide a solution to this problem (as you can see in this example, many people have the same issue as me with older activities).
How it Works (Strava Documentation)
Strava's elevation correction process involves cross-referencing GPS data with their database of barometric data to ensure accurate elevation readings. Elevation data on Strava is smoothed and thresholds are set to maintain accuracy, particularly for activities recorded on devices without a barometric altimeter.
The program automates the process of correcting elevation data on Strava for activities recorded with Garmin Fenix devices experiencing barometric sensor issues. It follows a set of steps outlined below:
1. Create a Strava API using the provided guide.
2. Fill in the required credentials (CLIENT_ID, SECRET_KEY, USER, PASSWORD) in a .env file.
3. Setup virtual environment
- Linux:
python3 -m venv .venv
source .venv/bin/activate
- Windows:
python -m venv .venv
.venv\Scripts\activate
4. Install the project dependencies using PIP
pip install -r .\requirements.txt
The following steps are automated when running the program:
python ./main.py
1. Obtain an access token to make API requests to Strava.
2. Fetch activity IDs for running and cycling activities with 0 meters of elevation gain.
3. Utilize Selenium to automate the elevation correction process on Strava by logging in, navigating to the activity URLs, and initiating the correction process.
Additionally, it's worth mentioning that the program automatically handles token management. The access token, refresh token and expiration date are stored in the .env
file. Upon subsequent use, the program will automatically retrieve the token, check for expiration, and generate a new one if necessary.
- Example of some running activities with elevation (corrected by Strava) and others with 0 meters of elevation that need to be corrected with the program
- Example of an activity recorded by Garmin Fenix with 0 meters of elevation gain, requiring correction using Strava options.
- This is the menu options of each activity where various parameters can be edited, including the one we need, 'correct elevation'.
- When we click on the 'correct elevation' button, a popup window appears where we confirm the operation.
- And this is the final result, an activity whose elevation has been corrected using Strava's databases.
By automating the elevation correction process on Strava, users can ensure accurate elevation data for their activities, mitigating the impact of barometric sensor issues in Garmin Fenix devices. The project provides a practical solution for maintaining the integrity of elevation data in fitness tracking and analysis.
- Test activity fetcher
- Test filter activities
- Test credentials
- Test extract code
- Test request credentials
- Test get access token
- Test refresh token
- Test summary
- Test strava activities
- Test login strava
- Test get oauth code
- Test get latest activities
[ ] CI/CD Github Actions (launch Chrome browser) to correct elevation and running tests.