3rd Party Bluetooth Binding. Beta testers needed

Hi @druciak, I’ve create a ticket on github for your device: https://github.com/sputnikdev/eclipse-smarthome-bluetooth-binding/issues/27

From what I can see, we could try to add support for your device through custom GATT spec files.

Sounds great!
Also it seems that when I add Weather Station thing, my python script stops working. When I remove it is working again. Does the binding prevent other clients from reading the device’s data? Is bluez connection exclusive, so no other client can connect?
Anyway I will be watching this.

One more thing I’ve spotted are weird entries in the syslog:

Jan 23 21:30:55 ipserv3 java[24833]: g_dbus_interface_get_info: assertion 'G_IS_DBUS_INTERFACE (interface_)' failed
Jan 23 21:30:56 ipserv3 java[24833]: Error setting property 'Powered' on interface org.bluez.Adapter1: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name :1.100 was not provided by any .service files (g-dbus-error-quark, 2)

Do you know what it means?

hi @druciak, looks like it is definitely possible to add support for your device. Could you please try to add GATT files form this commit? https://github.com/sputnikdev/bluetooth-gatt-parser/commit/175b10eb1e497f896ef2663bbb4ba0872f0cc2ad See a new message below.

Create a folder on your file system that is accessible by “openhab” user, something like that:
/home/pi/.bluetooth_smart
That folder should contain two subfolders:

  • characteristic
  • service

These two folders should contain your xml files from the commit above, e.g. “characteristic” folder contains XML file for characteristics and “service” contains XML files for your services.
Make sure that file permissions are set correctly so that “openhab” user can read them.

Specify gatt extension folder here:

Let me know how it goes.

Update #1: You will have to remove the thing and add back again.
Update #2: The following channels will be available (if it is working properly):

Indoor temperature:

  • Base temp
  • Base max temp
  • Base min temp

Outdoor temperature:

  • Sensor 1 temp
  • Sensor 1 max temp
  • Sensor 1 min temp

That’s what I could decode from the python script on the article you mentioned earlier. However, from what I can see, there are some other channels that could be potentially added. Unfortunately I do not nave that device, so it is not possible for me to work further. However, if you have some experience in software engineering, you could try to add more by looking what characteristics the device has and what they represent. Most likely humidity readings and extra outdoor sensors could be added.

Yep, It is binding. Bluetooth devices can support only single simultaneous connection. That’s why your python script stops working.

I’m not recommending using multiple bluetooth clients (tools, scripts) just for now. This might interrupt the binding stuff. It is definitely not tested.

Hi @druciak, looks like I figured out the rest of the channels for your device even without having your device (don’t ask me how :slight_smile: ). Here are the updated files:

You should see the following channels in OH:

  • Base temp
  • Sensor 1 temp
  • Sensor 2 temp
  • Sensor 3 temp
  • Base humidity
  • Sensor 1 humidity
  • Sensor 2 humidity
  • Sensor 3 humidity
  • Temperature trend
  • Humidity trend
  • Base humidity max
  • Base humidity min
  • Sensor 1 humidity max
  • Sensor 1 humidity min
  • Sensor 2 humidity max
  • Sensor 2 humidity min
  • Sensor 3 humidity max
  • Sensor 3 humidity min
  • Base max temp
  • Base min temp
  • Sensor 1 max temp
  • Sensor 1 min temp
  • Sensor 2 max temp
  • Sensor 2 min temp
  • Sensor 3 max temp
  • Sensor 3 min temp

Let me know how it goes.

PS. for unsupported channels (which your device does not have, e.g. not attached) you will see:

  • temperature readings: 3276.7
  • humidity readings: 127
  • trends: 255

Hi Vlad, thank for your work.
I will give it a try at evening. Your findings seems correct as the station can have up to 3 external sensors. One thing regarding “service” file: name attribute in Service element is incorrect (although I think it does not matter).

Also, do I need to upgrade the binding or the one from marketplace should work?

BTW I hope you didn’t work on this whole night… :wink:

Good finding. It should not matter though, I’ve pushed a correction.

For this to work you can use the one from MarketPlace. I’ll push/publish new GATT specs for your device once you have tested it with the Binding so it can be used out of the box.

Nope. I’m in New Zealand.

Wow, good for you. :slight_smile: Beautiful country…

I configured the files you provided and new channels appeared. However I cannot get any data for them. The good thing is that some other (generic) fields got populated. See attached screenshot.

The other thing is that the data does not seem to refresh. Values (i.e RSSI) stay solid unless I remove and add the thing back.Then new values appear, but again they are not changing in time.

I enabled DEBUG log level for the binding and added the thing again. Here are the logs:

