Suffice
Suffice is a terminal-based tool for controlling a cycling trainer, so you can pound pedals while peddling code.
Goals
- modes: ERG, Level, maybe Sim if I'm feeling spicy
- run as a daemon, see status of the trainer in starship
- record FIT (or similar) files to prove your sweat
Non Goals
- a persistent UI, HUD, etc.
- non-cycling machines
Roadmap
v1 Features
- properly wrap the Trainer in an Arc and handle notifications in a thread
- basic REPL controls
- capture basic sensor data: power, speed, cadence
- and display it usefully
- make sure ERG and Level mode seem to work
- record sessions in FIT files
- add screenshots/screencasts
- implement daemon mode
- starship integration
- faked distance data (what algorithm does other software use?)
- proper cli args
- help
- verbose/quiet mode
- connect-test option
- bling
- make gauges for resist/power level
- show a basic graph of stats
- animations / exhortations
v2+ Features
- other connection types: ANT+ / WiFi
- workouts
- Sim mode
DevEx
- tests and measuring test coverage
- CI checks
- crates.io publication
- tokio tracing logs
- better error handling generally instead of reckless unwraps everywhere
- github branch protection
- docstrings etc.
Bugs
- sometimes the FIT file has more than one session -- why?
- sometimes the trainer stops sending data back
- rapid commands only slowly take effect (because we only loop events every 1s)
Resources Used
- the official FTMS spec
- relevant prior art in python: pycycling the underlying BLE library bleak and some useful info about the trainer I was developing against
- examples from the key rust BLE library btleplug
- the tokio examples -- quite useful in the many false starts at working out how to deal with the fundamentally async nature of the system
- not directly relevant, but a fascinating blog post on creating a FTMS
- making sense of tokio + ratatui
- verifying that the fit files were produced correctly