Skip to content

Remember sensors and reconnect them at launch - #79

Merged
pepperstm merged 1 commit into
mainfrom
feature/remember-sensors
Nov 12, 2026
Merged

pepperstm merged 1 commit into
mainfrom
feature/remember-sensors

Conversation

@pepperstm

Copy link
Copy Markdown
Owner

What and why

Sensors weren't remembered between launches, so every time the app opened you had to search for the trainer and heart-rate strap and connect them again.

  • Bluetooth sensors are remembered once connected, in the store as devices. At launch the app looks for them for three minutes and connects each one as it's heard. It also looks again when the Devices page or ride setup opens, so a trainer switched on later still connects.
  • The Devices page shows the sensors it's looking for, with Forget on each one. Remove on a connected sensor forgets it too.
  • ANT+: the stick is turned on again at launch if it was on. ANT+ pairs whichever sensors are near rather than particular ones, so there's no list to keep.
  • The search for remembered sensors and the "Add Bluetooth device…" search share the radio without stopping each other's scan.
  • README: describes this, and it's off the roadmap.

Checked

  • npm run check passes, with a new test for remembering and forgetting sensors.
  • Tested with real sensors: they reconnected by themselves after quitting and reopening the app, and a removed one stayed disconnected.
  • Checked the Devices page notice in a live preview in demo mode.

Bluetooth sensors are remembered once connected. At launch the app looks for
them for three minutes and connects each one as it wakes, and looks again when
the Devices page or ride setup opens. The Devices page shows the ones it's
still looking for, with Forget. Remove forgets a sensor too.

The ANT+ stick is turned on again at launch if it was on, since ANT+ pairs
whichever sensors are near rather than a list.
@pepperstm
pepperstm merged commit 0f465e1 into main Nov 12, 2026
6 checks passed
@pepperstm
pepperstm deleted the feature/remember-sensors branch November 12, 2026 13:51
pepperstm added a commit that referenced this pull request Nov 12, 2026
## What and why

A Linux user's xoss speed sensor wouldn't connect (#70). BlueZ kept
cancelling the connection, with `le-connection-abort-by-local` or
`Service discovery timed out`. BlueZ often does that to a connection
made while the radio is scanning, and VeloPopuli was doing exactly that:

- After you picked a device to add, the scan kept running for up to 0.6
s while it connected. On Linux the scan is now stopped first.
- The search for remembered sensors (#79) connects while scanning.
- Picking a device to add while remembered sensors were being looked for
also connected with the scan running.

Every Bluetooth connection now goes through one path. It counts the
connections under way and, on Linux, stops the scan first, then starts
it again once none are left and a search still wants it.

macOS and Windows connect fine while scanning, so they're unchanged.

## Checked

- `npm run check` passes, and CI's Linux build compiles the Linux path.
- I couldn't test it on Linux hardware, so it needs a retest by the
reporter on #70.

Refs #70
@pepperstm pepperstm mentioned this pull request Nov 12, 2026
pepperstm added a commit that referenced this pull request Nov 12, 2026
Version 0.3.10: laps (#68, by Rallensooo), Herne Hill Velodrome (#75), signposted road routes (#77), your Strava routes (#78), the Dreeve connector and pluggable connectors (#74, #83, by Jörn), remembered sensors (#79), smooth bends with lean (#81) and the Linux Bluetooth fix (#84).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant