Official Bluetooth Binding: Not working correctly in OH 2.4 stable or wrong docs?

Tags: #<Tag:0x00007f61701e6e18>

I have a hard time to get along with the official and even “featured” bluetooth binding:
grafik

The documentation says that it offers support for the Blue Giga Adapter and Blukii devices:
grafik

Unfortunately I cannot connect to my Blue Giga Adapter with the binding. When I look at the supported things in PaperUI I cannot find the Blue Giga Adapter:

The documentation for the section Blue Giga says that it cannot be discovered, but that the serial port needs to be set manually:
grafik

However, WHERE in the world can I set the serial port for the Adapter? And how can I add it at all?

I found however an example of a thing file in the documentation for the Adapter:
grafik

As I am running OH an Windows I modified the things-file to

Bridge bluetooth:bluegiga:1 [ port="COM9", discovery=false ]

However, the Adapter will not show at all and cannot be discovered.

HOW IS THIS SUPPOSED TO WORK?

The adapter as such works fine (outside OH) and I can also add it to OH when I install the marketplace bluetooth binding by @vkolotov . So how to add it with the officially featured binding?
I ordered the adapter and blukii sensors for > 200€ because of the official docs for a featured binding on page one of the official doc pages and now start to wonder if this is not really supported?

Glad for any help!

@vossivossi

I’m on Windows, too. And I have EXACTLY the SAME problem with the BlueGiga and “official bluetooth binding”. And I did exactly the same (mine is “COM3”) :wink:. And I rebooted my complete system. The “3rd party bluetooth binding” is running fine.

EDIT: I do NOT have both BT bindings in parallel!

Got it someone else running on Windows?

image

But where is the Bluetooth BlueGiga Adapter ?

Hopefully only missing in the description??

I found a workaround to get the bluegiga stick to work with the official bluetooth binding (at least a little bit as it still does not work really reliable).
The problem is that if you install the offical Bluetooth Binding via PaperUIn then OH will install all parts of the Bluetooth Binding (like BlueZ, Blukii) except the BlueGiga-Binding:

My workaround is to use the Addon-jar-File where the BlueGiga-Binding is included and drop this manually in the Addon-Folder. After this we can see in Karaf Console that the BlueGiga-Binding has been added:

However you will additionally have to install the Serial Binding in order to get the BlueGiga-Stick as an option. After installation of the Serial Binding you now can add the BlueGiga as a new thing:

BUT: After a restart of OH the stick is always shown as offline. It helps if you just change the thing configuration in PaperUI and change for example the location. After saving the thing the stick suddenly becomes alive again (which I consider a severe bug). The same is unfortunately also true for all the BT devices connected to the stick. You will have to change each thing manually and save it in order to bring it back online.

My conclusion (tested today with newest Snapshot 1502): The “official” Bluetooth Binding has HUGE GAPS and is not really more than beta if you try to use it on Windows with a BlueGiga-Stick.

Compared to this the “unoffcial” 3rd party bleutooth binding by @vkolotov is lightyaers ahead.
It supports the stick flawlessly and offers much more functionality and stability like

  • Much more channels offered that reduce the nasty work of writing tons of rules for each thing (like last update time stamp, nearest adapter etc.)
  • Automatic recovery after the BT stick was removed and replugged. While the “official” Bluetooth Binding will remain offline (unless you manually restart) the 3rd party binding recovers by itself seconds after replugging the stick (tested on Windows 10).

I feel highly confused that an official binding which is furthemore presented as “featured” binding prominently on the OH Webpage is actually just an uncomplete, unstable and not well documented beta. On the other hand I would like to highly praise the efforts of @vkolotov , who really shows how a binding should look like.

2 Likes

Thanks for reporting. I’m going to try it tomorow.

@vossivossi

You’re right, but I didn’t download the .jar file…
.

Here are my steps to reproduce:
.

adding the following entries to addons.cfg:

 binding = serial1,bluetooth

after this, in karaf console:

feature:list |Grep blue

esh-binding-bluetooth                       │ 0.11.0.SNAPSHOT  │          │ Started     │ openhab-addons-2.5.0-SNAPSHOT        │
esh-binding-bluetooth-bluegiga              │ 0.11.0.SNAPSHOT  │ x        │ Uninstalled │ openhab-addons-2.5.0-SNAPSHOT        │
esh-binding-bluetooth-bluez                 │ 0.11.0.SNAPSHOT  │          │ Started     │ openhab-addons-2.5.0-SNAPSHOT        │
esh-binding-bluetooth-blukii                │ 0.11.0.SNAPSHOT  │          │ Started     │ openhab-addons-2.5.0-SNAPSHOT        │
openhab-binding-bluetooth                   │ 2.5.0.SNAPSHOT   │ x        │ Started     │ openhab-addons-2.5.0-SNAPSHOT        │ Bluetooth Binding

