3rd Party Bluetooth Binding. Beta testers needed

Just installed it and so far it detects my iphone without a problem !

1 Like

Just install on RPi 3(openhabian) and nothing happens((

Hi @None_No, could you please let me know if you followed the instructions?

Have you installed the TinyB Transport extension?
Please also check what Bluez version you are running:

1 Like

bluez is already the newest version (5.43-2+rpt2+deb9u2).

[12:12:10] openhabian@openHABianPi:~$ sudo systemctl status bluetooth
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset
Active: active (running) since Tue 2018-01-09 01:22:26 MSK; 10h ago
Docs: man:bluetoothd(8)
Main PID: 494 (bluetoothd)
Status: "Running"
CGroup: /system.slice/bluetooth.service
└─494 /usr/lib/bluetooth/bluetoothd

Jan 09 01:22:26 openHABianPi systemd[1]: Starting Bluetooth service…
Jan 09 01:22:26 openHABianPi bluetoothd[494]: Bluetooth daemon 5.43
Jan 09 01:22:26 openHABianPi systemd[1]: Started Bluetooth service.
Jan 09 01:22:26 openHABianPi bluetoothd[494]: Starting SDP server
Jan 09 01:22:26 openHABianPi bluetoothd[494]: Bluetooth management interface 1.1
Jan 09 01:22:26 openHABianPi bluetoothd[494]: Failed to obtain handles for "Serv
Jan 09 01:22:26 openHABianPi bluetoothd[494]: Sap driver initialization failed.
Jan 09 01:22:26 openHABianPi bluetoothd[494]: sap-server: Operation not permitte
lines 1-17/17 (END)
● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2018-01-09 01:22:26 MSK; 10h ago
Docs: man:bluetoothd(8)
Main PID: 494 (bluetoothd)
Status: "Running"
CGroup: /system.slice/bluetooth.service
└─494 /usr/lib/bluetooth/bluetoothd

Jan 09 01:22:26 openHABianPi systemd[1]: Starting Bluetooth service…
Jan 09 01:22:26 openHABianPi bluetoothd[494]: Bluetooth daemon 5.43
Jan 09 01:22:26 openHABianPi systemd[1]: Started Bluetooth service.
Jan 09 01:22:26 openHABianPi bluetoothd[494]: Starting SDP server
Jan 09 01:22:26 openHABianPi bluetoothd[494]: Bluetooth management interface 1.14 initialized
Jan 09 01:22:26 openHABianPi bluetoothd[494]: Failed to obtain handles for “Service Changed” characteristic
Jan 09 01:22:26 openHABianPi bluetoothd[494]: Sap driver initialization failed.
Jan 09 01:22:26 openHABianPi bluetoothd[494]: sap-server: Operation not permitted (1)
~
~
~
~
~
~

Here is what happens with TinyB
2018-01-09 12:16:43.944 [ERROR] [th.manager.impl.BluetoothManagerImpl] - Adapter discovery job error

java.lang.RuntimeException: Error getting object manager client: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type=“method_call”, sender=":1.70" (uid=109 pid=552 comm="/usr/bin/java -Dopenhab.home=/usr/share/openhab2 -") interface=“org.freedesktop.DBus.ObjectManager” member=“GetManagedObjects” error name="(unset)" requested_reply=“0” destination=":1.3" (uid=0 pid=494 comm="/usr/lib/bluetooth/bluetoothd ")

at tinyb.BluetoothManager.getNativeAPIVersion(Native Method) ~[235:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.0.0]

at tinyb.BluetoothManager.getBluetoothManager(BluetoothManager.java:304) [235:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.0.0]

at org.sputnikdev.bluetooth.manager.transport.tinyb.TinyBFactory.getDiscoveredAdapters(TinyBFactory.java:121) [235:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.0.0]

at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerImpl$AdapterDiscoveryJob.discoverAdapters(BluetoothManagerImpl.java:538) [236:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.0.0]

at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerImpl$AdapterDiscoveryJob.run(BluetoothManagerImpl.java:531) [236:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.0.0]

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

I am running on Ubuntu 17.10 x64, with a Broadcom BCM20702A1 USB adapter, with bluez version 5.46 (if there’s anything else you need to know, please ask - I’m a bit of a linux newbie so just let me know any commands you would like the output from)

I have been able to get the adapter running, detected in the Inbox and have added it as a Thing, but it is not detecting any bluetooth devices, either automatically, or via a manual scan.

Edit: I just wasn’t close enough to the adapter… my walls are obviously thicker than I thought! It’s found my phone OK :slight_smile:

Item Linking only in Simple Mode ? Is it possible to link manually my Items?

My Bluetooth Devices arrives Tomorrow, the Binding comes @ the right time … first a planned to used a Raspberry to track … but the Binding takes it all in one :slight_smile:

41

1 Like

Solved with this
Edit Bluez DBus config to add a permission to access Bluez for the bluetooth group (/etc/dbus-1/system.d/bluetooth.conf):









Add openhab user to the bluetooth group:
sudo usermod -a -G bluetooth openhab
Reload service definitions:
sudo systemctl daemon-reload
Restart bluez:
sudo systemctl restart bluetooth

@vkolotov Great job! :slight_smile:

I have a question. I use Windows and want to be able to recognize “Bluetooth Classic” (=BR/EDR) as well. But if I understand your matrix correctly, this will only work with linux. Correct?

                                   Generic  BlueGiga
Windows	                              -	       Y
Linux	                              Y	       Y
Mac	                                  -	       Y
X86 32bit	                          Y	       Y
X86 64bit	                          Y	       Y
ARM v6 (Raspberry PI)	              Y	       Y
Adapters autodiscovery	              Y	       Y
Adapter aliases	                      Y        -
Device aliases	                      Y	       -
BLE devices support	                  Y	       Y
BR/EDR devices support (legacy BT)	  Y	       -

So, under Windows, all my BT devices must have at least 4.0 (BLE)?

If I buy a BlueGiga, do I have to deactivate my embedded BT adapter?

EDIT: If I buy a “Silicon Labs BlueGiga BLED112-V1”, do they all have the same specifications or are there models without BGAPI support?

It looks like it does not work so well with the iphone. After adding the item, the item also goes online, but after 30 seconds of timeout it immediately goes offline again, although it still exists. After turning Bluetooth on and off (iphone), the item stays offline.

I think the bluetooth of the iphone does not permanently send a sign of life, but that’s actually the strength of Bluetooth LE?

My phone is also only showing as Online if I have Visibility enabled - as soon as the Visibility times out, it goes Offline.

1 Like

Yes that is normal … but iPhone only visible if the Bluettooh Settings are opened up…
I think there are no other Settings to visible all time …

1 Like

Tomorow my Bluetooth Tags arrives … I think thats the better Solution for Presence and worked better because they all-time visible :slight_smile:

To get it worked with iPhone or other Devices that not all-time visible for Pairing … I think they must be paired with they Bluetooth Apdater … but thats the next Problem… the RaspberryPi seen not to provide any Profile that worked with iPhone :wink: Perhaps we can adapt an Profile eg. Audio … but than connects the iPhone Audio to raspberry … thats no solution I think :wink:

But I also have too little idea of the whole, these are all just guesses

1 Like

Some Warning after Reboot

16:42:52.918 [INFO ] [smarthome.event.ItemStateChangedEvent] - IPhone7_Location changed from NULL to Bluetooth Adapters
16:42:53.003 [INFO ] [smarthome.event.ItemStateChangedEvent] - IPhone7_LastUpdated changed from NULL to 2018-01-09T14:58:12.445+0100
16:42:56.099 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "DFU Control Point" does not have either Value or Fields tags, therefore reading the such characteristic will not be possible.
16:42:56.115 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "DFU Packet" does not have either Value or Fields tags, therefore reading the such characteristic will not be possible.
16:42:56.601 [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]).
16:42:56.728 [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]).
16:42:56.743 [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]).
16:42:56.759 [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]).
16:42:56.794 [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]).
16:42:56.811 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "CGM Status" is not valid neither for read nor for write operation due to unfulfilled requirements: read ([C1]) write ([C1]).
16:42:56.888 [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]).
16:42:56.955 [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]).
16:42:56.986 [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]).
16:42:57.091 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "Descriptor Value Changed" does not have either Value or Fields tags, therefore reading the such characteristic will not be possible.
16:42:57.795 [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]).
16:42:57.877 [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]).
16:42:58.432 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "Navigation" is not valid neither for read nor for write operation due to unfulfilled requirements: read ([Optional]) write ([Optional]).
16:42:58.458 [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.
16:42:58.468 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "Object Changed" does not have either Value or Fields tags, therefore reading the such characteristic will not be possible.
16:42:58.799 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "Position Quality" is not valid neither for read nor for write operation due to unfulfilled requirements: read ([Optional]) write ([Optional]).
16:42:58.996 [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]).
16:42:59.183 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "TDS Control Point" does not have either Value or Fields tags, therefore reading the such characteristic will not be possible.
16:42:59.414 [WARN ] [spec.BluetoothGattSpecificationReader] - Characteristic "User Control Point" does not have either Value or Fields tags, therefore reading the such characteristic will not be possible.
16:42:59.690 [INFO ] [ome.event.ThingStatusInfoChangedEvent] - 'bluetooth:generic:XXXXXXXXXXXX' changed from UNINITIALIZED to INITIALIZING
16:42:59.744 [WARN ] [e.core.thing.binding.BaseThingHandler] - BaseThingHandler.initialize() will be removed soon, ThingStatus can be set manually via updateStatus(ThingStatus.ONLINE)

