johann_strauss
Posts: 8
Joined: Sun Mar 14, 2021 1:10 pm

Failed to connect: org.bluez.Error.Failed

Sun Mar 14, 2021 1:31 pm

I have a vanilla Raspberry OS installation.
My HDMI monitor has no audio.
I tried to connect JBL Flip 4 - error (please see below)
I tried to connect Google Home Mini - same error

I have tried all possible options also suggested here, but to no avail:
viewtopic.php?f=28&t=275273

What is wrong?
When I right-click on the Volume Control, I can only select HDMI or Device Profiles, and there is no Bluetooth-connected JBL Flip 4 nor Google Home Mini.

Many thanks for your support!

Code: Select all

i@pi400:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
pi@pi400:~ $ uname -a
Linux pi400 5.10.17-v7l+ #1403 SMP Mon Feb 22 11:33:35 GMT 2021 armv7l GNU/Linux

pi@pi400:~ $ sudo apt update
Hit:1 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:2 http://archive.raspberrypi.org/debian buster InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
pi@pi400:~ $ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@pi400:~ $ 

Code: Select all

pi@pi400:~ $ bluetoothctl
Agent registered
[bluetooth]# devices
Device 30:C0:1B:2E:2F:AB JBL Flip 4
Device 00:F6:20:8A:2F:12 Kitchen speaker
[bluetooth]# connect 30:C0:1B:2E:2F:AB
Attempting to connect to 30:C0:1B:2E:2F:AB
Failed to connect: org.bluez.Error.Failed
[bluetooth]# connect 00:F6:20:8A:2F:12
Attempting to connect to 00:F6:20:8A:2F:12
Failed to connect: org.bluez.Error.Failed
[bluetooth]# info 00:F6:20:8A:2F:12
Device 00:F6:20:8A:2F:12 (public)
	Name: Kitchen speaker
	Alias: Kitchen speaker
	Class: 0x00240400
	Icon: audio-card
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: no
	LegacyPairing: no
bluetooth]# info 30:C0:1B:2E:2F:AB
Device 30:C0:1B:2E:2F:AB (public)
	Name: JBL Flip 4
	Alias: JBL Flip 4
	Class: 0x00240414
	Icon: audio-card
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: no
	LegacyPairing: no
	Modalias: bluetooth:v000ApFFFFdFFFF

amoun
Posts: 15
Joined: Tue Oct 27, 2020 7:25 pm
Location: Cornwall, UK
Contact: Website

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

Sun Mar 14, 2021 7:36 pm

Hi I have the same problem since I removed some pulse audio packages as pulse audio stopped Firefox from playing audio. Reinstalling pulse audio did not bring back the option to send audio over the bluetooth connection. So although my speaker is 'connected' it doesn't work. The terminal outputs are the same as yours.s

Still looking into it.

All the best

amoun
Posts: 15
Joined: Tue Oct 27, 2020 7:25 pm
Location: Cornwall, UK
Contact: Website

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

Sun Mar 14, 2021 8:11 pm

Looking into the fact that LegacyPairing is not enabled

pi@raspberrypi:~ $ bluetoothctl
Agent registered
[bluetooth]# connect 40:EF:4C:CC:AD:55
Attempting to connect to 40:EF:4C:CC:AD:55
Failed to connect: org.bluez.Error.Failed
[bluetooth]# info 40:EF:4C:CC:AD:55
Device 40:EF:4C:CC:AD:55 (public)
Name: Bag of Riddim II
Alias: Bag of Riddim II
Class: 0x00240414
Icon: audio-card
Paired: yes
Trusted: yes
Blocked: no
Connected: no
LegacyPairing: no
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)

johann_strauss
Posts: 8
Joined: Sun Mar 14, 2021 1:10 pm

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

Sun Mar 14, 2021 8:32 pm

I will give it a try.
On Ubuntu, the same device is paired without LegacyPairing and connects immediately:

Code: Select all