Then in karaf console:

feature:install esh-binding-bluetooth-bluegiga

In karaf console:

feature:list |Grep bluegiga

esh-binding-bluetooth-bluegiga              │ 0.11.0.SNAPSHOT  │ x        │ Started     │ openhab-addons-2.5.0-SNAPSHOT        │

.
.

In PaperUI, then I was able to add and configure the Bluegiga adapter:


.
.

The restart of the OH server (service), I’m going to do this this evening!

UPDATE: I’ve restarted OH Server. I had a different behavior. Adapter was ONLINE again. Then I’ve switched “Device Discovery” from OFF to ON. Now. Adapter is “UNKNOWN” and stays there!!

I also did some testing and have the same issues. The stick and the other bluetooth things only work for short time and then go to undefined states. The binding is really not usable at the moment…

1 Like

@vossivossi

Here is the error log:

2019-01-18 17:48:43.523 [thome.event.ExtensionEvent] - Extension 'binding-bluetooth' has been installed.

2019-01-18 17:55:23.538 [hingStatusInfoChangedEvent] - 'bluetooth:bluegiga:ff3d7ae1' changed from UNINITIALIZED to INITIALIZING
2019-01-18 17:55:23.631 [INFO ] [uegiga.handler.BlueGigaBridgeHandler] - Connected to serial port 'COM3'.
2019-01-18 17:55:23.650 [hingStatusInfoChangedEvent] - 'bluetooth:bluegiga:ff3d7ae1' changed from INITIALIZING to UNKNOWN
2019-01-18 17:55:23.817 [hingStatusInfoChangedEvent] - 'bluetooth:bluegiga:ff3d7ae1' changed from UNKNOWN to ONLINE
2019-01-18 17:55:23.849 [me.event.ThingUpdatedEvent] - Thing 'bluetooth:bluegiga:ff3d7ae1' has been updated.

2019-01-18 17:55:24.659 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'bluetooth:beacon:ff3d7ae1:1e3eec4e1ef2' to inbox.
2019-01-18 17:55:24.660 [home.event.InboxAddedEvent] - Discovery Result with UID 'bluetooth:beacon:ff3d7ae1:1e3eec4e1ef2' has been added.

2019-01-18 18:09:11.612 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'bluetooth:beacon:ff3d7ae1:21454357b666' to inbox.
2019-01-18 18:09:11.613 [home.event.InboxAddedEvent] - Discovery Result with UID 'bluetooth:beacon:ff3d7ae1:21454357b666' has been added.

2019-01-18 18:10:30.833 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'bluetooth:beacon:ff3d7ae1:46cd2e24e843' to inbox.
2019-01-18 18:10:30.834 [home.event.InboxAddedEvent] - Discovery Result with UID 'bluetooth:beacon:ff3d7ae1:46cd2e24e843' has been added.

2019-01-18 18:18:47.843 [me.event.InboxRemovedEvent] - Discovery Result with UID 'bluetooth:beacon:ff3d7ae1:1e3eec4e1ef2' has been removed.
2019-01-18 18:18:50.489 [me.event.InboxRemovedEvent] - Discovery Result with UID 'bluetooth:beacon:ff3d7ae1:21454357b666' has been removed.
2019-01-18 18:18:52.964 [me.event.InboxRemovedEvent] - Discovery Result with UID 'bluetooth:beacon:ff3d7ae1:46cd2e24e843' has been removed.

2019-01-18 18:25:11.207 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'bluetooth:beacon:ff3d7ae1:3f85c9af363f' to inbox.
2019-01-18 18:25:11.208 [home.event.InboxAddedEvent] - Discovery Result with UID 'bluetooth:beacon:ff3d7ae1:3f85c9af363f' has been added.

2019-01-18 18:26:45.372 [INFO ] [g.discovery.internal.PersistentInbox] - Added new thing 'bluetooth:beacon:ff3d7ae1:6a9c94d84fb6' to inbox.
2019-01-18 18:26:45.373 [home.event.InboxAddedEvent] - Discovery Result with UID 'bluetooth:beacon:ff3d7ae1:6a9c94d84fb6' has been added.

2019-01-18 18:26:55.173 [me.event.InboxRemovedEvent] - Discovery Result with UID 'bluetooth:beacon:ff3d7ae1:3f85c9af363f' has been removed.
2019-01-18 18:26:57.859 [me.event.InboxRemovedEvent] - Discovery Result with UID 'bluetooth:beacon:ff3d7ae1:6a9c94d84fb6' has been removed.

