3rd Party Bluetooth Binding. Beta testers needed

Further to @simatic issue report.

You don’t have to connect to a device if you are planning to use “Presence detection” or “Indoor Positioning” features only. You can control connection through the bluetooth “thing”, just “untick” the checkbox (btw, it is unticked by default):

@vkolotov: Great Binding, nice job :slight_smile:

@kubawolanin: I had the same error, checked all steps from the Bluez installation, than reboot the rpi3 and the error is gone.

But i’am not complete ready, now.
Openhab find the Bluetooth Adapter and showes these Online, but find no devices.
hcitool find Samsung S7 and iBeacon.

Also manuel search don’t find any bluetooth device.

Tomorrow i will test again.

Hi @Marcello87, thank you for your report.

Have you actually enabled “discovery” on the adapter thing? Like that:

Only after enabling the “discovery control” on the adapter thing the bluetooth discovery process will begin and you will see bluetooth devices in the inbox.

PS. that’s probably another thing to be improved, probably it should be enabled by default.

I’m getting the same errors with @Simsal. When i turn off discovery, i can’t turn it back on. The log entry below is repeating.

01:34:36.047 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'bluetooth:adapter:B827EBF41C67' changed from OFFLINE to ONLINE
01:34:36.368 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'bluetooth:adapter:B827EBF41C67' changed from ONLINE to OFFLINE
01:34:41.404 [WARN ] [.impl.AbstractBluetoothObjectGovernor] - Could not update governor state.
org.sputnikdev.bluetooth.manager.NotReadyException: Could not power adapter
	at org.sputnikdev.bluetooth.manager.impl.AdapterGovernorImpl.updatePowered(AdapterGovernorImpl.java:218) ~[?:?]
	at org.sputnikdev.bluetooth.manager.impl.AdapterGovernorImpl.update(AdapterGovernorImpl.java:65) ~[?:?]
	at org.sputnikdev.bluetooth.manager.impl.AdapterGovernorImpl.update(AdapterGovernorImpl.java:42) ~[?:?]
	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) [?:?]
[bluetooth]# show
Controller B8:27:EB:F4:1C:67 (public)
	Name: raspi-zero
	Alias: raspi-zero
	Class: 0x00000000
	Powered: yes
	Discoverable: no
	Pairable: yes
	UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
	UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)
	Modalias: usb:v1D6Bp0246d0530
	Discovering: no

This is using bluez 5.48 on raspberry pi zero wireless…

Thanks for your report @sozkara, could you also please let me know what OS you are using and what version of OH? I’ll try to install that thing on raspberry pi zero and see how it goes. Although I’m not sure if it is a good idea to use PI Zero as it is really low spec board…

It also might be due to the new version of Bluez, from what I can see in the release notes, they have implemented another bunch of “improvements and bugfixes” :smile:. My current version of Bluez is 5.47, that’s what I use for testing as it must be more stable and included by default in major linux distributions.

Hi All,

I’ve tried to install the new Bluez version - v5.48. A lot of things broken. I also had “Could not power adapter” as well. But the worst thing is - not all GATT services now getting resolved, for example battery service (https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.battery_service.xml) does not get resolved any more. Who know what else wrong… I do not recommend to upgrade to 5.48 as obviously there are some changes that TinyB library does not support yet. I’ll create some bug reports for both Bluez and TinyB projects, will see how it goes.

So if you are on Bluez 5.48, please downgrade it to 5.47 using this instructions: https://github.com/sputnikdev/bluetooth-manager-tinyb#prerequisites
@sozkara @Simsal

Hi @vkolotov ,
I’m running OH 2.3.0 snaphot Version: 2.3.0~20180107033436-1 on raspbian jessie. uname shows me this line:

Linux raspi-zero 4.9.75+ #1074 Mon Jan 8 13:59:41 GMT 2018 armv6l GNU/Linux

Although it may seem underpowered, rPi Zero Wireless gets the job done with low power requirements. :slight_smile: It may be slow to start OH2 but after that, it’s really ok.

I’ll post back here once i compile the 5.47 version and use it. Though i have to mention that i had problems with 5.43 version also.

@vkolotov

Your tip was right…

I dont set the items for the bluetooth adapter thing. Now i could start the discovering an it works without any problems/errors.

Hope this binding will be standard in the openhab 2 installation, its great!

My S7 was recognized only on the first attempt and in Paper UI my S7 was displayed with the status online. After switching the Bluetooth off and on again on the phone, my phone was no longer recognized as online. No matter what I tried on the phone.

Hi @Steffen_M, could you please let me know if you still can see some other bluetooth devices like you’ve seen before?

If you see the other devices, then it might be something wrong with your phone. Are you able to provide openhab logs so I can try to troubleshoot?

Thanks,
Vlad

I’m glad that it is working for you @Marcello87.

Unfortunately (or fortunately) this binding will never be a part of the standard installation due to some “political” reasons.
This binding is just a wrapper around an open source library (Java Bluetooth Manager): GitHub - sputnikdev/bluetooth-manager: Java Bluetooth Manager. A library/framework for managing bluetooth adapters, bluetooth devices, GATT services and characteristics. I did not want to merge the source code of this library into the Eclipse SmartHome source repository which is a requirement to be included into the official SmartHome distro. If you think about that, it really makes sense and fair enough, the SmartHome supportes/developers need to have a full control of the internal stuff. However, as a supporter of opensource freedom, I decided to keep it available to any project as I believe it can be useful outside of the SmartHome.

Nevertheless, being in the Eclipse MarketPlace gives you more freedom. We can do releases as often as we want, so the improvements will be released more often than the SmartHome itself.

3 Likes

Eclipse SmartHome and openHAB2 are separate so even if you don’t want to contribute all the source code to the ESH project you could still release the binding as an official OH2 binding.

3 Likes

But it’s the eclipse licence what you “sign” even when you publish something under OH.

Or is there something that I missed?

It is not about accepting or not code.
Addon author want to develop some code as independant libraries.
Here you can find my frustration about the situation as well as disscussion.

In the beginning, I was a bit frustrated and disappointed that the Binding is not going to be included in the official distribution, especially after so much effort I’ve put in this. However, I changed my mind and I believe that it is fair enough that @Kai and the rest of the team require the code (especially API) to be a part of SmartHome source repository. Obviously you have to have some control over source code so that you can make the system robust and prevent chaotic and uncontrolled changes. Furthermore, the dev team provided sufficient mechanisms (like Eclipse MarketPlace) to give some options for the binding developers. I think that to be in the MarketPlace is actually not too bad, we’ve got more control over release cycle and (yet!) the core of the binding (Bluetooth Manager) is still available for other people/project to be used outside of the SmartHome.

PS. Let’s focus on the betta testing and avoid political topics :slight_smile:

7 Likes

@vkolotov

Today I received my BlueGiga: BLED112

After creating an accout at Silicon Labs and downloading the Windows Driver, I was able to install it.

image

Then I switched on “BT Discovering Control”:

image

Now I want to detect my smartphone, a Samsung Galaxy S5 (BT 4.0).

I installed a “Beacon Simulator” APP. But I’m not sure if I configured it correct.

image

Could it be, that this "Beacon Simulator creates a random MAC-Address everytime you start to broadcast?

1 Like

Hi @Celaeno1, good news, you are the very first one who reported a bluegiga adapter. And it is a good news that the binding is able to detect your adapter.

Not sure about your beacon emulation app, but you are right, make sure that the app always advertises the same MAC address, otherwise it would be pretty much useless.

Try different apps, there are lots of them in the market. Make also sure that it continues advertising even if the app in the background or your device is in standby mode (screen off).

1 Like

Looks like not everyone reading the readme. Apart from the presence detection, the binding supports many more features. I’ve updated the main post with some descriptions of what it can do.

Thanks for this great binding, which opens many new possibilities :-).

Works well using the Raspberry 3’s internal bluetooth adapter and a G-Tag.

I tried up to 10 different APPs. None of them provide a continuous MAC-Address. Maybe it also depends on my Smartphone or Android OS?
Could you please recommend a special APP with this feature included?
Or someone else can do that?