3rd Party Bluetooth Binding. Beta testers needed

Has anyone / author looked at HA communities solutions and experiences?

Its a shell script based solution, I am no expert on BT, but I feel that thread could help improve our solution.

2 Likes

I’ve been using the binding for a while and it appears to work fine with the Xaiomi BT Temp&Humidity Sensor.

But I noticed lately that the binding isn’t detecting new BT devices.

When I run sudo systemctl status bluetooth

I see:
“Can’t store name for private addressed device /org/bluez/hci0/dev_…” I truncated the BT Mac of the Device it’s getting stuck on. It’s random which device it gets stuck on.

Over and over. I’m running Blue-Z 5.47.

Is the author or any devs still supporting this binding? If not then we need to ask for volunteers.

If i remeber right you should use the 5.43 version, please check the installation instruktion

As far as i know is @vkolotov Vlad still working on the binding and giving support. Why are you asking? There is no service level on answering questions.

Excellent!! Everything going well in your opinion then?
I just made a rough guess that this binding is sufficiently large and complex, the author might need a few helping hands. We should ask for it.

I think a helping hand is always welcome and i thinl on vlads todo list are a lot of topics. So offer your help i am sure it will be appreciated

1 Like

I am always here. I do want to help OH users in general. Thats why I asked for volunteer devs, bcause I am myself no expert nor a fan of BT. :slight_smile:

5.47 is the recommended version to be running as per the instructions on the git. 5.43 should work but it had problems of it’s own and Vlad recommended 5.47.

1 Like

Hello @vkolotov. That is getting us somewhere;

2018-08-26 11:35:30.097 [WARN ] [th.manager.impl.BluetoothManagerImpl] - Disposing Bluetooth manager: 161d3a2
2018-08-26 11:35:45.333 [DEBUG] [manager.transport.tinyb.TinyBFactory] - Loading native libraries from the bundle. Environment: linux : arm
2018-08-26 11:35:45.337 [DEBUG] [anager.transport.tinyb.NativesLoader] - OS name: linux; OS arch: arm
2018-08-26 11:35:45.339 [DEBUG] [anager.transport.tinyb.NativesLoader] - isLinux: true; isARM6: true; isX86_64: false; isX86_32: false
2018-08-26 11:35:45.342 [DEBUG] [manager.transport.tinyb.TinyBFactory] - The environment is supported.
2018-08-26 11:35:45.345 [DEBUG] [manager.transport.tinyb.TinyBFactory] - Preparing libtinyb.so native library
2018-08-26 11:35:45.347 [DEBUG] [anager.transport.tinyb.NativesLoader] - Preparing libtinyb.so native library
2018-08-26 11:35:45.350 [DEBUG] [anager.transport.tinyb.NativesLoader] - Library path: /native/arm/armv6/libtinyb.so
2018-08-26 11:35:45.354 [DEBUG] [anager.transport.tinyb.NativesLoader] - Creating a temporary file: /var/lib/openhab2/tmp/tinyb219332828894690488libs/libtinyb.so
2018-08-26 11:35:45.357 [DEBUG] [anager.transport.tinyb.NativesLoader] - Temporary file has been created. Copying the library to that file.
2018-08-26 11:35:45.384 [DEBUG] [anager.transport.tinyb.NativesLoader] - The library has been prepared to be loaded: /var/lib/openhab2/tmp/tinyb219332828894690488libs/libtinyb.so
2018-08-26 11:35:45.387 [DEBUG] [manager.transport.tinyb.TinyBFactory] - Loading libtinyb.so native library: /var/lib/openhab2/tmp/tinyb219332828894690488libs/libtinyb.so
2018-08-26 11:35:45.444 [DEBUG] [manager.transport.tinyb.TinyBFactory] - Could not load bundled TinyB native libraries.
java.lang.UnsatisfiedLinkError: /var/lib/openhab2/tmp/tinyb219332828894690488libs/libtinyb.so: libglib-2.0.so.0: cannot open shared object file: No such file or directory

snip

2018-08-26 11:35:45.451 [INFO ] [manager.transport.tinyb.TinyBFactory] - TinyB: environment is not supported out of the box. Attempting to load system libs.
2018-08-26 11:35:45.454 [DEBUG] [manager.transport.tinyb.TinyBFactory] - Loading native library from class path: tinyb
2018-08-26 11:35:45.457 [DEBUG] [manager.transport.tinyb.TinyBFactory] - TinyB: Could not load system libraries. Thus, environemnt is not supported. Only Linux OS; x86, x86_64 and arm6 architectures are supported out of the box. Consider providing own tinyb. in one of :/var/lib/openhab2/lib:/usr/share/openhab2/runtime/lib:/usr/java/packages/lib/arm:/usr/lib/arm-linux-gnueabihf/jni:/lib/arm-linux-gnueabihf:/usr/lib/arm-linux-gnueabihf:/usr/lib/jni:/lib:/usr/lib
java.lang.UnsatisfiedLinkError: no tinyb in java.library.path

libglib is installed though:

||/ Name Version Architecture Description
++±=============================================-===========================-===========================-================================================================================================
ii libglib2.0-0:arm64 2.48.2-0ubuntu4 arm64 GLib library of C routines
ii libglib2.0-bin 2.48.2-0ubuntu4 arm64 Programs for the GLib library
ii libglib2.0-data 2.48.2-0ubuntu4 all Common files for GLib library
ii libglib2.0-dev 2.48.2-0ubuntu4 arm64 Development files for the GLib library
un libglib2.0-doc (no description available)

/lib/aarch64-linux-gnu/libglib-2.0.so.0 is it’s location

1 Like

I believe we use Java 32 bit on ARM. Can you make sure 32 bit libs and JVM are installed on your device? If possible remove 64 bit Java, if not, at least start openhab with 32-bit Java.
What is the hardware and OS?

Is any one using this with Tile tags? I can see them, but don’t know how to identify their MAC address.

hi David, I’m using a Tile Mate, and it works OK.

Keep ‘connection-control’ turned off, and detect activity on the ‘online’ channel. It won’t stay connected/authenticated, for me anyway.

PS: I’ve tried a few different tags, and the one working best for me are the cheap iTags - which do connect/authenticate (when ‘connection-control’ is turned on).

Linux odroid64 3.14.79-117 #1 SMP PREEMPT Tue Jan 2 23:46:30 BRST 2018 aarch64 aarch64 aarch64 GNU/Linux
openhab@odroid64:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial
openhab@odroid64:~$ java -version
openjdk version “1.8.0_181”
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13)
OpenJDK Client VM (build 25.181-b13, mixed mode)
openhab@odroid64:~$ java -d64 -version
Error: This Java instance does not support a 64-bit JVM.
Please install the desired version.

I’m running on a Odroid C2, Odroid’s own 64bit Ubuntu image. 32bit java.

Change to Oracle or Zulu Java version.
OpenJDK ist not recommended.

No buddy. openJDK won’t work. Try Azul Systems Zulu or Oracle’s JDK, 32 bit.
e.g on my rasp pi

openhabian:/opt/openhab2 $ java -version
openjdk version "1.8.0_152"
OpenJDK Runtime Environment (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 1.8.0_152-b76)
OpenJDK Client VM (Zulu Embedded 8.25.0.76-linux-aarch32hf) (build 25.152-b76, mixed mode, Evaluation)

Sorry guys, I was out of action here. But I’ve got good news, I’ve managed to implement a workaround for iPhones and modern android phones that change their mac all the time. I’ll be cutting a new RC soon. Also, I’ll catch up with questions.

4 Likes

Hello,

as quite a newbie to openHAB and Linux I am having some trouble setting up bluetooth-manager-tinyb. So I’d be very greatfull, if someone could give me a hint.
I am using a pi2 with a Bluetooth stick and openhabian 2.3

I am stuck with this step: “Edit Bluez DBus config to add a permission to access Bluez for the bluetooth group (/etc/dbus-1/system.d/bluetooth.conf)”

When trying to edit the conf file with nano I can not save the changes due to missing permissions. So I tried to edit the file via samba and a Windows PC. But I can’t find the path /etc/dbus-1/system.d/bluetooth.conf. Using the search function I do find a
bluetooth.conf file at a different location on my pi with the exact same content. But editing this one does obviously not affect the file I am supposed to change.

Any Ideas?

You should start anano with the following coamnd which grants root privilegues to nano and then you should be able to save your datat.

sudo nano /etc/dbus-1/system.d/bluetooth.conf

Thaks a lot! That was it. Should have thought of it.

Even though I am feelig dumb to ask again, I still can’t get it going.

When restarting bluetooth I get this error:

[19:45:49] openhabian@openHABianPi:~$ sudo systemctl restart bluetooth
Job for bluetooth.service failed because the control process exited with error code.
See "systemctl status bluetooth.service" and "journalctl -xe" for details.
● bluetooth.service - Bluetooth service
   Loaded: loaded (/lib/systemd/system/bluetooth.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2018-08-29 19:30:35 CEST; 15min ago
     Docs: man:bluetoothd(8)
  Process: 4413 ExecStart=/usr/libexec/bluetooth/bluetoothd (code=exited, status=1/FAILURE)
 Main PID: 4413 (code=exited, status=1/FAILURE)
   Status: "Starting up"

Aug 29 19:30:35 openHABianPi systemd[1]: Starting Bluetooth service...
Aug 29 19:30:35 openHABianPi bluetoothd[4413]: Bluetooth daemon 5.47
Aug 29 19:30:35 openHABianPi bluetoothd[4413]: D-Bus setup failed: Connection ":1.18" is not allowed to own the service "org.bluez" due to security policies in the configuration file
Aug 29 19:30:35 openHABianPi systemd[1]: bluetooth.service: Main process exited, code=exited, status=1/FAILURE
Aug 29 19:30:35 openHABianPi systemd[1]: Failed to start Bluetooth service.
Aug 29 19:30:35 openHABianPi systemd[1]: bluetooth.service: Unit entered failed state.
Aug 29 19:30:35 openHABianPi systemd[1]: bluetooth.service: Failed with result 'exit-code'.

What could I be doing wrong?