3rd Party Bluetooth Binding. Beta testers needed

bluetooth
binding
Tags: #<Tag:0x00007fd30e17d480> #<Tag:0x00007fd30e17d2a0>

(Constantinos Contis) #463

i removed/deleted all the items and i left item linking at simple mode to link all the new found items.And it did for all of them this time.


(Marcus K.) #464

thank you @Constantinos_Contis, this works for me too

@vkolotov is this the preferred way to add the items (selecting simple mode) or is this bug? also thank you very much for your work :+1:


(Thomas Bail) #465

I am setting up a new systems right now and i am using the bluetooth binding. Setup worked so far an with the tinyb i get some thing. So far so good.

But as described earlier i try to use a remote bluetooth adapter. as described in #136 with ser2net an socat a serial port is delivered over the net. If have done that with a blusgiga adapter, because they are based on serial information. I checked the adapter on the original Raspi and on the remote site, my openhab instalaltion.

And on both sides i get some information (using the bluegiga scanner sript.

But in openhab the bluegiga adapter is not recognized. I installed the binding an set the port filter to (/dev/ttyUSB0) this is the right serial port.

Has anyone a tip for me how to enable it working?

Thomas


(Thomas Bail) #466

Now i connected the Bluegiga Adapter direktly to my new system - and - the binding does not recognises it. Any hints?


(Vlad Kolotov) #467

Hi @Dibbler42, what do you define in the binding setting for your bluegiga adapter serial port regex setting?


(Thomas Bail) #468

Very simple (/dev/ttyACM0) or if i use the ser2net/socat solution (/dev/ttyUSB0)


(Vlad Kolotov) #469

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


(Vlad Kolotov) #470

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

(Thomas Bail) #471

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) [?:?]

(Vlad Kolotov) #472

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


(Thomas Bail) #473

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


(Thomas Bail) #474

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


(Marcus K.) #475

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

(Thomas Bail) #476

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


(Thomas Bail) #477

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


(Vlad Kolotov) #478

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.


(Vlad Kolotov) #479

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.


(Thomas Bail) #480

@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


(Vlad Kolotov) #481

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:


(Vlad Kolotov) #482

More info on this here.