2018-01-24 20:01:16.402 [WARN ] [ome.core.thing.internal.ThingManager] - Initializing handler for thing 'bluetooth:ble:ED8914A1503A' takes more than 5000ms.
2018-01-24 20:01:20.527 [WARN ] [impl.AbstractBluetoothObjectGovernor] - Could not update governor state.
tinyb.BluetoothException: GDBus.Error:org.bluez.Error.Failed: Software caused connection abort
        at tinyb.BluetoothDevice.connect(Native Method) ~[?:?]
        at org.sputnikdev.bluetooth.manager.transport.tinyb.TinyBDevice.connect(TinyBDevice.java:67) ~[?:?]
        at org.sputnikdev.bluetooth.manager.impl.DeviceGovernorImpl.updateConnected(DeviceGovernorImpl.java:557) ~[?:?]
        at org.sputnikdev.bluetooth.manager.impl.DeviceGovernorImpl.update(DeviceGovernorImpl.java:109) ~[?:?]
        at org.sputnikdev.bluetooth.manager.impl.DeviceGovernorImpl.update(DeviceGovernorImpl.java:57) ~[?:?]
        at org.sputnikdev.bluetooth.manager.impl.AbstractBluetoothObjectGovernor.update(AbstractBluetoothObjectGovernor.java:160) ~[?:?]
        at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerImpl.update(BluetoothManagerImpl.java:471) ~[?:?]
        at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerImpl.lambda$scheduleGovernor$19(BluetoothManagerImpl.java:608) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:?]
        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-01-24 20:01:34.399 [INFO ] [tooth.handler.BluetoothDeviceHandler] - Building channels for services: 4
2018-01-24 20:01:34.401 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Handling a new characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/74e7fe00-c6a4-11e2-b7a9-0002a5d5c51b/74e78e14-c6a4-11e2-b7a9-0002a5d5c51b
2018-01-24 20:01:34.403 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Skipping unknown characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/74e7fe00-c6a4-11e2-b7a9-0002a5d5c51b/74e78e14-c6a4-11e2-b7a9-0002a5d5c51b
2018-01-24 20:01:34.405 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Handling a new characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/74e7fe00-c6a4-11e2-b7a9-0002a5d5c51b/74e78e2c-c6a4-11e2-b7a9-0002a5d5c51b
2018-01-24 20:01:34.407 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Skipping unknown characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/74e7fe00-c6a4-11e2-b7a9-0002a5d5c51b/74e78e2c-c6a4-11e2-b7a9-0002a5d5c51b
2018-01-24 20:01:34.409 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Handling a new characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/74e7fe00-c6a4-11e2-b7a9-0002a5d5c51b/74e78e02-c6a4-11e2-b7a9-0002a5d5c51b
2018-01-24 20:01:34.411 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Skipping unknown characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/74e7fe00-c6a4-11e2-b7a9-0002a5d5c51b/74e78e02-c6a4-11e2-b7a9-0002a5d5c51b
2018-01-24 20:01:34.413 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Handling a new characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/74e7fe00-c6a4-11e2-b7a9-0002a5d5c51b/74e78e01-c6a4-11e2-b7a9-0002a5d5c51b
2018-01-24 20:01:34.414 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Skipping unknown characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/74e7fe00-c6a4-11e2-b7a9-0002a5d5c51b/74e78e01-c6a4-11e2-b7a9-0002a5d5c51b
2018-01-24 20:01:34.416 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Handling a new characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/74e7fe00-c6a4-11e2-b7a9-0002a5d5c51b/74e78e20-c6a4-11e2-b7a9-0002a5d5c51b
2018-01-24 20:01:34.418 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Skipping unknown characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/74e7fe00-c6a4-11e2-b7a9-0002a5d5c51b/74e78e20-c6a4-11e2-b7a9-0002a5d5c51b
2018-01-24 20:01:34.420 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Handling a new characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/74e7fe00-c6a4-11e2-b7a9-0002a5d5c51b/74e78e10-c6a4-11e2-b7a9-0002a5d5c51b
2018-01-24 20:01:34.422 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Creating channels for characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/74e7fe00-c6a4-11e2-b7a9-0002a5d5c51b/74e78e10-c6a4-11e2-b7a9-0002a5d5c51b
2018-01-24 20:01:34.435 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Handling a new characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/74e7fe00-c6a4-11e2-b7a9-0002a5d5c51b/74e78e04-c6a4-11e2-b7a9-0002a5d5c51b
2018-01-24 20:01:34.437 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Skipping unknown characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/74e7fe00-c6a4-11e2-b7a9-0002a5d5c51b/74e78e04-c6a4-11e2-b7a9-0002a5d5c51b
2018-01-24 20:01:34.439 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Handling a new characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/74e7fe00-c6a4-11e2-b7a9-0002a5d5c51b/74e78e03-c6a4-11e2-b7a9-0002a5d5c51b
2018-01-24 20:01:34.441 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Skipping unknown characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/74e7fe00-c6a4-11e2-b7a9-0002a5d5c51b/74e78e03-c6a4-11e2-b7a9-0002a5d5c51b
2018-01-24 20:01:34.442 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Handling a new characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/0000180a-0000-1000-8000-00805f9b34fb/00002a26-0000-1000-8000-00805f9b34fb
2018-01-24 20:01:34.444 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Creating channels for characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/0000180a-0000-1000-8000-00805f9b34fb/00002a26-0000-1000-8000-00805f9b34fb
2018-01-24 20:01:34.446 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Handling a new characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/0000180a-0000-1000-8000-00805f9b34fb/00002a27-0000-1000-8000-00805f9b34fb
2018-01-24 20:01:34.448 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Creating channels for characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/0000180a-0000-1000-8000-00805f9b34fb/00002a27-0000-1000-8000-00805f9b34fb
2018-01-24 20:01:34.451 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Handling a new characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/0000180a-0000-1000-8000-00805f9b34fb/00002a24-0000-1000-8000-00805f9b34fb
2018-01-24 20:01:34.453 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Creating channels for characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/0000180a-0000-1000-8000-00805f9b34fb/00002a24-0000-1000-8000-00805f9b34fb
2018-01-24 20:01:34.455 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Handling a new characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/0000180a-0000-1000-8000-00805f9b34fb/00002a29-0000-1000-8000-00805f9b34fb
2018-01-24 20:01:34.457 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Creating channels for characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/0000180a-0000-1000-8000-00805f9b34fb/00002a29-0000-1000-8000-00805f9b34fb
2018-01-24 20:01:34.459 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Handling a new characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/0000180f-0000-1000-8000-00805f9b34fb/00002a19-0000-1000-8000-00805f9b34fb
2018-01-24 20:01:34.461 [INFO ] [ooth.handler.BluetoothChannelBuilder] - Creating channels for characteristic: /XX:XX:XX:XX:XX:XX/ED:89:14:A1:50:3A/0000180f-0000-1000-8000-00805f9b34fb/00002a19-0000-1000-8000-00805f9b34fb
2018-01-24 20:01:34.470 [INFO ] [tooth.handler.BluetoothDeviceHandler] - Updating the thing with new channels

