dundring icon indicating copy to clipboard operation
dundring copied to clipboard

Support for Tacx Neo Bike i.e. FE-C over Bluetooth support

Open divyenduz opened this issue 2 years ago • 2 comments

Here are all my notes on this issue so far, the support for the bike I use is currently only partial, when I connect it via bluetooth, I see this warning message

CleanShot 2022-12-17 at 21 59 59@2x

Besides this, the following observations about dundring dashboard vs the built-in screen on the bike

IMG_0933

Metric Dundring Bike Screen Notes
Heart rate 138 138 ✅ Dundring connected to the sensor via bluetooth, bike automatically picks ANT+ signals. Same sensor, same data, all good.
Wattage 4 watt 4 watt ✅ They are usually off a bit but mostly the same. I think dundring reads this from the device.
Speed 4.4 km/hr 17.8 km/hr ⚠️ This is not a problem, the speeds are usually similar w/ dundring lagging a bit to reflect (so the big difference here is irrelevant). What I am curious about is why aren't they same? Can we just use the emitted speed from the device?
Cadence/rpm 0 rpm 0 rpm ❌ The image is misleading, I probably stopped paddling to take a picture. The bike screen shows RPM while dundring doesn't, it is probably not reading it from my bike.

So why doesn't it work? (snippets copied from code, might be outdated when you read this)

  • Dundring needs cycling_power (wattage) service and optionally fitness_machine (FTMS, controlling bike resistance) service
const device = await navigator.bluetooth
      .requestDevice({
        filters: [{ services: ['cycling_power'] }],
        optionalServices: ['fitness_machine'],
      })

Tacx actually does support FTMS on all their non-NEO series just fine, but doesn’t do FTMS on the NEO series due to FTMS’s lack of ability to transmit weight information to apps (which is needed for the virtual flywheel in this specific trainer series).

  • Tacx does Ant+ FE-C over bluetooth i.e. it uses bluetooth for transport but transfers FE-C protocol data (questions: how does bluetooth request this device, what service to use? (probably fec uuid directly))

  • Noting the screenshot above, I think we can use requesting cadence also https://www.bluetooth.com/specifications/specs/cycling-speed-and-cadence-service-1-0/

Next steps (for me), play around with web bluetooth a bit with a simpler device and eventually implement control support for Tacx Neo Bike 🎉

Resources

  • Bluetooth fitness machine service (FTMS) https://www.bluetooth.com/specifications/specs/fitness-machine-service-1-0/
  • CABLE FE-C to FTMS https://www.smartbiketrainers.com/cable-releases-a-new-firmware-update-and-support-for-fe-c-to-ftms-5046
  • https://www.dcrainmaker.com/2016/07/everything-you-ever-wanted-to-know-about-ant-fe-c-and-bike-trainers.html
  • https://www.thisisant.com/developer/ant-plus/device-profiles#525_tab
  • https://www.bluetooth.com/specifications/assigned-numbers/ (useful to find service UUIDs)
  • https://developer.chrome.com/articles/bluetooth/
  • https://developer.garmin.com/tacx-trainer/overview/
  • https://github.com/abellono/tacx-ios-bluetooth-example
  • https://github.com/topics/tacx

divyenduz avatar Dec 17 '22 21:12 divyenduz

Awesome work! 🙌 We obviously have a lot to fix, and your notes will be essential in that process!

Most of the core developers have been using Wahoo smart trainers, which would explain the lacking support for other brands at the moment 🙈 Very interesting that they use the Ant+ FE-C protocol over Bluetooth – I had no idea!

It appears that now is the time for a review and improvement of the bluetooth-parts of the code – I'll try to prioritize it during the holidays ❄️

As always, feel free to reach out to me over at Slack if you want to discuss or even rubber duck 🦆

sivertschou avatar Dec 19 '22 17:12 sivertschou

I can probably explain the speed difference.

Regarding the picture, the reason the difference is so huge (17.8 km/h vs 4.4 km/h) is probably because the speed on your device is more realistic in terms of speed decrease over time. Dundring's speed estimate is just based on the current power (4W) and therefore instantly decreases to a low speed. The device probably decreases more gradually over time, like in the real world.

For the normal differences between the two, it is probably because the speed estimate from the device is just a bit different from the speed estimate used in dundring (which is based upon https://www.omnicalculator.com/sports/cycling-wattage). The estimate implementation in dundring can be found here : https://github.com/sivertschou/dundring/pull/147

Regarding using the emitted speed from the device, I am not sure. I guess it is nice that they are in sync, but there is also some possible issues regarding "fairness" when comparing speeds across devices. We will take it into consideration.

Hope that kinda made sense and thanks for the great and detailed feedback 🎉

morteako avatar Dec 20 '22 17:12 morteako