Switching "Device Discovery OFF"

2019-01-18 18:27:32.682 [me.event.ThingUpdatedEvent] - Thing 'bluetooth:bluegiga:ff3d7ae1' has been updated.
2019-01-18 18:27:32.708 [INFO ] [uegiga.handler.BlueGigaBridgeHandler] - Connected to serial port 'COM3'.
2019-01-18 18:27:32.720 [hingStatusInfoChangedEvent] - 'bluetooth:bluegiga:ff3d7ae1' changed from ONLINE to UNKNOWN

Stopping OH service…

2019-01-18 18:30:10.684 [hingStatusInfoChangedEvent] - 'bluetooth:bluegiga:ff3d7ae1' changed from UNKNOWN to UNINITIALIZED
2019-01-18 18:30:11.812 [hingStatusInfoChangedEvent] - 'bluetooth:bluegiga:ff3d7ae1' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)

.
SERVER RESTART

2019-01-18 18:34:15.232 [hingStatusInfoChangedEvent] - 'bluetooth:bluegiga:ff3d7ae1' changed from UNINITIALIZED to INITIALIZING
2019-01-18 18:34:15.292 [INFO ] [uegiga.handler.BlueGigaBridgeHandler] - Connected to serial port 'COM3'.
2019-01-18 18:34:15.312 [hingStatusInfoChangedEvent] - 'bluetooth:bluegiga:ff3d7ae1' changed from INITIALIZING to UNKNOWN
2019-01-18 18:34:46.028 [hingStatusInfoChangedEvent] - 'bluetooth:bluegiga:ff3d7ae1' changed from UNKNOWN to ONLINE

.
Switching "Device Discovery ON"

2019-01-18 18:58:33.545 [me.event.ThingUpdatedEvent] - Thing 'bluetooth:bluegiga:ff3d7ae1' has been updated.
2019-01-18 18:58:33.572 [INFO ] [uegiga.handler.BlueGigaBridgeHandler] - Connected to serial port 'COM3'.
2019-01-18 18:58:33.579 [hingStatusInfoChangedEvent] - 'bluetooth:bluegiga:ff3d7ae1' changed from ONLINE to UNKNOWN

2019-01-18 19:00:14.117 [hingStatusInfoChangedEvent] - 'bluetooth:bluegiga:ff3d7ae1' changed from UNKNOWN to UNINITIALIZED
2019-01-18 19:00:14.637 [hingStatusInfoChangedEvent] - 'bluetooth:bluegiga:ff3d7ae1' changed from UNINITIALIZED to UNINITIALIZED (DISABLED)

2019-01-18 19:00:19.108 [hingStatusInfoChangedEvent] - 'bluetooth:bluegiga:ff3d7ae1' changed from UNINITIALIZED (DISABLED) to INITIALIZING
2019-01-18 19:00:19.134 [INFO ] [uegiga.handler.BlueGigaBridgeHandler] - Connected to serial port 'COM3'.
2019-01-18 19:00:19.143 [hingStatusInfoChangedEvent] - 'bluetooth:bluegiga:ff3d7ae1' changed from INITIALIZING to UNKNOWN

2019-01-18 19:02:42.146 [hingStatusInfoChangedEvent] - 'bluetooth:bluegiga:ff3d7ae1' changed from UNKNOWN to UNINITIALIZED
2019-01-18 19:02:42.661 [hingStatusInfoChangedEvent] - 'bluetooth:bluegiga:ff3d7ae1' changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2019-01-18 19:02:54.404 [hingStatusInfoChangedEvent] - 'bluetooth:bluegiga:ff3d7ae1' changed from UNINITIALIZED (HANDLER_MISSING_ERROR) to INITIALIZING
2019-01-18 19:02:54.433 [INFO ] [uegiga.handler.BlueGigaBridgeHandler] - Connected to serial port 'COM3'.
2019-01-18 19:02:54.439 [hingStatusInfoChangedEvent] - 'bluetooth:bluegiga:ff3d7ae1' changed from INITIALIZING to UNKNOWN

.
.

Summary:
.

  1. Installation of Bluetooth Binding (and later Bluegiga Adapter by manually installing with feature:install …)
  2. Went to ONLINE
  3. Detected some bluetooth devices
  4. I removed them manually from inbox
  5. Switching “Device detection OFF”
  6. Went to UNKNOWN
  7. Server Restart
  8. Went to ONLINE again
  9. Switching “Device detection ON”
  10. Went to UNKNOWN