Skip to content

About

Use your smart trainer with Zwift (or MyWhoosh) and your Garmin at the same time, and keep Garmin Training Effect on indoor rides. ESP32 Bluetooth bridge for single-connection FTMS trainers like the Van Rysel D100: ERG in the app, power, speed and distance on the Garmin. Install from your browser.

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

20 Commits

Folders and files

Repository files navigation

TrainerBridge

Turn an ESP32 into a Bluetooth bridge that lets Zwift or MyWhoosh and your Garmin use the same smart trainer at the same time.

Many trainers accept only one Bluetooth connection at a time, so you pick: ERG mode in the app, or power and speed on your Garmin. TrainerBridge connects to the trainer once and re-publishes it as a new device that several apps and bike computers can pair with at once. Apps keep full control (ERG, simulation grade), and Garmin gets power, speed and distance without GPS or extra sensors.

The trainer connects once to TrainerBridge on an ESP32, which re-publishes it to Zwift for control and to a Garmin for power, speed and distance

Install it from your browser → No programming: an ESP32 board, a USB cable and Chrome or Edge.

CI License: GPL v3

Tested on a classic ESP32 DevKit with a Decathlon Van Rysel D100, a Garmin Forerunner 970, Zwift and MyWhoosh. Other Bluetooth FTMS trainers, Garmin Edge computers and FTMS apps should work but haven't been tried yet: see compatibility and tell us how it goes.

Why

Riding indoors with an app and a bike computer usually means compromises:

  • the trainer drops the Garmin as soon as Zwift connects, or the other way round
  • no speed or distance on the Garmin indoors, because there's no GPS and no wheel sensor
  • ride data split between the app and your Garmin history, and no Garmin Training Effect, Training Load or Training Status for indoor rides done in Zwift
  • a separate power meter or speed sensor just to record the ride twice

TrainerBridge sits in between and gives everyone what they need from one trainer connection.

What you get

Apps Zwift, MyWhoosh and other FTMS apps see a controllable trainer: ERG target power, simulation grade, start/stop, routed to the real trainer
Garmin Watches (and, untested, Edge computers) pair it as a Smart Trainer, or as separate Power and Speed sensors
Speed & distance Physics-based virtual speed on a flat road (CdA, rolling resistance, 85 kg rider + bike), with flywheel coasting so Garmin doesn't auto-pause
Multi-client App and Garmin connected together; each gets the same telemetry, and control responses go only to the client that sent the command
Recovery Trainer power-cycled? Clients get 0 W immediately, and the bridge keeps scanning and reconnects on its own
Status LED Blinks while searching, solid once the trainer is connected. No serial monitor needed
Diagnostics Serial console with live status, power calibration and manual ERG commands

Install

From your browser (easiest)

  1. Get a classic ESP32 DevKit board (ESP32-WROOM-32, often sold as "ESP32 DevKit V1", about 5–10 €) and a USB data cable. ESP32-S2, S3, C3 and C6 boards are not supported yet.
  2. Open antomanc.github.io/TrainerBridge in Chrome or Edge on a computer, plug in the board and click Install.
  3. Power the board from any USB charger near the trainer. That's it.

If the board isn't detected, install the USB driver for its chip (CP210x or CH340) and try another cable: many are charge-only.

From source

You need an ESP32 (the classic ESP32, e.g. a DevKit V1), a USB cable and Arduino CLI (or the Arduino IDE with ESP32 Arduino core 3.3.12 and NimBLE-Arduino 2.5.1).

git clone https://github.com/antomanc/TrainerBridge && cd TrainerBridge
make deps                          # install the pinned core and library (once)
make upload PORT=/dev/ttyUSB0      # build with all warnings and flash
make monitor                       # optional: serial console at 115200 baud

Use it

Turn on the trainer near the bridge. The LED blinks while the bridge looks for it and stays on once connected. The first time, the bridge picks the closest Bluetooth FTMS trainer (other TrainerBridges are ignored) and remembers it, so it never connects to a neighbour's trainer. To pick again (new trainer, wrong one), hold the BOOT button for 3 seconds: the LED blinks fast and the bridge searches again.

Then pair your devices with TrainerBridge-XXXX (the last four characters differ on every board):

Garmin Edge or watch: Settings > Sensors > Add Sensor > Smart Trainer, pick TrainerBridge-XXXX. You get power, speed and distance over one connection. If asked for a wheel size, use 2096 mm. (Alternatively, add it as a Speed/Cadence sensor and a Power sensor.)

Zwift, MyWhoosh: in the pairing screen, choose TrainerBridge-XXXX for both Controllable and Power Source.

Compatibility

What has actually been ridden. Tried another combination? Report it, whether it worked or not.

Trainer Bike computer / watch App Result
Van Rysel D100 Garmin Forerunner 970 Zwift ✅ Works
Van Rysel D100 Garmin Forerunner 970 MyWhoosh ✅ Works
Van Rysel D100 Garmin Edge (any) any ❔ Untested, should work
Other Bluetooth FTMS trainer any any ❔ Untested, should work

TrainerBridge is most useful with trainers that accept only one Bluetooth connection and have no ANT+, like the D100: without it, the app and your Garmin can't both connect. Trainers that speak only proprietary protocols (no FTMS) are not supported.

