Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to connect: org.bluez.Error.Failed #7

Open
Tech-Blog opened this issue May 30, 2018 · 2 comments
Open

Failed to connect: org.bluez.Error.Failed #7

Tech-Blog opened this issue May 30, 2018 · 2 comments

Comments

@Tech-Blog
Copy link

Hi buddy,
thanks for your awesome work.
i was trying to install it both on Raspbian Strech and Ubuntu 18.04 LTS and got this error:
**

Failed to connect: org.bluez.Error.Failed

**
i tried 3 devices,
2 BlueTooth Speakers
1 BlueTooth Earphone.
i was able to pair but not to connect.
can you help me with that?

Cheers,
Tomer

@orrpan
Copy link

orrpan commented Dec 10, 2018

I was able to connect by adding pulse to the group bluetooth, but not much more
sudo addgroup pulse bluetooth

Edit: got it to work
Got an error from mplayer, so followed this thread https://ubuntuforums.org/showthread.php?t=2213319

echo lirc=no >> ~/.mplayer/config

Could still not connect, so followed this thread #5

platform: tts_bluetooth_speaker
  address: 00:00:00:00:00:00.a2dp_sink
  volume: 0.45

(change to the intended BT-addr)

Finally a test from dev-service in hass.
service: tts.google_say
service_data: {"entity_id":"media_player.tts_bluetooth_speaker","message":"hello there"}

Also edited so my users 'pi' and 'homeassistant' could use bluetooth (don't know if this is needed).
https://www.raspberrypi.org/forums/viewtopic.php?t=108581

sudo nano /etc/dbus-1/system.d/bluetooth.conf

Small modificaton, since both my users are in the group 'homeassistant'

<policy group="homeassistant">
    <allow send_destination="org.bluez"/>
    <allow send_interface="org.bluez.Agent1"/>
    <allow send_interface="org.bluez.GattCharacteristic1"/>
    <allow send_interface="org.bluez.GattDescriptor1"/>
    <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
    <allow send_interface="org.freedesktop.DBus.Properties"/>
  </policy>

Edit2
Since the groups 'homeassistant' could control the connection/disconnection now I updated the pair_bluetooth.sh

#!/bin/bash

input=$1
if [ $input -eq $input ] 2>/dev/null; then
	if [ $input -eq 0 ]; then #unpair
		bluetoothctl <<EOF
disconnect 00:00:00:00:00:00
EOF
	else #pair
		bluetoothctl <<EOF
connect 00:00:00:00:00:00
EOF
	fi
else
	echo error
	exit -1
fi
exit 0

@okarin078
Copy link

I was able to connect by adding pulse to the group bluetooth, but not much more
sudo addgroup pulse bluetooth

Edit: got it to work
Got an error from mplayer, so followed this thread https://ubuntuforums.org/showthread.php?t=2213319

echo lirc=no >> ~/.mplayer/config

Could still not connect, so followed this thread #5

platform: tts_bluetooth_speaker
  address: 00:00:00:00:00:00.a2dp_sink
  volume: 0.45

(change to the intended BT-addr)

Finally a test from dev-service in hass.
service: tts.google_say
service_data: {"entity_id":"media_player.tts_bluetooth_speaker","message":"hello there"}

Also edited so my users 'pi' and 'homeassistant' could use bluetooth (don't know if this is needed).
https://www.raspberrypi.org/forums/viewtopic.php?t=108581

sudo nano /etc/dbus-1/system.d/bluetooth.conf

Small modificaton, since both my users are in the group 'homeassistant'

<policy group="homeassistant">
    <allow send_destination="org.bluez"/>
    <allow send_interface="org.bluez.Agent1"/>
    <allow send_interface="org.bluez.GattCharacteristic1"/>
    <allow send_interface="org.bluez.GattDescriptor1"/>
    <allow send_interface="org.freedesktop.DBus.ObjectManager"/>
    <allow send_interface="org.freedesktop.DBus.Properties"/>
  </policy>

Edit2
Since the groups 'homeassistant' could control the connection/disconnection now I updated the pair_bluetooth.sh

#!/bin/bash

input=$1
if [ $input -eq $input ] 2>/dev/null; then
	if [ $input -eq 0 ]; then #unpair
		bluetoothctl <<EOF
disconnect 00:00:00:00:00:00
EOF
	else #pair
		bluetoothctl <<EOF
connect 00:00:00:00:00:00
EOF
	fi
else
	echo error
	exit -1
fi
exit 0

Thx. It works for me :0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants