3rd Party Bluetooth Binding. Beta testers needed

Hi Vlad.
I have updated openhab to milestone M5. After this i have problems by changing the update intervall of bluetooth items. If i change from 10 to 15 seconds, all adapters and devices goes to uninitialised.
A restart gives the fix.
But the bigger problem is the cpu load, which goes up from 2% to 6-8%. When i deinstall all bindings, not the bluetooth binding, nothing changes. If i deinstall the bluetooth binding, the cpu load goes directly down.
Thanks for help and greetings,
Markus

Hi Vlad

Concerning the changing MAC adresses oh phone (point 4/ issue 17) of your post, i would be really interested.

You mentioned you found a workaround, but for me it seems still the same (always new Items showing up in Inbox when the phone is “securing itself”).

I saw your codechange of issue 17 but of course dont understand it :slight_smile:

Could you elaborate a bit ?

Thanks - And thumbsUp, Great Binding !!!

Hi @Dibbler42, good stuff, thanks for that.

I’ve adde a new ticket for you: https://github.com/sputnikdev/eclipse-smarthome-bluetooth-binding/issues/70

Could you please follow this ticket https://github.com/sputnikdev/eclipse-smarthome-bluetooth-binding/issues/68#issuecomment-437703326. Just try to do the same thing. We will need to identify what interface your machine has. Take a screenshot, post it to your ticket.

Hi @curlyel, very interesting, how many bluegiga dongles you have? What’s your set up? I see
“VMWare” thingy in the logs, do you run it in a virtualisation container?

Hi @haesslo, it should work now. Sorry I have not updated documentation for this feature as I wanted to develop/test it more. However you can try it now and help me with testing this feature.

  1. Give a unique name in your iphone (device or bluetooth properties), e.g. something like “haesslo iphone 123”.
  2. You will need to install an app that will make your phone to keep bluetooth alway on. This one is a good start: https://itunes.apple.com/nz/app/nrf-connect/id1054362403?mt=8

Go to “Advertiser” tab, tap on “+” button to add a new service (advertising packet). Set a name to it (does not matter what). Add an advertising record “Complete Local Name”. Add a scan response data “Complete Local Name”, tick “Scannable” checkbox. Like that:

Then enable that advertiser rule (a switch) in the app.

  1. Wait until you see your phone in OH inbox, then add this device from the inbox.
    In your OH inbox, do you should see your iphone recognised as “beacon device”? For example:

    Once beacon device is added, the binding will monitor your phone by using that unique name, e.g. it will ignore MAC address at all.

Let me know how it goes.

To everyone here, if you are interested in presence detection using your phone, please jump into testing of this feature as I posted above.

Please note, as you may notice, the binding will use your device name instead of MAC address, this means that it is not secure by any means ;).

There are some thoughts/plans to use an advertised service value instead of device name. This would make it a bit harder to spoof, however still won’t be secure enough to use it as something that controls your entrance door. However, we could come up with an app that would encode and change the value dynamically and the bind would read it and check/verify, but this is a different story that requires app development and some changes in the binding.

Hi Vlad,

Well, currently I have five BLED112, but just three of them are currently connected for testing. For now, they are connected to the same (powered) USB hub. For the later deployment I hope for general Serial-over-IP availability to have all my serial stuff (bluetooth, zigbee, zwave, …) distributed via network:


UPDATE: I’ve just read again through the linked thread. Seems to be available yet in the latest snapshots, but bindings have to be adopted to deal with possible connection drops/reconnects. Are you aware of that already for the Bluegiga-transport?

Yes. It’s a virtual machine on ESXi 6.5 which get’s the USB ports passed through.

Operating system is Debian 9 with manual openHABian script-install (2.4-M5 as said above…)

Hi Vlad

I tried your App on my Android (A moto G5 running Android7) and it seems to be missing the “scannable” option.

I had a bit hard times to idntify my phone as quite some devices around here usually.
But if I change the name it shortly shows up as beacon even under its correct name, but has problem connecting as you can see here:

Any good idea how to solve that ?

Hi @curlyel, this sounds interesting. The binding should recover connection drops, that was the main idea of this binding to recover from disasters. Looking forward to seeing some test results in using that new serial-over-ip binding, that would be very helpful.

Hey @haesslo, this might indicate that you’ve got some symbols that are not allowed by binding (yet). Could you please try to use something simple, e.g. “Moto G 5 c” (without parentheses)?

Hey @curlyel, it is quite difficult to debug/troubleshoot your issues with stolen serial ports :slight_smile: I’m just thinking would that be sufficient for your case if I added a new config that effectively stops discovery process for bluegiga adapters? You will be able to disable adapter discovery once you have added them.