johann@arthur:~$ uname -a
Linux arthur 5.4.0-66-generic #74~18.04.2-Ubuntu SMP Fri Feb 5 11:17:31 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
johann@arthur:~$ bluetoothctl
[NEW] Controller FC:44:82:3B:B0:6D arthur [default]
[NEW] Device 30:C0:1B:2E:2F:AB JBL Flip 4
Agent registered
[bluetooth]# info 30:C0:1B:2E:2F:AB
Device 30:C0:1B:2E:2F:AB (public)
	Name: JBL Flip 4
	Alias: JBL Flip 4
	Class: 0x00240414
	Icon: audio-card
	Paired: yes
	Trusted: yes
	Blocked: no
	Connected: no
	LegacyPairing: no
	UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
	UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
	UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
	UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)
	Modalias: bluetooth:v000ApFFFFdFFFF
[CHG] Device 30:C0:1B:2E:2F:AB Connected: yes
[JBL Flip 4]# 

amoun
Posts: 15
Joined: Tue Oct 27, 2020 7:25 pm
Location: Cornwall, UK
Contact: Website

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

Sun Mar 14, 2021 8:49 pm

I didn't even understand it enough to get to enabling it. Is you bluetooth on the rasp-pi and ubuntu using the same hardware/firmware etc

johann_strauss
Posts: 8
Joined: Sun Mar 14, 2021 1:10 pm

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

Sun Mar 14, 2021 9:27 pm

The JBL Flip 4 is the same. The computers are different though. But I assumed the connection settings would be no different.

amoun
Posts: 15
Joined: Tue Oct 27, 2020 7:25 pm
Location: Cornwall, UK
Contact: Website

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

Sun Mar 14, 2021 10:52 pm

I had this idea that there may be interference from the wifi as I use 2.4GHz which is close to the Bluetooth

I switched off wifi and it connects ~ I can use 5GHz for wifi but it doesn't have such a good range ~ I may try fiddling with the 2.4GHz channels.

However I was messing with the audio setup and lost the option to send the audio to the speaker ~ I used to have a different menu that gave HDMI or Speaker ???


johann_strauss
Posts: 8
Joined: Sun Mar 14, 2021 1:10 pm

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

Mon Mar 15, 2021 8:06 pm

Legacy Pairing:
This is the only method available in Bluetooth v2.0 and before. Each device must enter a PIN code; pairing is only successful if both devices enter the same PIN code

I am not sure about this one, I will not be able to type in any PIN code on my JBL Flip 4 speaker.

johann_strauss
Posts: 8
Joined: Sun Mar 14, 2021 1:10 pm

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

Mon Mar 15, 2021 8:28 pm

Removed all devices and followed the instructions, rebooted:

Code: Select all

pi@pi400:~ $ groups
pi adm lp dialout cdrom sudo audio video plugdev games users input netdev lpadmin gpio i2c spi

Code: Select all

pi@pi400:~ $ ps aux | grep pulse
pi         682  0.0  0.2 358540  8616 ?        S<sl 21:17   0:00 /usr/bin/pulseaudio --daemonize=no
pi        1520  0.0  0.0   7348   580 pts/0    S+   21:24   0:00 grep --color=auto pulse

Code: Select all

