jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 29314
Joined: Sat Jul 30, 2011 7:41 pm

Re: Failed to connect: org.bluez.Error.Failed

Fri May 07, 2021 4:12 pm

piersw wrote:
Fri May 07, 2021 3:33 pm
Yeah, that's easy - I can easily drop it off somewhere central (Hills Rd?). Want to email me and we can arrange? (can you get my email from the forum?)

Thanks.
I cannot get emails, but if you email info@raspberrypi.com FAO Simon Martin and James Hughes with details, we can arrange something - if you are anywhere nr the Science Park, we are on the opposite side of Milton road, The Maurice Wilkes building. I'm not in the office at the moment, or anywhere nr Cambridge (I live in darkest Fenland) but there are people in there who also live in town and they should be able to arrange something.

EDIT: The engineer who is looking in to this would be happy to drive round and do a swap, so please contact info@ and we can arrange this.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Working in the Applications Team.

Brodax
Posts: 2
Joined: Fri May 07, 2021 3:43 pm

Re: Failed to connect: org.bluez.Error.Failed

Fri May 07, 2021 4:29 pm

I am getting the same issues here and I don't know how to fix it.
After "sudo service bluetooth restart" the controller MAC changes, but after every reboot it once again wrong.
Raspbian and Retropie causes trouble for me with my two boards

Brodax
Posts: 2
Joined: Fri May 07, 2021 3:43 pm

Re: Failed to connect: org.bluez.Error.Failed

Mon May 10, 2021 8:20 am

@Jamesh do you know how to fix the problem? Maybe this problem can be resolved temporarily if the command "sudo service bluetooth restart" can be implemented while booting the OS, or maybe right after the OS has been booted.
It seems to me like an issue which can be solved at least for now by using this command because the MAC of bluetooth controller is set to right one.
I have little to none experience regarding PI/Linux scripting.

Can you help me please?

wahsp
Posts: 1
Joined: Tue May 11, 2021 8:02 pm

Re: Failed to connect: org.bluez.Error.Failed

Tue May 11, 2021 8:08 pm

Glad to find this post here, since it shows I am not the only one with this problem. I've recently gotten a raspberry pi 4b for my birthday. I can get the bluetooth devices to work (with some pain), usually only after reseting the bluetooth system service. However, when I restart I have to start over again. Basically, like this I cannot rely on bluetooth devices.

User avatar
craigevil
Posts: 248
Joined: Wed Jan 27, 2021 5:22 am
Location: OZ

Re: Failed to connect: org.bluez.Error.Failed

Fri May 14, 2021 7:55 pm

Whatever the recent updates were BT is now working on my PI400.
My new Amazon Echo Buds even reconnect when I reboot. Audio automatically switches to them. Pretty freaking cool.

Code: Select all

System:    Kernel: 5.10.35-v8+ aarch64 bits: 64 compiler: N/A Desktop: LXDE 0.10.1 info: lxpanel, plank wm: Openbox 3.6.1 
           vt: 7 dm: LightDM 1.26.0 Distro: Raspberry Pi OS base: Debian GNU/Linux 11 (bullseye) 
Machine:   Type: ARM Device System: Raspberry Pi 400 Rev 1.0 details: BCM2835 rev: c03130 serial: <filter> 
CPU:       Info: Quad Core model: N/A variant: cortex-a72 bits: 64 type: MCP arch: ARMv8 rev: 3 bogomips: 432 
           Speed: 2000 MHz max: 2000 MHz Core speeds (MHz): 1: 2000 2: 2000 3: 2000 4: 2000 
           Features: asimd cpuid crc32 evtstrm fp 

Audio:     Device-1: bcm2835-audio driver: bcm2835_audio bus-ID: N/A chip-ID: brcm:bcm2835_audio class-ID: bcm2835_audio 
           Device-2: bcm2711-hdmi0 driver: N/A bus-ID: N/A chip-ID: brcm:soc class-ID: hdmi 
           Device-3: bcm2711-hdmi1 driver: N/A bus-ID: N/A chip-ID: brcm:soc class-ID: hdmi 
           Sound Server-1: ALSA v: k5.10.35-v8+ running: yes 
           Sound Server-2: PulseAudio v: 14.2 running: yes 

Bluetooth: Device-1: pl011 driver: uart_pl011 bus-ID: N/A chip-ID: arm:fe201000 class-ID: serial 
           Report: hciconfig ID: hci0 rfk-id: 1 state: up address: <filter> bt-v: 3.0 lmp-v: 5.0 sub-v: 6606 hci-v: 5.0 
           rev: 36 
If you need any other info let me know.
Raspberry PI 400 Raspberry Pi OS (Debian Bookworm/sid) Kernel: 5.10.63-v8+ aarch64 DE: MATE Ram 4GB
Debian - "If you can't apt install something, it isn't useful or doesn't exist"

NamezRHard
Posts: 2
Joined: Mon May 17, 2021 4:18 am

Re: Failed to connect: org.bluez.Error.Failed

Mon May 17, 2021 4:37 am

Edit: As of pi-bluetooth 0.1.16 this no longer works for me.

Hi. I've been having some issues with the bluetooth as well, and these posts helped me find a workable fix. Thank you all.

I edited the "~/.profile"

Code: Select all

sudo nano ~/.profile
And added "sudo systemctl restart bluetooth" to the end of the file. So the end of the file now looks like this.

Note: Only the last two lines were added.

Code: Select all

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

