OH3 Bluetooth binding stops working with Asus USB-BT500

Hello.

I have OH3 installed on Raspbian running on RPi4. I have observed that the bluetooth binding stops working randomly. This is what I can see in openhab.log:

2021-02-28 23:34:48.234 [ERROR] [com.github.hypfvieh.DbusHelper      ] - Critical error while reading DBUS response (maybe no bluetoothd daemon running?)
org.freedesktop.dbus.exceptions.DBusExecutionException: The maximum number of pending replies per connection has been reached
        at jdk.internal.reflect.GeneratedConstructorAccessor177.newInstance(Unknown Source) ~[?:?]
        at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:490) ~[?:?]
        at org.freedesktop.dbus.errors.Error.getException(Error.java:157) ~[bundleFile:?]
        at org.freedesktop.dbus.errors.Error.throwException(Error.java:187) ~[bundleFile:?]
        at org.freedesktop.dbus.RemoteInvocationHandler.executeRemoteMethod(RemoteInvocationHandler.java:164) ~[bundleFile:?]
        at org.freedesktop.dbus.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:228) ~[bundleFile:?]
        at com.sun.proxy.$Proxy175.Introspect(Unknown Source) ~[?:?]
        at com.github.hypfvieh.DbusHelper.findNodes(DbusHelper.java:44) [bundleFile:?]
        at com.github.hypfvieh.bluetooth.wrapper.BluetoothDevice.refreshGattServices(BluetoothDevice.java:82) [bundleFile:?]
        at com.github.hypfvieh.bluetooth.wrapper.BluetoothDevice.getGattServices(BluetoothDevice.java:70) [bundleFile:?]
        at org.openhab.binding.bluetooth.bluez.internal.BlueZBluetoothDevice.discoverServices(BlueZBluetoothDevice.java:395) [bundleFile:?]
        at org.openhab.binding.bluetooth.bluez.internal.BlueZBluetoothDevice.updateBlueZDevice(BlueZBluetoothDevice.java:113) [bundleFile:?]
        at org.openhab.binding.bluetooth.bluez.internal.BlueZBridgeHandler.initializeAndRefreshDevices(BlueZBridgeHandler.java:177) [bundleFile:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]
2021-02-28 23:34:58.288 [WARN ] [th.bluez.internal.BlueZBridgeHandler] - Unknown exception
java.lang.NullPointerException: null
        at com.github.hypfvieh.bluetooth.wrapper.BluetoothAdapter.isPowered(BluetoothAdapter.java:100) ~[bundleFile:?]
        at org.openhab.binding.bluetooth.bluez.internal.BlueZBridgeHandler.prepareAdapter(BlueZBridgeHandler.java:134) ~[bundleFile:?]
        at org.openhab.binding.bluetooth.bluez.internal.BlueZBridgeHandler.initializeAndRefreshDevices(BlueZBridgeHandler.java:162) [bundleFile:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
        at java.lang.Thread.run(Thread.java:834) [?:?]

I have to do systemctl restart bluetooth.service in order to resume the binding. This is kind of bad since the bluetooth binding dies, my OH3 instance stops receiving readings from bluetooth beacons.

Additionally, this is what I have in the system journal:

Feb 28 23:34:48 openhab dbus-daemon[332]: [system] The maximum number of pending replies for ":1.35" (uid=109 pid=28190 comm="/usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr
Feb 28 23:34:48 openhab dbus-daemon[332]: [system] The maximum number of pending replies for ":1.35" (uid=109 pid=28190 comm="/usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr
Feb 28 23:34:48 openhab dbus-daemon[332]: [system] The maximum number of pending replies for ":1.35" (uid=109 pid=28190 comm="/usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr
Feb 28 23:34:48 openhab dbus-daemon[332]: [system] The maximum number of pending replies for ":1.35" (uid=109 pid=28190 comm="/usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr
Feb 28 23:34:48 openhab dbus-daemon[332]: [system] The maximum number of pending replies for ":1.35" (uid=109 pid=28190 comm="/usr/bin/java -XX:-UsePerfData -Dopenhab.home=/usr

(just a few lines, there’s a lot more of that in there)

So my question is: has anyone ever seen this happening their systems? Anyone have any idea what this is all about and how to fix this?

Okay now, this is starting to unfold. The thing is, I have an Asus USB-BT500 dongle which, apparently, isn’t fully / properly supported by the drivers present in Raspbian. Luckily though, Asus provides Linux drivers, although you have to compile them for your kernel. Some guy on Reddit had compiled easy to follow instructions for doing this so I just followed those and had the thing up and running in no time.

Now I’m hoping the binding stays up. I’ll keep an eye on it, and follow up in a few days.