Skip to content

fix bluetoothctl handling for bluez 5.87 - #1

Merged
atvcaptain merged 1 commit into
oe-alliance-plugins:mainfrom
WXbet:bluez-5.87
Aug 22, 2026
Merged

atvcaptain merged 1 commit into
oe-alliance-plugins:mainfrom
WXbet:bluez-5.87

Conversation

@WXbet

@WXbet WXbet commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

oe-alliance-core moved to bluez 5.87 in oe-alliance/oe-alliance-core@76f04241fce, and the plugin no longer talks to bluetoothctl.

The prompt changed from [bluetooth]# to [bluetoothctl]> (PROMPT_ON in client/main.c) and 5.87 emits it only after the first input. send() matched on "#", so every command ran into the 10 s timeout - in the main thread, which is where the spinners in oe-alliance/oe-alliance-core@76f04241fce#commitcomment-197284156 come from. The log there shows it directly: bluetoothctl failed after scan on, ... after devices, ... after paired-devices.

Three more came out of comparing every expect() string against the 5.87 sources:

  • a timed out session stayed marked as ready, so the dead session was reused instead of restarted - hence five minutes of failures before the first restart attempt
  • the disconnect message was renamed after 5.70, Successful disconnected to Disconnection successful, so disconnecting always looked like it failed. Both spellings are kept.
  • print_device gained a branch that wraps devices advertising as non-discoverable in COLOR_BOLDGRAY. Those escapes ended up in the device name, which is the normal case for a BLE remote.

Tested on a gbquad4kpro running 5.87: the scan lists devices and the spinners are gone. connect, disconnect and pairing itself are not tested yet, and whether this also fixes enigma2 refusing to shut down after a failed scan is unconfirmed.

The prompt is "[bluetoothctl]>" now and appears only after the first
input, so every command ran into the timeout - in the main thread, which
is where the spinners came from.

Three more that came out of comparing against the 5.87 sources: a timed
out session stayed marked as ready, the disconnect message was renamed
after 5.70, and 5.87 wraps devices that advertise as non-discoverable in
color escapes that ended up in the name.
@sonarqubecloud

Copy link
Copy Markdown

@atvcaptain
atvcaptain merged commit 9d44909 into oe-alliance-plugins:main Aug 22, 2026
2 checks passed
@WXbet
WXbet deleted the bluez-5.87 branch August 22, 2026 17:47
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.

2 participants