Live heart rate for remote training
A Fitbit band streams my heart rate, and my online trainer sees zones and points live, Orangetheory style.
// 0x2A37: bit 0 says how wide the reading is
const flags = view.getUint8(0);
const bpm = flags & 0x01
? view.getUint16(1, true)
: view.getUint8(1);
channel.send({
type: "broadcast",
event: "hr",
payload: { seq: ++seq, bpm },
});From a wristband to a remote screen
Bluetooth in the browser
Reads the standard heart-rate characteristic, 0x2A37, straight from the band.
A two-way realtime protocol
hr, ack, plan, hello and ended events; echoed sequence numbers measure round trips.
One writer
Only the athlete page writes: 10 s batches with retry and idempotent upserts.
Tested end to end
A test drives both pages with a fake band over the DevTools Protocol.