3rd Party Bluetooth Binding. Beta testers needed

It might be that openhab user does not have sufficient permissions, can you please check this?

If it is all good with permissions, time to look at your logs, in your karaf console please run:

log:set DEBUG org.sputnikdev.bluetooth.manager.transport.bluegiga
log:set DEBUG org.sputnikdev.bluetooth.manager.impl
1 Like

Found the following Error in the log right after the start.

2018-05-08 04:53:25.830 [ERROR] [binding.bluetooth.transport.bluegiga] - FrameworkEvent ERROR - org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.bluegiga
org.osgi.framework.BundleException: Could not resolve module: org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.bluegiga [203]
  Unresolved requirement: Import-Package: gnu.io

        at org.eclipse.osgi.container.Module.start(Module.java:444) [?:?]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1634) [?:?]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1614) [?:?]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1585) [?:?]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1528) [?:?]
        at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) [?:?]
        at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [?:?]
        at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) [?:?]

Hi @Dibbler42, this is something. Could you please confirm what OH version you are running?

@vkolotov this is a very simple task :slight_smile: openHAB 2.3.0 Build #1272

I just started a really fresh install with oh 2.3#1273 and had the same error. after googling a bit i found a solution

gnu.io not resolved

Solution is to login to karaf and install as follows

feature:install openhab-transport-serial

Now the error is gone, but still no bluegiga adapter, but now i step back to the more detailed log.

And now with a direct connect to the usb port ist is working. Next step is use ser2net and socat

after upgrading to oh 2.3#1273 from oh 2.3#1265
I get this error in my log when starting
I use raspberry 3b+ with tinyb binding and Xiaomi Mijia Bluetooth Temperature Smart Humidity Sensor

2018-05-10 12:04:00.385 [WARN ] [me.config.core.internal.ConfigMapper] - Could not set field value for field 'txPowerMeasured': For input string: ""
java.lang.NumberFormatException: For input string: ""
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:?]
        at java.lang.Integer.parseInt(Integer.java:592) [?:?]
        at java.lang.Integer.valueOf(Integer.java:766) [?:?]
        at org.eclipse.smarthome.config.core.internal.ConfigMapper.objectConvert(ConfigMapper.java:159) [96:org.eclipse.smarthome.config.core:0.10.0.201805051943]
        at org.eclipse.smarthome.config.core.internal.ConfigMapper.as(ConfigMapper.java:98) [96:org.eclipse.smarthome.config.core:0.10.0.201805051943]
        at org.eclipse.smarthome.config.core.Configuration.as(Configuration.java:54) [96:org.eclipse.smarthome.config.core:0.10.0.201805051943]
        at org.sputnikdev.esh.binding.bluetooth.handler.GenericBluetoothDeviceHandler.updateDevice(GenericBluetoothDeviceHandler.java:181) [244:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.1.4]
        at org.sputnikdev.esh.binding.bluetooth.handler.BluetoothDeviceHandler.updateDevice(BluetoothDeviceHandler.java:167) [244:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.1.4]
        at org.sputnikdev.esh.binding.bluetooth.handler.GenericBluetoothDeviceHandler.initialize(GenericBluetoothDeviceHandler.java:129) [244:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.1.4]
        at org.sputnikdev.esh.binding.bluetooth.handler.BluetoothDeviceHandler.initialize(BluetoothDeviceHandler.java:90) [244:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.1.4]
        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:153) [101:org.eclipse.smarthome.core:0.10.0.201805051943]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [101:org.eclipse.smarthome.core:0.10.0.201805051943]
        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) [?:?]