# attempt to restart bluetooth
sudo systemctl restart bluetooth
I'm pretty new to the Raspberry Pi, so there might be a better way to do this. It seems to be working for me. Hopes this helps and thanks again.

NamezRHard
Posts: 2
Joined: Mon May 17, 2021 4:18 am

Re: Failed to connect: org.bluez.Error.Failed

Tue May 18, 2021 4:47 am

Got a new fix that works with pi-bluetooth 0.1.16.

Modify the /usr/bin/btuart file.

I commented out the if-statement at the beginning so that it always assigned the BDADDR. Just add the "#" in front of the the first if, else, and fi.

Code: Select all

#if grep -q "raspberrypi,4" /proc/device-tree/compatible; then
  BDADDR=
#else
  SERIAL=`cat /proc/device-tree/serial-number | cut -c9-`
  B1=`echo $SERIAL | cut -c3-4`
  B2=`echo $SERIAL | cut -c5-6`
  B3=`echo $SERIAL | cut -c7-8`
  BDADDR=`printf b8:27:eb:%02x:%02x:%02x $((0x$B1 ^ 0xaa)) $((0x$B2 ^ 0xaa)) $((0x$B3 ^ 0xaa))`
#fi


Then do a reboot.

The "bluetoothctl show" comes back starting with the 8 now instead of the E and it works.

Hope this helps.

nidhi_menan
Posts: 1
Joined: Fri May 28, 2021 9:49 am

Re: Failed to connect: org.bluez.Error.Failed

Fri May 28, 2021 10:14 am

Unable to connect any device to my Pi 4 via bluetooth. It is showing me paring error and org.bluez.Error.Failed error. Even to remove a device it shows same error. Completely frustrated by the bluetooth capability of Pi4. Connecting keyboard, mouse, mobile phone, laptop via bluetooth have become most difficult task. Tried many solutions and not getting exactly what I want i.e. getting connected via bluetooth to my Pi4. After the effort of a week or so now I am able to connect at times that too when I reboot or restart my system. Level of frustration no one can imagine is there. No idea why they have given bluetooth compatibilty when it is not working properly.
Connecting via bluetooth to Pi4 should be as simple as we connect two mobile phone via bluetooth.
Kindly ask for any other information needed but solve my issue.
One of these two error I am getting while connecting : paring error and org.bluez.Error.Failed

RedMarsBlueMoon
Posts: 275
Joined: Mon Apr 06, 2020 3:49 am

Re: Failed to connect: org.bluez.Error.Failed

Sun Jul 25, 2021 11:56 pm

I'm also getting this Error I can't connect a specific device to the Pi's bluetooth.
Another device Connects.

Did anyone come up with a solution to this issue??

UPDATE:
After some re-installing and going slowly step by step I have identified the(my?) problem as happening like this:

This BREAKS Sony game controller bluetooth connectability,
but make the Bluetooth Audio Headphones connect correctly.

Code: Select all

sudo nano /etc/systemd/system/bluetooth.target.wants/bluetooth.service
to....
ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=sap --plugin=a2dp
and

This BREAKS Bluetooth Audio Headphones connectability,
but makes the Sony game controller connect correctly.

Code: Select all

sudo nano /etc/systemd/system/bluetooth.target.wants/bluetooth.service
to....
ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=sap

The missing link being the a2dp plugin.
Is there a way around this to make both the Sony game controller work at the same time as the bluetooth headphones?

Is there a different protocol (or whatever it is) than a2dp that can be used for the audio?

prestoforresto
Posts: 6
Joined: Wed Jul 21, 2021 3:54 pm

Re: Failed to connect: org.bluez.Error.Failed

Tue Jul 27, 2021 1:44 am

I will be keeping an eye on this thread as well.
I am sure there is a bug report somewhere but with this pi 400 and Debian Bluetooth is simply inconsistent from moment to moment and I have device that will not connect. Bluetooth is a major feature for me and so I can't use it without this.

I am a noob so while can run a command line even the many posts I have been through are not helping.

Going to try something other than Debian : - (

sh1sh1n11
Posts: 1
Joined: Tue Aug 17, 2021 6:16 am

Re: Failed to connect: org.bluez.Error.Failed

Tue Aug 17, 2021 6:23 am

If anyone is running kernel 5.4.0-1042-raspi Ubuntu Server 20.04 for Raspberry Pi. The below instructions worked for me.


This may be due to the pulseaudio-module-bluetooth package not being installed. Install it if it missing, then restart pulseaudio.

sudo apt install pulseaudio-module-bluetooth
pulseaudio -k
pulseaudio --start

If the issue is not due to the missing package, the problem in this case is that PulseAudio is not catching up. A common solution to this problem is to restart PulseAudio. Note that it is perfectly fine to run bluetoothctl as root while PulseAudio runs as user. After restarting PulseAudio, retry to connect. It is not necessary to repeat the pairing.

Continue trying second part only if above does not work for you:

If restarting PulseAudio does not work, you need to load module-bluetooth-discover.

sudo pactl load-module module-bluetooth-discover

The same load-module command can be added to /etc/pulse/default.pa. If that still does not work, or you are using PulseAudio's system-wide mode, also load the following PulseAudio modules (again these can be loaded via your default.pa or system.pa):

module-bluetooth-policy
module-bluez5-device
module-bluez5-discover

Credit: Edward Torvalds, Julian on StackExchange

Original Thread: https://unix.stackexchange.com/question ... ror-failed

Return to “Raspberry Pi 400”