Maybe someone else knows this?

iPhone not regonize as BLE Device.

07

@None_No, I’m glad you have resolved your issue. Unfortunately there are so many moving parts in the Bluetooth world, the Bluetooth binding consists of 80% of code that it responsible for making it more stable…

Yes, it is possible.

I’ve got similar keyfob devices, it is working quite well.

1 Like

Hi @vkolotov,

I’ve installed the TinyB transport bundle along with the binding.
Downloaded and built BlueZ from sources on my Raspberry Pi 3.
Followed the whole tutorial.
But still I’m receiving the following errors constantly:

2018-01-09 19:47:01.901 [ERROR] [th.manager.impl.BluetoothManagerImpl] - Adapter discovery job error

java.lang.RuntimeException: Error getting object manager client: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type="method_call", sender=":1.103" (uid=109 pid=27533 comm="/usr/bin/java -Dopenhab.home=/usr/share/openhab2 -") interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" error name="(unset)" requested_reply="0" destination=":1.6" (uid=0 pid=24888 comm="/usr/libexec/bluetooth/bluetoothd ")

	at tinyb.BluetoothManager.getNativeAPIVersion(Native Method) ~[269:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.0.0]

	at tinyb.BluetoothManager.getBluetoothManager(BluetoothManager.java:304) [269:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.0.0]

	at org.sputnikdev.bluetooth.manager.transport.tinyb.TinyBFactory.getDiscoveredAdapters(TinyBFactory.java:121) [269:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.0.0]

	at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerImpl$AdapterDiscoveryJob.discoverAdapters(BluetoothManagerImpl.java:538) [270:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.0.0]

	at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerImpl$AdapterDiscoveryJob.run(BluetoothManagerImpl.java:531) [270:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.0.0]

	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-09 19:47:07.043 [ERROR] [th.manager.impl.BluetoothManagerImpl] - Device discovery job error