Hi Vlad

You are the man… :slight_smile:

That solved the problem.

Already jumping at the next features…Estimated distance seems to work somehow, is it normal to your experience, that this has quite a latency (I moved it from right next to my Raspberry a couple of meters away and it took around 4-5 minutes to slowly step up to the final distance) ?

Thanks for quick response. … I will see how it goes in “real life” and keep you posted.

Nope, it is not normal. Check what you have here:


Make sure it (“Received signal strength indication (RSSI) filter”) is set to “fast” or “moderate”.

Sure, would be great to block grabbing foreign ports.

Again:

Due to your question I decided to quickly setup some test system on bare metal instead of a VM just to check if VMWare/ESXi causing some oddity. Operating system is different architecture (Armbian Stretch instead of stock x64 Debian because of the ARM board I’ve used).
Java runtime, OpenHAB and Bluetooth binding are the same like in the VM.

Have to admit: It works now for quite some hours (over night) without loosing any of the Bluegiga’s :wink:

Maybe the VMWare USB passtrough introduced some issues here?

The tiny ARM board is doing well so far but is considerably burdened already while just having the Bluetooth and the Zigbee binding active. It runs with 10 to 20 percent CPU (it’s an ARM A7 quad core, 1.5 GHz, 2GB ram).

Currently discovered (and permanently updated) are:

  • 3 Bluegiga dongles
  • 2 Xiaomi FlowerCare
  • 2 Xiaomi thermometer
  • 1 beacon
  • 1 Zigbee dongle
  • 2 zigbee sensors

This will need some time to test this too. Does the binding accept

rfc2217://<ipadr>:<port>

as serial port input already?

I see no difference with the new version. Same problem.

For now I put this on hold until I’ve moved to my new home and every room has its own BT adapter.

Hi Vlad

I am excited by the binding. Works for me with MiFlora and with the beacon app on the phone!

Of course I am immediatly looking further.
For now I am using arduino like chips (ESP12, ESP32) for some of my sensors (like light, tempreature, motion…) using MQTT over Wifi, but it would be much nicer (integration, power consumption…) if I could use the esp32 (an arduino like chip with BLE) together with your binding.

So i played around and made the ESP32 advertise and being recognized by your binding:

I also get it to read an attribute in bluetoothctl:
Attempting to read /org/bluez/hci0/dev_30_AE_A4_26_3D_82/service0028/char0029
[CHG] Attribute /org/bluez/hci0/dev_30_AE_A4_26_3D_82/service0028/char0029 Value: 0x68
[CHG] Attribute /org/bluez/hci0/dev_30_AE_A4_26_3D_82/service0028/char0029 Value: 0x69
[CHG] Attribute /org/bluez/hci0/dev_30_AE_A4_26_3D_82/service0028/char0029 Value: 0x20
[CHG] Attribute /org/bluez/hci0/dev_30_AE_A4_26_3D_82/service0028/char0029 Value: 0x68
[CHG] Attribute /org/bluez/hci0/dev_30_AE_A4_26_3D_82/service0028/char0029 Value: 0x61
[CHG] Attribute /org/bluez/hci0/dev_30_AE_A4_26_3D_82/service0028/char0029 Value: 0x65
[CHG] Attribute /org/bluez/hci0/dev_30_AE_A4_26_3D_82/service0028/char0029 Value: 0x73
[CHG] Attribute /org/bluez/hci0/dev_30_AE_A4_26_3D_82/service0028/char0029 Value: 0x73
[CHG] Attribute /org/bluez/hci0/dev_30_AE_A4_26_3D_82/service0028/char0029 Value: 0x6c
[CHG] Attribute /org/bluez/hci0/dev_30_AE_A4_26_3D_82/service0028/char0029 Value: 0x6f
68 69 20 68 61 65 73 73 6c 6f hi haesslo

But now I am kind of stuck how your binding would read this attribute/link it to a channel in openhab ?

Any chance we could get this going … ?

Have a look here: https://github.com/sputnikdev/eclipse-smarthome-bluetooth-binding/blob/master/gatt-extensions.md

Happy to help you. Please create a ticket on github so we do not pollute this thread.

Hi Vlad, Interesting developments you have done thusfar. Excellent job.
I’m currently testing BT Phone presence (i have access to both Android and Iphone).
No need for getting actual data or connect to them.
The OH binding works fine as long as the devices are set to discoverable.
Is there a way to get the presence detected without the devices being in discover mode.
The Bleuz tool : l2ping is able to do exactly this.
I have put a issue in Github for adding similar functionality in your bindings.
Let me know if I can help testing.

1 Like