0

I'm trying to connect my Raspberry pi3 to my smart phone but it fails. On my RP I type the following command :

bluetoothctl
connect B8:08:D7:AC:CC:42

but I have the following error:

Attempting to connect to B8:08:D7:AC:CC:42
Failed to connect: org.bluez.Error.Failed 

Is there someone who can help me?

Ahmed Ashour
  • 5,179
  • 10
  • 35
  • 56
loua
  • 1
  • Check the "journalctl -xe" log and share the error message if any regarding bluetooth. That helps further narrowing down the actual reason. – Parthiban Apr 05 '17 at 03:33

1 Answers1

0

Try the following steps. Before sharing the steps, share the logs from "journalctl -xe". If you see, "a2dp-source profile connect failed for : Protocol not available", then your R-Pi doesn't support or implemented A2DP profile. One quick option is to run the pulseaudio bluez module.

systemctl start bluetooth
hciconfig hci0 up

Switch on Bluetooth in your smart phone

bluetoothctl
[bluetooth]# discoverable on
[bluetooth]# pairable on
[bluetooth]# scan on
>>> Wait for your device to appear during scanning process.
[bluetooth]# scan off
[bluetooth]# trust <Device MAC>
[bluetooth]# pair <Device MAC>
[bluetooth]# connect <Device MAC>

If you still see, Attempting to connect to 44:D8:84:02:A3:17 Failed to connect: org.bluez.Error.Failed

Start the pulseaudio,

pulseaudio
pactl load-module module-bluetooth-discover

Go back to bluetoothctl and try connecting again. But it's still possible for you to connect your phone to R-Pi without enabling the A2DP support just by connecting it from smartphone instead of R-Pi command line.

Parthiban
  • 2,130
  • 2
  • 14
  • 27
  • when i tried pactl load-module module-bluetooth-discover i had this error : Connection failure: Connection refused pa_context_connect() failed: Connection refused – loua Apr 05 '17 at 08:51
  • make sure pulseaudio is running. Check with "ps -ef | grep pulseaudio". If pulseaudio is running fine, try loading module using "sudo" – Parthiban Apr 05 '17 at 09:34