java.lang.RuntimeException: Error getting object manager client: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type="method_call", sender=":1.104" (uid=109 pid=27533 comm="/usr/bin/java -Dopenhab.home=/usr/share/openhab2 -") interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" error name="(unset)" requested_reply="0" destination=":1.6" (uid=0 pid=24888 comm="/usr/libexec/bluetooth/bluetoothd ")

	at tinyb.BluetoothManager.getNativeAPIVersion(Native Method) ~[269:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.0.0]

	at tinyb.BluetoothManager.getBluetoothManager(BluetoothManager.java:304) [269:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.0.0]

	at org.sputnikdev.bluetooth.manager.transport.tinyb.TinyBFactory.getDiscoveredDevices(TinyBFactory.java:127) [269:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth.transport.tinyb:1.0.0]

	at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerImpl$DeviceDiscoveryJob.discoverDevices(BluetoothManagerImpl.java:503) [270:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.0.0]

	at org.sputnikdev.bluetooth.manager.impl.BluetoothManagerImpl$DeviceDiscoveryJob.run(BluetoothManagerImpl.java:496) [270:org.sputnikdev.org.eclipse.smarthome.binding.bluetooth:1.0.0]

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

These are literally flooding my logs.

Cheers

Hi @Celaeno1,

Yes, unfortunately BlueGiga dongles can only work with BLE enabled devices. However, there is a workaround if you are planning to use your phone with the Bluetooth binding. You can install a Bluetooth Beacon app that should force you phone to start advertising BLE packets, so that the Bluetooth Binding should start recognising your phone as a BLE enabled device.

No, you don’t have to deactivate your embedded/internal BT adapter. Furthermore, if you are running linux, you can use both types of adapters simultaneously.

All BLED112 devices support BGAPI.

Please let me know how it goes for you.

1 Like

That is normal. Some mobile phones do not allow you to keep your phone in “discoverable” state. As you have notice, your iphone stops advertising after 30 secs or so, the same thing happens for some android phones. Not all of the mobile phones stop Bluetooth advertising btw, it really depends on the manufacturer of your phone.

There is a workaround for this, you can install a Beacon emulation app that should force your phone to keep advertising BLE packets. In this case the Bluetooth binding should recognise your phone as a BLE enabled device.

Please let me know if it works for you.

@Confused ^^