FAQ

How do I get Garmin Training Effect when I train with Zwift? Record the ride on your Garmin while Zwift controls the trainer. Training Effect, Training Load, Training Status and recovery time are computed by the watch or Edge during an activity it records itself; a ride that Zwift or MyWhoosh uploads to Garmin Connect doesn't give you the same on-device metrics. With TrainerBridge the Garmin records an Indoor Bike activity with real power, speed and distance while Zwift keeps ERG and simulation. Training Effect relies mostly on heart rate, so pair a heart rate strap (or use the watch's wrist sensor).

Can Zwift and my Garmin connect to the trainer at the same time? Only if the trainer accepts several connections, or has ANT+ for the Garmin. Many budget trainers (like the Decathlon Van Rysel D100) accept a single Bluetooth connection: whoever connects first wins. TrainerBridge takes that one connection and shares it with Zwift (or MyWhoosh, TrainerDay) and your Garmin.

My trainer has ANT+ FE-C. Do I need this? Probably not: pair the Garmin over ANT+ and Zwift over Bluetooth. TrainerBridge is for trainers that are Bluetooth-only and single-connection.

Can Garmin control the trainer instead of Zwift? Yes, pair it as a Smart Trainer: the Garmin can run its own workouts in ERG. Use one controller at a time; the bridge keeps the last client that set a target power in charge of ERG.

Will the ride appear twice in Garmin Connect? If Zwift also uploads to Garmin Connect, yes. Turn off the app's Garmin upload or delete one.

Is the speed on the Garmin the same as in Zwift? No. The bridge computes a flat-road speed from your power; Zwift uses its own course and gradient.

Garmin Edge pairs it only as a power meter, without speed. Add it as a Smart Trainer instead, which carries power, speed and distance. Follow #4 for Edge 1030 and epix Gen 2.

Configure

No configuration is needed. To change something, open the web page with the board plugged in by USB (Chrome or Edge), or use the serial console. Settings are saved on the ESP32 and survive reflashing the same firmware; reset erases them.

Key Default
trainer_mac learned Connect only to this trainer. Learned automatically the first time; forget or the BOOT button clears it
trainer_name empty Connect to the first trainer whose Bluetooth name contains this text (e.g. RYSEL), instead of the closest one
name TrainerBridge-XXXX Bluetooth name apps and Garmin see (max 20 characters)
power_scale 1.00 Multiply the trainer's watts, if it reads high or low (0.5 to 2.0)
mass_kg 85 Rider + bike, for the virtual speed
wheel_mm 2096 Wheel circumference: match the wheel size set on your Garmin (700x25c)
virtual_speed on Physics-based speed and distance
speed_sensor on Speed sensor service for Garmin

name, virtual_speed and speed_sensor apply after a reboot; the rest apply at once.

The factory defaults, and the advanced settings (CdA, rolling resistance, coasting, status LED pin, BOOT button, connection parameters), are in TrainerBridge/Config.h. A saved setting wins over Config.h. → How it works explains the model and the Bluetooth services.

Serial console

Open the serial port at 115200 baud (make monitor):

status                Connection, power, virtual speed, distance and control queue state
config                Saved settings, one key=value per line
set <key> <value>     Save a setting; an empty value restores the factory default
forget                Forget the trainer and pick the closest one again (= BOOT button)
reset                 Erase all saved settings and reboot
reboot                Restart the bridge
scale 1.05            Power calibration until reboot (testing)
p 200                 Send an ERG target of 200 W to the trainer (testing)
adv / noadv           Start or stop advertising to apps and Garmin

Design

  • One trainer connection, many clients. The ESP32 is the only device that talks to the trainer, so apps and Garmin never fight over it.
  • The trainer has the last word. ERG and simulation commands are queued, sent one at a time, and the app gets the trainer's real answer, not an optimistic one. Commands that time out or hit a disconnect fail right away instead of leaving the app waiting.
  • Answers go to whoever asked. Control responses are sent only to the client that sent the command, so the Garmin never sees an app's traffic (Garmin drops sensors that send unexpected indications).
  • Never blocks the Bluetooth stack. Writes to the trainer happen in the main loop, not in Bluetooth callbacks. State shared between the two is locked.
  • Fails safe. If the trainer disappears, every client sees 0 W immediately, not a frozen number.

Development

make test       # host tests: the real sketch against Arduino/NimBLE test doubles (g++ only)
make check      # tests with AddressSanitizer + UBSan, then the real firmware build

The host tests run the actual firmware code through scanning, reconnecting 20 times, two clients at once, and FTMS success, failure, timeout and late-response cases. They can't test the radio, so hardware changes still need a ride on a real trainer: → docs/testing.md. See CONTRIBUTING.md and CHANGELOG.md.

License

GPL-3.0 © 2026 Antonio Mancini

TrainerBridge is an independent project, not affiliated with or endorsed by Garmin, Decathlon, Van Rysel, Zwift, MyWhoosh or TrainerDay.

About

Use your smart trainer with Zwift (or MyWhoosh) and your Garmin at the same time, and keep Garmin Training Effect on indoor rides. ESP32 Bluetooth bridge for single-connection FTMS trainers like the Van Rysel D100: ERG in the app, power, speed and distance on the Garmin. Install from your browser.

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages