Skip to content

Stop scanning before connecting a Bluetooth sensor on Linux - #84

Merged
pepperstm merged 2 commits into
mainfrom
fix/linux-ble-connect
Nov 12, 2026
Merged

pepperstm merged 2 commits into
mainfrom
fix/linux-ble-connect

Conversation

@pepperstm

@pepperstm pepperstm commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

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 (Remember sensors and reconnect them at launch #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

Refs #70

BlueZ often aborts a connection made while the radio is scanning, with
le-connection-abort-by-local or Service discovery timed out (#70). Picking a
device to add left the scan running for up to 0.6 s, and the search for
remembered sensors connected while scanning. On Linux the scan is now stopped
first, and the search for remembered sensors connects one at a time and then
scans again. macOS and Windows are unchanged.
One connect path for adding a device and for remembered sensors: it counts
the connections under way, stops the scan first on Linux, and starts it again
once none are left and a search still wants it. Picking a device to add while
remembered sensors were being looked for used to connect with the scan still
running.
@pepperstm
pepperstm force-pushed the fix/linux-ble-connect branch from 4d97b02 to 4cd8637 Compare November 12, 2026 15:43
@pepperstm
pepperstm merged commit 0571738 into main Nov 12, 2026
4 checks passed
@pepperstm
pepperstm deleted the fix/linux-ble-connect branch November 12, 2026 15:47
@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