Bike trainer software with ANT+ power and heartrate sensor logging.
This is a simple indoor bicycle training application, similar to a very stripped-down version of TrainerRoad or Zwift with the following features:
Installation is still a bit janky due to a number of dependencies. For now, this should work, but YMMV
pip install msgpack
- this shouldn’t be required, but for some reason python setuptools chokes on it.libusb
. Note that on MacOS Catalina, I’ve found that only the Homebrew version works (the ones on pip and Macports do not work). If you have Homebrew installed, run brew install libusb
.python setup.py install
. This should install all the other dependencies needed.python src/pmtrainer/pm_trainer.py
Each user is expected to set up their own Strava API client, so there are a few annoying steps required to use the Strava integration feature:
Client ID
and the Client Secret
from the page after you’ve registered your API.If you have an ANT+ dongle connected when PM Trainer is launched, it will automatically select the first heartrate monitor and power meter that it sees. Note that this could cause issues if you have more than one of these active (e.g., if there are two people wearing heartrate monitors in range, it’s uncertain which one will be picked up by PM Trainer). This will be fixed someday by Issue #10.
PM Trainer hasn’t been tested with many different dongles or sensors, but here are ones it is known to work with:
Dongles:
Sensors:
Currently cadence sensors and erg-mode trainers are not supported, although it would be fairly easy to add support for them if needed.
Creating a new workout is as simple as creating a YAML file in the workouts folder. The format of this file is:
name: <workout name goes here>
description: <brief description of the workout>
duration_s: <duration in seconds>
blocks:
- duration: <duration as fraction of total workout>
start: <desired power at the beginning of the block as a fraction of FTP>
end: <desired power at the beginning of the block as a fraction of FTP>
- ... more blocks...
Each “block” element defines a segment of the workout with either constant power, or a power ramp. If the start
and end
values are the same, desired power will be constant. Conversely, if these values are different, desired power will either increase or decrease across the segment. There are a few sample workouts in the workouts folder. Note that the sum of the duration
values across all blocks must be 1.0, or the workout will be rejected.
Once you’ve created the workout in this folder, launch PM Trainer and the workout will now show up in the workout selection dialog under Settings: