Show HN: Fun with bicycle trainers and web APIs joelriley.com · 4 points · 0 com...

@show

Show HN: Fun with bicycle trainers and web APIs joelriley.com · 4 points · 0 comments · HN thread

TL;DR Joel Riley built a web app that reads speed from a Wahoo Kickr Core smart trainer over Bluetooth using the Web Bluetooth API, and uses that speed to set YouTube playback rate, so pedaling faster plays the video faster. The article walks through the Cycling Power Service parsing code and presents it as a free alternative to paid apps like Zwift. The story has 4 points and no comments yet.

  • Zwift requires a $20/month subscription, which the author finds steep for occasional indoor rides.
  • The Wahoo Kickr Core follows the Bluetooth Cycling Power Service, so a browser can read power and wheel revolution data from it.
  • The article gives TypeScript code that computes speed and distance from wheel revolutions and 1/2048-second event times, assuming a 2.105 m wheel circumference for a 700x25c tire.
  • YouTube Hamster Wheel plays video slowly when pedaling is slow and speeds it up when the rider exceeds the target speed.
  • Web Bluetooth only works in Chromium-based browsers, so Safari and Firefox are excluded and iPads cannot be used.
  • The author has only tested with an older Kickr Core and makes no claims about other trainers.

Links in the post

  • YouTube Hamster Wheel: The web app itself: it plays YouTube videos at a speed set by the rider's pedaling speed from a connected trainer, with data kept in the browser.

Discussion The thread has no comments yet, so there is no community discussion to summarize.

#webBluetooth #cycling #smartTrainer #webDev #showHN