hn.today

Show HN: Fun with bicycle trainers and web APIs

joelriley.com7 points3 comments
Screenshot of Show HN: Fun with bicycle trainers and web APIs

A casual cyclist frustrated by Zwift’s $20 monthly fee explores whether a browser-based project can make indoor riding more engaging without a subscription. The approach combines a Wahoo Kickr Core smart trainer with the Web Bluetooth API, which can read data from devices that follow the Cycling Power Service standard. The accompanying TypeScript example connects to the trainer, parses its power and wheel-revolution measurements, and calculates speed and distance using wheel circumference and the elapsed time between readings. It accounts for optional data fields, stopped-wheel readings, timer rollover, and possible trainer resets.

The resulting proof of concept, YouTube Hamster Wheel, uses cycling speed to control YouTube playback: pedaling faster speeds up the video, while slowing down makes it play in slow motion. The creator finds the simple mechanic effective for short 15-20-minute workouts, turning videos into a reason to keep riding. The main drawback is browser compatibility: Web Bluetooth works only in Chromium-based browsers, excluding Safari and Firefox and making iPads unsuitable. The creator runs the setup on a Samsung Galaxy Tab S7+ and mirrors its display to a monitor. The app has been tested only with an older Wahoo Kickr Core, so compatibility with other trainers is uncertain.

Read on joelriley.com3 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Web

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.