2018-05-10 12:04:00.416 [WARN ] [me.config.core.internal.ConfigMapper] - Could not set field value for field 'txPowerMeasured': For input string: ""
java.lang.NumberFormatException: For input string: ""
        at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:?]
        at java.lang.Integer.parseInt(Integer.java:592) [?:?]
        at java.lang.Integer.valueOf(Integer.java:766) [?:?]
        at org.eclipse.smarthome.config.core.internal.ConfigMapper.objectConvert(ConfigMapper.java:159) [96:org.eclipse.smarthome.config.core:0.10.0.201805051943]
        at org.eclipse.smarthome.config.core.internal.ConfigMapper.as(ConfigMapper.java:98) [96:org.eclipse.smarthome.config.core:0.10.0.201805051943]
        at org.eclipse.smarthome.config.core.Configuration.as(Configuration.java:54) [96:org.eclipse.smarthome.config.core:0.10.0.201805051943]
        at org.sputnikdev.esh.binding.bluetooth.handler.BluetoothDeviceHandler.updateDevice(BluetoothDeviceHandler.java:168) [244:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.1.4]
        at org.sputnikdev.esh.binding.bluetooth.handler.GenericBluetoothDeviceHandler.initialize(GenericBluetoothDeviceHandler.java:129) [244:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.1.4]
        at org.sputnikdev.esh.binding.bluetooth.handler.BluetoothDeviceHandler.initialize(BluetoothDeviceHandler.java:90) [244:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.1.4]
        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:153) [101:org.eclipse.smarthome.core:0.10.0.201805051943]
        at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [101:org.eclipse.smarthome.core:0.10.0.201805051943]
        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) [?:?]
2018-05-10 12:04:00.436 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler AdapterHandler of thing bluetooth:adapter:B827EB5816E5 tried checking if channel discovering is linked although the handler was already disposed.
2018-05-10 12:04:00.442 [WARN ] [.core.thing.binding.BaseThingHandler] - Handler AdapterHandler of thing bluetooth:adapter:B827EB5816E5 tried checking if channel discovering-control is linked although the handler was already disposed

So now it is working. The bluegiga adapter is connected to openhab using ser2net and socat. Last step to bring it online was to assigns the right ttys to java.

Later i will create a small tutorial on that

Unfortunatly i did not get any battery values from my miflora sensors. Anyone any ideas?

hi @Dibbler42, it is normal. MiFlora does not advertise battery status.

Looking forward to seeing your instructions how you set up ser2net. I could add your instructions into the binding documentation if you want.

It seems to me we’ve got a bunch of issues with the new OH version (2.3). I’ll be looking into it shortly.

@vkolotov as far as i remember the miflora daemon that is part of openbahian supports battery values as ell as the firmware version. Maybe it is worth to have alook into it.

https://community.openhab.org/t/xiaomi-mi-flora-plant-sensor-mqtt-client-daemon

All those python scrips for MiFlora collect data in a brute-force way. All xiaomi bluetooth sensors/devices use a proprietary authentication protocol that is unknown so far. What those scrips do is - they connect to sensors, get as much as possible data within 5 secs, and then miflora sensor drops connection. This basically means that connection/disconnections are happening all the time, which is not a true way :slight_smile:

More info on this here.

Ok, i understand. i prefer your bluetooth binding, because even with ser2net it is simpler to use. Unfortunately i did not receive data from one sensor (The miflora app does) and for battery driven devices a battery level is usefull.

So i have to wait someday someone will find out how to connect :slight_smile:

Thanks for all your work.

Thomas

Double check this: https://github.com/sputnikdev/eclipse-smarthome-bluetooth-binding/blob/master/xiaomi.md#important

It is the latest firmware and it is only 50cm away from another sensor so i have no idea why it is not found

@Dibbler42, very strange. It is a bit confusing. Are you saying that the binding can discover that sensor but it is not receiving data from it? If so, can you see RSSI channel?

Are you sure its not paired with your phone? I had some problems too. But removing the battery and putting it back again resolved some strange issues i had with connection.

@vkolotov No, i dont see the sensor at all, as if it insn’t advertisiing anything

@Fredrik_Andersson I will try that with the battery. And i have all my sensors connected to the phone (Flower App)