pi@pi400:~ $ sudo bluetoothctl
Agent registered
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# devices
[bluetooth]# scan on
Discovery started
[CHG] Controller E4:5F:01:05:93:E5 Discovering: yes
[NEW] Device 4D:3D:8B:67:43:00 4D-3D-8B-67-43-00
[NEW] Device 02:37:E2:AD:4E:EB 02-37-E2-AD-4E-EB
[NEW] Device F0:99:19:3B:D4:BB F0-99-19-3B-D4-BB
[NEW] Device 08:66:98:BA:B5:D1 08-66-98-BA-B5-D1
[NEW] Device 69:97:46:D3:C4:12 69-97-46-D3-C4-12
[NEW] Device 4B:BE:43:E4:12:28 4B-BE-43-E4-12-28
[NEW] Device 30:C0:1B:2E:2F:AB JBL Flip 4
[bluetooth]# trust 30:C0:1B:2E:2F:AB
[CHG] Device 30:C0:1B:2E:2F:AB Trusted: yes
Changing 30:C0:1B:2E:2F:AB trust succeeded
[bluetooth]# pair 30:C0:1B:2E:2F:AB
Attempting to pair with 30:C0:1B:2E:2F:AB
[CHG] Device 30:C0:1B:2E:2F:AB Connected: yes
[CHG] Device 30:C0:1B:2E:2F:AB Connected: no
[bluetooth]# connect 30:C0:1B:2E:2F:AB
Attempting to connect to 30:C0:1B:2E:2F:AB
Failed to connect: org.bluez.Error.Failed
[NEW] Device 57:99:82:BA:81:84 57-99-82-BA-81-84
[CHG] Device 57:99:82:BA:81:84 ManufacturerData Key: 0x004c
[CHG] Device 57:99:82:BA:81:84 ManufacturerData Value:
  10 06 10 1a 32 62 4c a8                          ....2bL.        
[CHG] Device F0:99:19:3B:D4:BB RSSI: -89
[CHG] Device F0:99:19:3B:D4:BB RSSI: -77
[NEW] Device 4D:5E:75:01:A8:2E 4D-5E-75-01-A8-2E
[bluetooth]# connect 30:C0:1B:2E:2F:AB
Attempting to connect to 30:C0:1B:2E:2F:AB
Failed to connect: org.bluez.Error.Failed
It's only shortly connected after pairing, then immediately disconnects.

johann_strauss
Posts: 8
Joined: Sun Mar 14, 2021 1:10 pm

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

Mon Mar 15, 2021 8:39 pm

Tried again and again. It briefly connects after pairing. Then the white led stops blinking and stays on.

Code: Select all

pi@pi400:~ $ pulseaudio --verbose --start
N: [pulseaudio] main.c: User-configured server at {b9e11b12b49248988c54de6784db6e5c}unix:/run/user/1000/pulse/native, which appears to be local. Probing deeper.
I: [pulseaudio] main.c: Daemon startup successful.
pi@pi400:~ $ sudo bluetoothctl
Agent registered
[bluetooth]# power on
Changing power on succeeded
[bluetooth]# default-agent
Default agent request successful
[bluetooth]# scan on
Discovery started
[CHG] Controller E4:5F:01:05:93:E5 Discovering: yes
[NEW] Device 60:F6:06:74:4F:82 60-F6-06-74-4F-82
[NEW] Device 57:99:82:BA:81:84 57-99-82-BA-81-84
[NEW] Device F0:99:19:3B:D4:BB F0-99-19-3B-D4-BB
[NEW] Device 02:37:E2:AD:4E:EB 02-37-E2-AD-4E-EB
[NEW] Device 08:66:98:BA:B5:D1 08-66-98-BA-B5-D1
[NEW] Device 66:BD:00:1D:24:15 66-BD-00-1D-24-15
[NEW] Device 30:C0:1B:2E:2F:AB JBL Flip 4
[bluetooth]# trust 30:C0:1B:2E:2F:AB
[CHG] Device 30:C0:1B:2E:2F:AB Trusted: yes
Changing 30:C0:1B:2E:2F:AB trust succeeded
[NEW] Device 69:D1:B1:D4:20:8E 69-D1-B1-D4-20-8E
[bluetooth]# pair 30:C0:1B:2E:2F:AB
Attempting to pair with 30:C0:1B:2E:2F:AB
[CHG] Device 30:C0:1B:2E:2F:AB Connected: yes
[CHG] Device 30:C0:1B:2E:2F:AB Connected: no
Last edited by johann_strauss on Mon Mar 15, 2021 8:45 pm, edited 1 time in total.

johann_strauss
Posts: 8
Joined: Sun Mar 14, 2021 1:10 pm

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

