Fix Bluetooth HID connections in dual-mode BlueZ

ControllerMode=bredr made BlueZ 5.87 reject the LE-only HOGP profile, so discovered BLE keyboards and mice never created input devices. Use dual mode, power/LE preflight, LE bearer selection for HID-over-GATT devices, automatic pairing on Connect Device and a pkill-free daemon stop path. Add scripts/test-bluetooth-hid.py and check-rebuild guards, synchronize docs, and rebuild the 2720 image (09226459...).
This commit is contained in:
Luxferre committed 2026-11-10 17:45:52 +02:00
1 parent ba2f25aa36
commit 20603893e7
9 files changed
+225 -11

No files matched your search

+8
View File
@@ -13,6 +13,14 @@ Release versions follow the `<year-letter><MM><DD>` format (where `2026` is `a`,
Work since `a1108` has focused on reliable 2720 Flip hardware support and a reproducible boot/flash path. Earlier incremental and superseded diagnostic entries are consolidated here.
### Real Bluetooth connections and HID-over-GATT
- **Root cause**: the previous image could discover and even bond BLE peripherals, but `ControllerMode = bredr` made BlueZ 5.87's `btd_profile_register()` reject the LE-only `input-hog` profile. `bluetoothd -d` logged `System does not support hog plugin`, so HID-over-GATT keyboards and mice never produced a usable `/dev/input` node.
- **Connection path**: `overlay/rootfs/etc/bluetooth/main.conf` now uses `ControllerMode = dual`, preserving classic A2DP/HSP/HFP profiles while allowing LE HOGP. `input.conf` keeps `UserspaceHID=true`, `LEAutoSecurity=true` and `ClassicBondedOnly=false`. `bananarchy-bt-obex` powers the adapter on, calls the narrow `bananarchy-bt-le-enable.sh` helper, sets `PreferredBearer = le` for devices exposing HID service `00001812-...`, and automatically pairs unbonded peripherals selected through **Connect Device**.
- **Daemon lifecycle**: `bananarchy-bt-obex stop` no longer calls `pkill`, which is absent from the BusyBox-based target rootfs; it now terminates the PID-file daemon and scans `/proc` directly for stale daemon command lines.
- **Guards and live verification**: `scripts/test-bluetooth-hid.py` and `check-rebuild.sh` guard the dual-mode config, HOGP settings, pair/connect preflight, LE bearer selection and auto-pair logic. On the live phone, `bluetoothd -d` showed `Loading hog plugin` with no `System does not support hog plugin` rejection after the change, and `btmgmt info` showed `le` in the controller's current settings immediately after `bluetoothctl power on`.
- **Image persistence**: rebuilt `images/bananarchy-nokia-beatles.img` at `a1108` / `dejavu`; the verified raw hash is `09226459db06615ea97256e4d07573e522c4b40a9f37a6b1fda911f608194225`, pinned by `check-rebuild.sh`. `debugfs` confirms the image rootfs has `ControllerMode = dual`, the corrected `0755` `bananarchy-bt-obex` helper and the explicit Bluetooth packages; `e2fsck -fn` passed. This supersedes the discovery-fix image hash `546e5c5f...`.
### Live Bluetooth peripheral discovery
- **Synthetic-only regression**: the previous Bluetooth fix could find an injected `BT_PROBE` line but not real peripherals. Live diagnostics showed non-interactive `bluetoothctl --timeout 15 scan on` emitted only discovery-filter/controller messages, a separate `bluetoothctl devices` query after the scan client exited was empty, and `scan off` from another client failed with `org.bluez.Error.InProgress` while the original client still owned discovery.