Looking at the sources the binding is not so verbose :slight_smile: but definitely I don’t see in the logs any info regarding updates. Either they are not logged or updates do not happen.

Hi @druciak,

This is normal for RSSI to stay unchanged when the device is connected. This is a specific of Bluez (generic transport). When connected, RSSI is not changing. BlueGiga transport works slightly in a different way, you can get RSSI even when connected.

The binding is only a wrapper around Java Bluetooth Manager, so you will need to enable debug level (in karaf console) for this package:

openhab> log:set DEBUG org.sputnikdev.bluetooth.manager.impl

Please enable it and share logs. Please record them from the beginning, e.g. when you start adding your device from the inbox.

BTW, have you shut down your python script?

Here you go: bt1.xml (15.4 KB)

Yes, I have disabled it.

Ok… Looks like notifications for the temp and humidity channel get enabled, but for some strange reason the bt manager does not receive them…

2018-01-24 20:53:05.937 [INFO ] [ager.impl.CharacteristicGovernorImpl] - Enable characteristic notifications: /00:1A:7D:DA:71:11/ED:89:14:A1:50:3A/74e7fe00-c6a4-11e2-b7a9-0002a5d5c51b/74e78e10-c6a4-11e2-b7a9-0002a5d5c51b

Before we dug further, would that be possible to upgrade your Bluez (to v5.47)? Like here: https://github.com/sputnikdev/bluetooth-manager-tinyb#building-bluez-from-sources. Or any other way, maybe your package manager can do it automatically…

Just wanted to reduce some “unknown” things in the chain.

@druciak, can you jump into a gitter chat? https://gitter.im/sputnikdev/eclipse-smarthome-bluetooth-binding
It would be jus easier to troubleshoot…

Hello @vkolotov,
As promised here are the undefined GATT characteristics:

