balena-labs-projects / bluetooth

Optimized bluetooth agent for balenaOS. Based on BlueZ 5.0.
https://hub.balena.io/blocks
23 stars 11 forks source link

Automatically reconnect to paired and trusted devices on reboot. #10

Closed tmigone closed 3 years ago

tmigone commented 3 years ago

Connects-to: #9 Change-type: minor Signed-off-by: Tomás Migone tomas@balena.io

tmigone commented 3 years ago

@balena-ci rebase

chrisys commented 3 years ago

@tmigone seems to work for me using a Pi 3. The only hiccup I encountered was that if the phone was playing audio when the device reconnects, the audio does move to the device but stutters and sometimes doesn't recover and drops the bluetooth connection.

Screenshot 2021-01-28 at 12 26 26

If the phone is not playing audio when the reconnect happens it appears to all work OK.

tmigone commented 3 years ago

@chrisys I believe that error is the infamous BT/WiFi chip interference. Or at least that one manifests itself with the same error codes. I've tested with my Pi3 and it did manifest one out of three times i tried, but then switching to usb bluetooth dongle seems to work 100%.