Mon Mar 15, 2021 8:44 pm

But doesn't appear to be paired:

Code: Select all

[bluetooth]# paired-devices
[bluetooth]# info 30:C0:1B:2E:2F:AB
Device 30:C0:1B:2E:2F:AB (public)
	Name: JBL Flip 4
	Alias: JBL Flip 4
	Class: 0x00240414
	Icon: audio-card
	Paired: no
	Trusted: yes
	Blocked: no
	Connected: no
	LegacyPairing: no
	UUID: Advanced Audio Distribu.. (0000110d-0000-1000-8000-00805f9b34fb)
	UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)
	UUID: A/V Remote Control Cont.. (0000110f-0000-1000-8000-00805f9b34fb)
	UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)
	UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)
	UUID: Headset HS                (00001131-0000-1000-8000-00805f9b34fb)
	Modalias: bluetooth:v000ApFFFFdFFFF
	RSSI: -26
	TxPower: 8

Code: Select all

[bluetooth]# pair 30:C0:1B:2E:2F:AB
Attempting to pair with 30:C0:1B:2E:2F:AB
Failed to pair: org.bluez.Error.AlreadyExists
[bluetooth]# 

johann_strauss
Posts: 8
Joined: Sun Mar 14, 2021 1:10 pm

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

Mon Mar 15, 2021 8:57 pm

After reboot, when I try to connect through GUI:
Connect Device:
Connection failed - no usable services on this device.

Code: Select all

pi@pi400:~ $ bluetoothctl
Agent registered
[bluetooth]# paired-devices
Device 30:C0:1B:2E:2F:AB JBL Flip 4
[bluetooth]# 

headsettrouble
Posts: 6
Joined: Fri Mar 19, 2021 7:55 pm

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

Sat Mar 20, 2021 7:57 am

johann_strauss wrote:
Mon Mar 15, 2021 8:57 pm
After reboot: Connection failed - no usable services on this device.
Restart bluetoothd (e.g. by running "sudo /etc/init.d/bluetooth restart").
It will work then. At latest when you have powered off and on your bluetooth device afterwards.
I have the exact same problem and would love to know a fix why it does not work directly after the initial boot.

tomaszeW
Posts: 1
Joined: Wed Mar 31, 2021 8:37 pm

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

Wed Mar 31, 2021 8:57 pm

I have a similar problem with pi4, exactly when connecting ps3 controller to retropie

What I noticed is: (it may be helpful)
before bluetoothd restart commands:

Code: Select all

sudo bluetoothctl
show
Gives Mac address like:
E4:5F:01:XX:XX:XX

after restart

Code: Select all

sudo service bluetooth restart
the same commands give:
B8:27:EB:9D:XX:XX

What is interesting the command:

Code: Select all

sudo hcitool dev
always returns correct address:
hci0: B8:27:EB:9D:XX:XX

After restart everything works like a charm....

I think the initial MAC Address is somehow incorrect


Code: Select all

pi@retropie:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
Last edited by tomaszeW on Wed Mar 31, 2021 9:08 pm, edited 1 time in total.

evancg
Posts: 2
Joined: Mon Apr 05, 2021 4:55 am

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

Mon Apr 05, 2021 5:00 am

I have this same issue with a Pi 4 with a Dualshock or basically ANY bluetooth device. The changing MAC address happens to me too. On boot it's:

Controller E4:5F:01:09:8F:54 and Bluetooth just fails. Nothing can connect at all. It's a mess.

After a quick sudo systemctl restart bluetooth.service and bluetoothctl list, it shows

Controller B8:27:EB:91:7E:CF and Bluetooth works.

Any suggestions on what might be going on?

evancg
Posts: 2
Joined: Mon Apr 05, 2021 4:55 am

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

Mon Apr 05, 2021 1:41 pm

Quick addition to my prior post - Restarting bluetooth.service doesn't always fix it - it seems more likely that just restarting bluetooth gives it a chance to get the right MAC address (which is why sometimes it always works on a reboot).