22:38:48.998 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "DFU Control Point" does not have either Value or Fields tags, therefore reading the such characteristic will not be possible.
22:38:49.057 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "DFU Packet" does not have either Value or Fields tags, therefore reading the such characteristic will not be possible.
22:38:54.852 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "Bond Management Control Point" is not valid neither for read nor for write operation due to unfulfilled requirements: read ([Conditional]) write ([Conditional]).
22:38:56.663 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "CGM Measurement" is not valid neither for read nor for write operation due to unfulfilled requirements: read ([C3]) write ([C3, C1, C2]).
22:38:56.791 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "CGM Session Run Time" is not valid neither for read nor for write operation due to unfulfilled requirements: read ([C1]) write ([C1]).
22:38:56.880 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "CGM Session Start Time" is not valid neither for read nor for write operation due to unfulfilled requirements: read ([C1]) write ([C1]).
22:38:57.069 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "CGM Specific Ops Control Point" is not valid neither for read nor for write operation due to unfulfilled requirements: read ([C1]) write ([C1]).
22:38:57.145 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "CGM Status" is not valid neither for read nor for write operation due to unfulfilled requirements: read ([C1]) write ([C1]).
22:38:57.613 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "Cycling Power Control Point" is not valid neither for read nor for write operation due to unfulfilled requirements: read ([Optional, C1, C2]) write ([Optional, C1, C2]).
22:38:58.121 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "Cycling Power Measurement" is not valid neither for read nor for write operation due to unfulfilled requirements: read ([C3, C4, C5, Optional, C1, C2]) write ([C3, C4, C5, Optional, C1, C2]).
22:38:58.449 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "Cycling Power Vector" is not valid neither for read nor for write operation due to unfulfilled requirements: read ([Optional, C1, C2]) write ([Optional, C1, C2]).
22:38:58.940 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "Descriptor Value Changed" does not have either Value or Fields tags, therefore reading the such characteristic will not be possible.
22:39:02.318 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "LN Control Point" is not valid neither for read nor for write operation due to unfulfilled requirements: read ([Optional, C1, C2]) write ([Optional, C1, C2]).
22:39:02.721 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "Location and Speed Characteristic" is not valid neither for read nor for write operation due to unfulfilled requirements: read ([Optional, C1]) write ([Optional, C1]).
22:39:03.355 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "Navigation" is not valid neither for read nor for write operation due to unfulfilled requirements: read ([Optional]) write ([Optional]).
22:39:03.503 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "Object Action Control Point" does not have either Value or Fields tags, therefore reading the such characteristic will not be possible.
22:39:03.546 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "Object Changed" does not have either Value or Fields tags, therefore reading the such characteristic will not be possible.
22:39:03.751 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "Object List Control Point" does not have either Value or Fields tags, therefore reading the such characteristic will not be possible.
22:39:03.795 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "Object List Filter" does not have either Value or Fields tags, therefore reading the such characteristic will not be possible.
22:39:03.897 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "Object Properties" does not have either Value or Fields tags, therefore reading the such characteristic will not be possible.
22:39:04.059 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "OTS Feature" does not have either Value or Fields tags, therefore reading the such characteristic will not be possible.
22:39:04.882 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "Position Quality" is not valid neither for read nor for write operation due to unfulfilled requirements: read ([Optional]) write ([Optional]).
22:39:05.828 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "SC Control Point" is not valid neither for read nor for write operation due to unfulfilled requirements: read ([C3, C1, C2]) write ([C3, C1, C2]).
22:39:06.683 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "TDS Control Point" does not have either Value or Fields tags, therefore reading the such characteristic will not be possible.
22:39:08.272 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "User Control Point" does not have either Value or Fields tags, therefore reading the such characteristic will not be possible.

I finally got my hands on cheap keyfinders (iTAG) but i get this error upon connecting and none of the services are listed for device on paper UI:

