I’m trying to get the bluetooth binding to run, but already to get the bluetooth bridge running, which is required to attach the Ruuvi Tags later on.
BlueZ 5.43 is installed and the Ruuvi Tage is discovered if monitoring the bluetoothctl CLI output. Also, all changed posted by the Ruuvi tag recognized.
The bridge definition looks just like described in the dcoumentation, of course with my MAC address:
2020-02-20 15:06:41.060 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.bluetooth.bluez.handler.BlueZBridgeHandler@1684c7fb': 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) ~[?:1.8.0_242]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_242]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_242]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_242]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_242]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_242]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_242]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
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
2020-02-20 15:06:41.062 [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) ~[?:1.8.0_242]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_242]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_242]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_242]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_242]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_242]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_242]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
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
The user openhab is member of the bluetooth group and access to bluetoothctl works when using
openHABian also supports general Debian/Ubuntu based systems on different platforms. Starting with a fresh installation of your operating system, install git, then clone the openHABian project and finally execute the openHABian configuration tool:
2020-02-21 16:30:18.770 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.bluetooth.bluez.handler.BlueZBridgeHandler@6a06846e': 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:97) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_242]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_242]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_242]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_242]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_242]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_242]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_242]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
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:92) ~[?:?]
... 10 more
2020-02-21 16:30:18.775 [ERROR] [core.thing.internal.ThingManagerImpl] - Exception occurred while initializing handler of thing 'bluetooth:bluez:b2914e34': 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:97) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_242]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_242]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_242]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_242]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_242]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_242]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_242]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
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:92) ~[?:?]
... 10 more
Also, in case you don’t want to manually enable your bluetooth adapters with bluetoothctl , ensure that it’s automatically enabled by setting the option AutoEnable in your /etc/bluetooth/main.conf to true . Restart running services for changes to take effect.
systemctl restart dbus
systemctl restart bluetooth
systemctl restart openhab2
systemctl restart dbus
systemctl restart bluetooth
systemctl restart openhab2
Openhab does not find the Bluetooth controller. I am expecting OH to find them automatically per the documentation here. so I add the following line to a new bluetooth.things file
localhost:~$ lsusb
...
Bus 003 Device 002: ID 0a5c:21e8 Broadcom Corp. BCM20702A0 Bluetooth 4.0
...
The error on openhab.log
2020-06-18 11:56:15.133 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.initialize()' on 'org.openhab.binding.bluetooth.bluez.handler.BlueZBridgeHandler@4f59bdf7': 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:72) ~[?:?]
at jdk.internal.reflect.GeneratedMethodAccessor94.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
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) [?:?]
Caused by: java.lang.UnsatisfiedLinkError: 'java.lang.String tinyb.BluetoothManager.getNativeAPIVersion()'
at tinyb.BluetoothManager.getNativeAPIVersion(Native Method) ~[?:?]
at tinyb.BluetoothManager.getBluetoothManager(BluetoothManager.java:304) ~[?:?]
at org.openhab.binding.bluetooth.bluez.handler.BlueZBridgeHandler.initialize(BlueZBridgeHandler.java:67) ~[?:?]
... 9 more
2020-06-18 11:56:15.134 [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:72) ~[?:?]
at jdk.internal.reflect.GeneratedMethodAccessor94.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:152) [bundleFile:?]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:52) [bundleFile:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
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) [?:?]
Caused by: java.lang.UnsatisfiedLinkError: 'java.lang.String tinyb.BluetoothManager.getNativeAPIVersion()'
at tinyb.BluetoothManager.getNativeAPIVersion(Native Method) ~[?:?]
at tinyb.BluetoothManager.getBluetoothManager(BluetoothManager.java:304) ~[?:?]
at org.openhab.binding.bluetooth.bluez.handler.BlueZBridgeHandler.initialize(BlueZBridgeHandler.java:67) ~[?:?]
... 9 more