Bi-Doux
Posts: 1
Joined: Mon Jan 18, 2021 11:16 pm

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

Thu Apr 15, 2021 4:52 pm

evancg wrote:
Mon Apr 05, 2021 1:41 pm
Quick addition to my prior post - Restarting bluetooth.service doesn't always fix it - it seems more likely that just restarting bluetooth gives it a chance to get the right MAC address (which is why sometimes it always works on a reboot).
Same recurring error but as far as I am concerned, restarting bluetooth.service NEVER fix it. Since one of last year update of firmware, I am unable to use bluetooth with my RPI 4B. :cry:

Longrower
Posts: 2
Joined: Tue Apr 20, 2021 11:58 am

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

Tue Apr 20, 2021 4:02 pm

The sudo Bluetooth restart is the only thing that's worked for me thus far.
GUI Bluetooth On/Off doesn't work, system restart doesn't work. Bluetooth is Fubar after I shut down and power back on. Mine's a new RPi 4b with stock OS install via NOOB.

piersw
Posts: 9
Joined: Wed Dec 30, 2020 10:02 pm
Location: Cambridge, UK.

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

Tue Apr 20, 2021 5:56 pm

I'm getting this on a friend's Raspberry Pi 400 - it works fine on my Pi 400. I managed once to pair it by following all the steps in the other thread (powering it on, default-agent, scan, trust, pair, connect...), but that's not at all practical for a kid's computer.

The curious thing is it seems to be a hardware problem. If I use either their or my SD card in my Pi 400 I can pair. If I use their or my SD card in their Pi 400, I get the various error messages.

Both SD cards are (now) up-to-date with apt-get, and both were Pi 400 installs of Raspberry Pi OS (as opposed to an upgrade from an earlier OS).

piersw
Posts: 9
Joined: Wed Dec 30, 2020 10:02 pm
Location: Cambridge, UK.

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

Tue Apr 20, 2021 6:09 pm

I've also had occasional success with restarting the bluetooth.service. The address changes from E4:5F:01:13:BE:6D to B8:27:EB:F9:19:77 and then pairing, connecting and audio works flawlessly (as it always has on my Pi 400).

piersw
Posts: 9
Joined: Wed Dec 30, 2020 10:02 pm
Location: Cambridge, UK.

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

Wed Apr 21, 2021 9:34 am

Given the computer is for a friend's 6 year old I guess the best option is to return it for a swap?

She obviously can't be expected to type in any commands to get bluetooth working, and I'm nervous that if I modify the startup scripts it will go wrong on the next OS update.

piersw
Posts: 9
Joined: Wed Dec 30, 2020 10:02 pm
Location: Cambridge, UK.

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

Fri May 07, 2021 2:05 pm

The Pi 400 has been replaced, and it still has exactly the same behaviour.

I'm stumped - it seems some other people have the same problem. But, more importantly, it does seem to be a hardware problem because Bluetooth works on my Pi 400 using the SD cards (plural) that fail to work on the other Pi 400s.

Given the replacement came from the same shop, could it really be a dodgy batch?

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

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

Fri May 07, 2021 3:16 pm

piersw wrote:
Fri May 07, 2021 2:05 pm
The Pi 400 has been replaced, and it still has exactly the same behaviour.

I'm stumped - it seems some other people have the same problem. But, more importantly, it does seem to be a hardware problem because Bluetooth works on my Pi 400 using the SD cards (plural) that fail to work on the other Pi 400s.

Given the replacement came from the same shop, could it really be a dodgy batch?
Hi Piers,

We have had a few reports on this, but have not been able to replicate in house. Since you are in Cambridge, would it be possible to get hold of this failing one so we can investigate?

James
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Working in the Application's Team.

piersw
Posts: 9
Joined: Wed Dec 30, 2020 10:02 pm
Location: Cambridge, UK.

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

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.

Return to “Raspberry Pi 400”