sputnikdev / eclipse-smarthome-bluetooth-binding-tinyb-transport

Eclipse Smarthome Bluetooth Binding TinyB Transport

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Broken bluetooth subsystem when using tinyb

xrucka opened this issue · comments

Hi,
have you ever encountered similar behavior? When I manage my bluetooth dongles through bluetoothctl, everyting works just fine and good to go. However, when I start openhab and the plugin stack gets loaded, the dongles seem to get stuck in discovery and I can no longer connect to any device. Neither via bluetoothctl, nor via openhab control pane. I then must return all the switches to off position, shutdown openhab, shutdown bluezd, remove all bluetooth-related kernel modules and then reinitialize them. Shuting down only openhab does not work, the adapters can no-longer be managed, not even via bluetoothctl (powercycling them does not help either).

Dmesg output:
[ 302.568264] Bluetooth: hci0 advertising data length corrected
[ 309.600273] Bluetooth: hci1 advertising data length corrected
...
[ 326.310095] Bluetooth: hci0 command 0x200c tx timeout
[ 338.630220] Bluetooth: hci0 command 0x200c tx timeout

Hi @xrucka, hmm. It was not such bad for me, however I think I might have seen a strange thing with tinyb. When everything is set up and running, some bluetooth devices fail to connect for the very first time, e.g. it tries to connect, then it gets a "Dbus" error, the the binding retries to connect them again and then it is just fine. I noticed that this thing can be caused by either BluetoothAdapter.getPowered or BluetoothAdapter.setPowered method. I definitely can see that if I stop using both of them (comment them out), the connection is very stable (devices get connected straight away).

I'll be working on that issue and I'll let you know how it goes, maybe it is the same issue that you describe.