Can not connect to BLE device on raspberry pi (gatttool/bluetoothctl) - bluetooth

like the title says, i am not able to connect to a le device on my raspberry pi 3.
I tried:
- via bluetoothctl i get an AutenthicationFailure
- via gatttool i get connection refused (111)
I searched a lot for a solution and already tried (made sure that):
- btmgmt le up
- reinstalling bluez/bluez to the newest version
- use of "-t random" when using gatttool
And know i really have no idea what to do next.
What might be important:
uname -r = 4.19.58-v7+
bluetoothctl -v = 5.50
Using the Android App nRF Connect the connection to the le device works fine.
Can somebody help me please?
Thanks in advance,
Magda

It looks like your device needs to be bonded and Bluez fails to successfully bond...
I have the same issue with several devices that need bonding. Bluez can apparently only deal with some variants of bonding but certainly not all. On iOS and Android I have no issues at all with those devices...
Unless you fancy digging into Bluez source code and fixing the issue yourself, I think you can only wait for some Bluez update to fix the issue...

Related

Just Works pairing with BlueZ

I'm trying to pair from a Linux host (ARM based, Angstrom distribution) to a MCU driven embedded device using BLE Just Works Secure Connection. As a device I'm currently using an ESP32 dev kit flashed with the GATT security example. However, so far my tries weren't successful and I failed to find the according documentation, either.
I managed to pair my Android smartphone with the device, so pairing on the device side, in general, seems to work. I also tried to conduct the pairing without a Secure Connection (setting Authorization Request to SP_LE_AUTH_BOND) which worked with bluetoothctl or btmgmt.
I'm grateful for any documentation pointer how to perform pairing from the command line, Python scripting or any C/C++ code.
Have a look at the answer below and the included references; these cover pairing using BlueZ/Linux:-
Raspberry Pi BLE Encryption/Pairing
If this still doesn't work, please launch "btmon" on another terminal before starting the pairing process as that will give you an indication as to what is going wrong.
I hope this helps.

PulseAudio Bluetooth Speaker crash on Raspberry Pi

I just bought a JBL speaker, tested it on my phone and proceeded with this tutorial on my Raspberry Pi:
https://www.raspberrypi.org/magpi/bluetooth-audio-raspberry-pi-3/
I managed to pair and trust the speaker, but I can't connect to the device from bluetoothctl, only from audio settings.
Problem is, most of the times it doesn't work. I've managed to have audio for 3 seconds in a timespan of ... 4 hours.
This is where PulseAudio crashes:
E: [pulseaudio] bluez4-util.c: org.bluez.Manager.GetProperties() failed: org.freedesktop.DBus.Error.UnknownMethod: Method "GetProperties" with signature "" on interface "org.bluez.Manager" doesn't exist
I've tried a lot of things from forums, nothing worked.
Thank you for your help!
I had a similar problem, but then I used a USB bluetooth adaptor for connecting to my speaker, and now I get a nice stable connection all the time.
I can't be 100% sure that this will fix your problem, but give it a try. It seems that the built in bluetooth adaptor for rasp Pi 3 isn't great. I used an Asus adaptor, but if you need to buy one, you can find a list of the officially supported adaptors # https://www.raspberrypi.org/.
Stephen

When trying to connect Intel Edison BLE to CSR bluetooth dongle on pi I am getting disconnected immediately

I have done pairing of Intel Edison and pi bluetooth dongle successfully but whenever I try to connect pi from Edison I always get.
Connected Yes
Connected No
I am using bluetoothctl to connect
Try flashing an older version of the firmware. The problem seems to be with the recent update of Edison firmware.
The flashing should be done manually because, as far as I know, the wizard can only install the latest version (if you are using Windows, follow 32bit instruction on Intel website). If you found some easier way using the wizard, please share it. Thanks.

Bluetooth HFP on the Raspberry Pi

i am trying to connect my raspi with a BT-Headset with the build in bluetooth. it is working with pulseaudio 5.0 and bluez 5.23.
But the thing is it just supports A2DP. i want to use it as a real Headset so i Need HFP. I read that bluez 5 doesnt Support this Profile anymore and with pulseaudio 5 and bluez 5.23 it wont work.
Now i got a bluetoothdongle with my Headset and if i am using the bluetoothdongle instead the buildin Bluetooth it is working. i can record Sound. But i get a better Audio Output with the build in (with dongle it is lagging) . Maybe it is because the dongle uses the hfp Profile directly and therefore the Audio ouput isnt that good anymore.
So i was wondering if this is gonna work with every Bluetoothdongle which supports the HFP/HSP Profile.
And my other question is how does pulseaudio and bluez work together. and how would the BT-dongle would work with pulseaudio together?
Bluez 4 supported hfp and hsp. pulseaudio 5 is backwards compatible so this would be an Option i think. does anyone has tried it?
thanks

Unable to get connect with bluetooth in sim800

I have Sim800 modem and trying to get connected with the bluetooth of the module but when I send command AT+BTPOWER=1 it returns error so I am unable to get connected.
anyone can help in this????
Your version of Sim800 can be without supporting BT by hardware
If your module has hardware support, try to update firmware
Try command BT+STATUS? probably BT module already powered on
Came late to discussion but I must say that you have to turn it off before turning it on. If you try just setting BTPOWER=1 it'll return ERROR, at least for me.
AT+BTPOWER=1
ERROR
If I set it to 0 before setting to 1 I have success.
AT+BTPOWER=0
OK
AT+BTPOWER=1
OK

Resources