BLE Sync Cycle is a Go application designed to synchronize video playback with real-time cycling data from Bluetooth Low Energy (BLE) devices, such as cycling speed and cadence (CSC) sensors. This integration provides users with a more immersive indoor cycling experience by matching video playback speed with their actual cycling pace, making it a great option when outdoor cycling isn't feasible.
-
Real-time synchronization of cycling speed and video playback
-
Supports compliant BLE Cycling Speed and Cadence (CSC) sensors (in speed mode)
-
Highly configurable TOML-based config file for:
- BLE sensor address (BD_ADDR) and scan timeout
- Wheel circumference (for accurate speed)
- Speed units (mph or km/h)
- Speed smoothing for natural playback
- Video file selection
- Display options:
- On-screen display (OSD) for speed and time remaining
- Video window scaling (fullscreen, etc.)
- OSD position and font size
-
Command-line interface for real-time application status
-
CLI flags to override settings:
- Configuration file path (allows for multiple profiles)
- Video start time (seek)
- Help/usage information
-
Configurable log levels (debug, info, warn, error)
-
On every application startup, the battery level of the BLE sensor is checked and displayed
-
Graceful handling of connection interrupts and system signals for a clean shutdown
This project was developed to address a specific need: how can I continue cycling when the weather outside is less than ideal?
While there are several existing solutions that allow for "virtual" indoor cycling, such as Zwift and Rouvy, these typically require the purchase of specialized training equipment (often preventing the use of your own bike), a subscription to compatible online virtual cycling services, and a reliable broadband Internet connection.
My needs are different:
- I want to train using my own bicycle. Since I prefer riding recumbents, it wouldn’t make sense for me to train on a traditional upright trainer
- I need a solution that can function with minimal dependencies and without requiring an Internet connection, as I live in a rural part of the Pacific Northwest where both electrical and Internet services are unreliable
Check out my Watchfile Remote [Rust Edition] project for an example of how I handle our regular loss of Internet service here in the woods of the Pacific Northwest
- Finally (and importantly), I want flexibility in the solutions and components that I use, as I typically like to tweak the systems I work with. Call me crazy, but I suspect it's my nature as an engineer to tinker...
Since I already use an analog bicycle trainer while riding indoors, it made sense for me to find a way to pair my existing Bluetooth cycling sensors with a local computer which could then drive some kind of interesting feedback while cycling. This project was created to fit that need.
For more information about BLE Sync Cycle, check out the BLE Sync Cycle project wiki. The wiki includes the following sections:
-
BLE Sync Cycle
- Home
- Features
- Rationale
-
Requirements
- Hardware
- Software
-
Installation
- Application Dependencies
- Building the Application
- Editing the TOML File
- The [app] Section
- The [ble] Section
- The [speed] Section
- The [video] Section
- The [video.OSD] Section
-
Basic Usage
- Overview
- Running the Application
- Using the Command Line Options
- Setting the Configuration File Path
- Seeking to a Specific Time in the Video
- Displaying Help in BLE Sync Cycle
-
FAQ
-
Roadmap
-
Acknowledgements
-
License
Enjoy!