22:50:33.418 [ERROR] [tooth.manager.impl.DeviceGovernorImpl] - Execution error of a service resolved listener
java.lang.NullPointerException: null
    at org.sputnikdev.esh.binding.bluetooth.handler.BluetoothChannelBuilder.getAcceptedItemType(BluetoothChannelBuilder.java:135) ~[?:?]
    at org.sputnikdev.esh.binding.bluetooth.handler.BluetoothChannelBuilder.buildChannel(BluetoothChannelBuilder.java:98) ~[?:?]
    at org.sputnikdev.esh.binding.bluetooth.handler.BluetoothChannelBuilder.buildChannels(BluetoothChannelBuilder.java:85) ~[?:?]
    at org.sputnikdev.esh.binding.bluetooth.handler.BluetoothChannelBuilder.buildChannels(BluetoothChannelBuilder.java:73) ~[?:?]
    at org.sputnikdev.esh.binding.bluetooth.handler.BluetoothDeviceHandler.servicesResolved(BluetoothDeviceHandler.java:121) ~[?:?]
    at org.sputnikdev.bluetooth.manager.impl.CombinedDeviceGovernorImpl$DeviceGovernorHandler.lambda$notifyServicesResolved$13(CombinedDeviceGovernorImpl.java:746) ~[?:?]
    at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerUtils.lambda$safeForEach$3(BluetoothManagerUtils.java:71) ~[?:?]
    at java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:891) ~[?:?]
    at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerUtils.safeForEach(BluetoothManagerUtils.java:69) ~[?:?]
    at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerUtils.safeForEachError(BluetoothManagerUtils.java:50) ~[?:?]
    at org.sputnikdev.bluetooth.manager.impl.CombinedDeviceGovernorImpl$DeviceGovernorHandler.notifyServicesResolved(CombinedDeviceGovernorImpl.java:745) ~[?:?]
    at org.sputnikdev.bluetooth.manager.impl.CombinedDeviceGovernorImpl$DeviceGovernorHandler.lambda$servicesResolved$0(CombinedDeviceGovernorImpl.java:611) ~[?:?]
    at org.sputnikdev.bluetooth.manager.impl.ConcurrentBitMap.set(ConcurrentBitMap.java:131) ~[?:?]
    at org.sputnikdev.bluetooth.manager.impl.ConcurrentBitMap.exclusiveSet(ConcurrentBitMap.java:100) ~[?:?]
    at org.sputnikdev.bluetooth.manager.impl.CombinedDeviceGovernorImpl$DeviceGovernorHandler.servicesResolved(CombinedDeviceGovernorImpl.java:609) ~[?:?]
    at org.sputnikdev.bluetooth.manager.impl.DeviceGovernorImpl.lambda$notifyServicesResolved$2(DeviceGovernorImpl.java:427) ~[?:?]
    at java.util.concurrent.CopyOnWriteArrayList.forEach(CopyOnWriteArrayList.java:891) ~[?:?]
    at org.sputnikdev.bluetooth.manager.impl.DeviceGovernorImpl.notifyServicesResolved(DeviceGovernorImpl.java:424) ~[?:?]
    at org.sputnikdev.bluetooth.manager.impl.DeviceGovernorImpl$ServicesResolvedNotification.notify(DeviceGovernorImpl.java:621) ~[?:?]
    at org.sputnikdev.bluetooth.manager.impl.DeviceGovernorImpl$ServicesResolvedNotification.notify(DeviceGovernorImpl.java:609) ~[?:?]
    at org.sputnikdev.bluetooth.manager.transport.tinyb.TinyBDevice.lambda$null$6(TinyBDevice.java:167) ~[?:?]
    at org.sputnikdev.bluetooth.manager.transport.tinyb.TinyBFactory.lambda$notifySafely$0(TinyBFactory.java:154) ~[?:?]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
    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) [?:?]

I finally upgraded my system and bluez to 5.47, but on this version it is even worse. The binding does not recognize additional channels, even though folder with provided by you characteristics is provided in the configuration. Not sure what to do next, how to solve this issue.

hi @druciak, Bluez should not affect your “extension folder”. Could you please share logs? BTW, could you please try your python script first, to make sure that Bluez is working at all.

My scirpt is working. The files are in right place. Logs attached.
bt2.xml (14.1 KB)

Hi @druciak, looks like it is not attempting to connect to your device. Can you please check if you have enabled “connection control” on the thing?

Weird, I just entered to bluetoothctl app to check if I am able to connect to the station and the binding started working.
However no progress comparing to 5.43. The thing has new channels, for the basic ones like RSSI, Manufacturer, etc it shows some data, but not for these additional ones - temperature, humidity, etc

Hey guys, I’m working on adding support for Xiaomi devices (miflora, temp and humid etc). By the look of the android app guts, it turns out that they use their own proprietary authentication mechanism. It is a simple three step process, mostly can be easily reproduced. However, on the step 3 they generate a security token (the way how it is done is clear) and then encrypt it with a native library (JNI, calling a function on token). I tried to make use of that shared library on my test machine (linux x86_64), it looks like android libs are not compatible with any other linux distros.

Is there anyone who can decode a c++ lib? I’ve uploaded that lib here: https://onlinedisassembler.com/odaweb/2HGV9u0L/0. There are three methods we need to know what they do:
Java_com_xiaomi_smarthome_bluetooth_security_BLECipher_nativeEncrypt
Java_com_xiaomi_smarthome_bluetooth_security_BLECipher_nativeMixA
Java_com_xiaomi_smarthome_bluetooth_security_BLECipher_nativeMixB

I’m not a big expert in ASM, but it does not look very complex… anyone is keen to take up a challenge?