i upgraded to 2.5.3 ,installed bluetooth binding 2.5.3 snapshot but i think something is wrong with my system.I get nothing at my PaperUi inbox.If i install the 3rd party market binding + tinyb binding i get a bluez bluetooth adapter and then i can scan for bluetooth devices.When i add a bluez adapter manually ,i set the right bt mac of my Rpi at binding settings ,and when i add the thing i get
Status: UNINITIALIZED - HANDLER_INITIALIZING_ERROR BlueZ JNI connection cannot be established.
The official bluetooth binding doesn’t currently have the full functionality that the 3rd party binding does, so you won’t see channels other than RSSI and maybe a battery channel. I’m working on it though!
From what I remember, the reason that the older versions were recommended is because the newer ones chose to hide certain gatt characteristics (battery level iirc) from getting queried the traditional way. Due to that the older BlueZ versions are considered a more faithful implementation of the bluetooth stack.
It might also be that tinyb does not work with the newer version anyway but I don’t know myself since I never bothered trying the newer version first.
Feel free to give it a shot and let us know how it goes!
I’m currently using dbus and bluez v5.47. But I’ve also had my setup use dbus v5.5 and bluez v5.47, more or less on accident, it actually worked fine but I reverted back in order to try and fix an issue that ultimately wasn’t caused by the newer version at all.
Holy crap 2 days later I got it to work with this! More specifically though, I updated to the latest snapshot, did this fix, and added the thing below and am now seeing my Bluetooth adapter show up in PaperUI. It did automatically discover bluetooth devices so that’s a great sign. (I’m only trying to get bluetooth people presence functionality.) I’ll try playing around with getting the presence to work next, and report back. But anyone have any existing guides for next steps?
BTW I have “openhab-distro: 2.5.4-snapshot, build #73”. I’m still pretty new to openhab, and especially snapshots so hope I did this right. And I’m hoping this shapshot/build has your latest Binding fixes.
Do you happen to have a URL with a changelog for your specific updates? Settings, etc? Or anything that could be helpful? I’m assuming the existing documentation is out of date, or especially not relevant to this snapshot. Thanks!
I don’t really have any meaningful URL I can point your towards since at this moment the bluetooth binding is rather bare of features since most of my work up until this point has just been fixing bugs. Right now the binding is stable and robust, but the extensions the only real useful aspect of the binding ATM. The generic beacon binding might be enough for you to work with if you get creative with rules.
But fret not! I have a PR in the works that will allow bluetooth device location to be tracked if you have multiple bluetooth adapters. It is the first of many feature enhancements that I have in mind.
This is my first time using this. Again, I’m hoping to use this just for presence detection.
That said, I was able to search for things in the PaperUI Inbox, and added my phone as a Thing. My phone then showed ONLINE. Then I turned bluetooth on my phone off for a minute, then back on. PaperUI never showed it as ONLINE since. Its been a couple hours. I restarted my phone, still never showed up as ONLINE.
What are the expectations of this binding, and as I indicated above my snapshot (am I even using your recent updates?!?), should what I’m trying to do show my phone as ONLINE a few minutes later? Or am I supposed to do something else? Or am I doing this all wrong?.. Or did I find a bug?
Presence detection won’t work for phones since they randomly generate their mac address and change it every couple of minutes or so.
Phones do this for security reasons so I can’t complain about it. Just turning on bluetooth won’t work for presence detection but I think there are apps you can download that make you phone act like a bluetooth beacon though.
Good news, I just finished writing my first draft of the roaming bluetooth device feature which allows a device to be tracked across multiple bluetooth adapters and keep track of which adapter it is closest to.
I need volunteers to be guinea pigs for testing since I lack any bluetooth beacons to test with, and the outbreak has made it difficult to obtain them.
This feature should mimic the feature from the 3rd party bluetooth binding. The only difference is that you need to add a Roaming Bluetooth Adapter thing which will appear in the inbox in order to activate the feature. This new adapter will act as a virtual bridge for bluetooth devices. So when devices are discovered you need to pick the discovered device for the roaming adapter.
To test this feature you need to uninstall the official bluetooth binding and upload these jars to the addons directory:
In researching, and personal testing, I found the random mac is an issue with iphones, not Android (I only have Android phones), so I’m hoping this will work for me.
I’m struggling to find an Android beacon app that works with this, can anyone make any recommendations?
However, I found that not using any phone beacon app, I can get 2 Android phones to report their rssi values several times (even after reboots, etc), but ONLY while the phone is in pair mode (making itself discoverable I believe). Is this expected? Restarting the phone and turning the bluetooth on and off does NOT trigger any rssi events to openhab (but again, putting the phone is pair mode then gets rssi events to show up in openhab for a couple minues). I’m not quite sure if this is a configuration issue on my end, my 2 phones, the Bluetooth Binding, or openhab itself (or a beacon app is required).
BTW I’m using openhab logs to troubleshoot this and determine the rssi events.
Would your latest fix address any of this by any chance?
To do the update, where do we put the jars (pi 4/raspbian/Debian)? And do we first need to uninstall anything?
I’ve been playing around with “Beacon Simulator” for Android. It allows you to create simulated advertising beacons such as ibeacon, eddystone, & altbeacon. I tried creating several but nothing is recognized in PaperUi via a search in the inbox. The are a lot of seeing for these beacons tho that I don’t understand. Is this expected or should these be showing up? I’m testing it this way because if this does show up & work with openhab then I could potentially use this as a beacon on my phone to do the presence detection. Thanks!
UPDATE: Just reporting that BlueZ version 5.43 & 5.50 works with this. (ie, sudo apt-get update & sudo apt-get upgrade will not break this if going to 5.50)