Bluetooth BlueZ Adapter

Hi. I’m tryng to build a presence system with bluetooth gtag, but OH can’t discover the adapter.

$ bluetoothctl -v
5.43

$ hcitool dev
Devices:
        hci0    00:02:72:AD:6B:63

$ groups openhab
openhab : openhab tty dialout audio bluetooth

$ bluetoothctl
[NEW] Controller XX:XX:XX:XX:XX:XX linux [default]

Log if I try to add it manually:

[ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.initialize()’ on ‘org.openhab.binding.bluetooth.bluez.handler.BlueZBridgeHandler@fb135e’: BlueZ JNI connection cannot be established.
java.lang.IllegalStateException: BlueZ JNI connection cannot be established.
at org.openhab.binding.bluetooth.bluez.handler.BlueZBridgeHandler.initialize(BlueZBridgeHandler.java:98) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [133:org.openhab.core:2.5.0.M4]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [133:org.openhab.core:2.5.0.M4]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.lang.UnsatisfiedLinkError: tinyb.BluetoothManager.getNativeAPIVersion()Ljava/lang/String;
at tinyb.BluetoothManager.getNativeAPIVersion(Native Method) ~[?:?]
at tinyb.BluetoothManager.getBluetoothManager(BluetoothManager.java:304) ~[?:?]
at org.openhab.binding.bluetooth.bluez.handler.BlueZBridgeHandler.initialize(BlueZBridgeHandler.java:93) ~[?:?]
… 10 more
2019-10-28 15:49:26.790 [hingStatusInfoChangedEvent] - ‘bluetooth:bluez:hci0’ changed from INITIALIZING to UNINITIALIZED (HANDLER_INITIALIZING_ERROR): BlueZ JNI connection cannot be established.
2019-10-28 15:49:26.790 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing ‘bluetooth:bluez:hci0’: BlueZ JNI connection cannot be established.
java.lang.IllegalStateException: BlueZ JNI connection cannot be established.
at org.openhab.binding.bluetooth.bluez.handler.BlueZBridgeHandler.initialize(BlueZBridgeHandler.java:98) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [133:org.openhab.core:2.5.0.M4]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [133:org.openhab.core:2.5.0.M4]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.lang.UnsatisfiedLinkError: tinyb.BluetoothManager.getNativeAPIVersion()Ljava/lang/String;
at tinyb.BluetoothManager.getNativeAPIVersion(Native Method) ~[?:?]
at tinyb.BluetoothManager.getBluetoothManager(BluetoothManager.java:304) ~[?:?]
at org.openhab.binding.bluetooth.bluez.handler.BlueZBridgeHandler.initialize(BlueZBridgeHandler.java:93) ~[?:?]

What to check?

Issues on github like this one here.:wink:

Looks like you may need to use OH version 2.4 for till there is a fix.

Ii appears there is a fix. It should work in 2.5M4.

I am on openHAB 2.5.0.M4 Milestone Build

Not yet :wink:

Upgrade to the latest snapshot or wait for the M5. I’ll try my luck with the former.

1 Like

Latest snapshot is still not working for me. I’ve updated the issue with details.

Has it been determined what the scope of the problem is? Is it the combination of OH 2.5.0 and Raspberry? I couldn’t figure it out from the issue #5680. You’d think there to be more noise if this was happening to everyone using bluetooth.

For the record, same problem here with (Openabian) OH 2.5.0-1, Raspberry Pi 3 Model B Plus Rev 1.3.

1 Like

I believe the openHABian image is 32-bit. According to the posting above the issue was fixed for 64 bit versions.

To add a bit of noise: also on a Raspberry Pi 3 B, still seeing the same problem. Bluez being dysfunctional since mid-2019 is slightly frustrating…

1 Like