Closed Dinges28 closed 1 year ago
bluetooth documentation bluetooth source (message by IssueLinks)
Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (bluetooth
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
I have the same issue running HA in a docker container with Ubuntu 22.04 LTS as the host OS, and the dbus path mounted as a RO volume
Same here, I have a host of 16.04 (yeah, that old) and it gives this error with and without ro mount option. Disabling apparrmor doesn't make any difference.
Same issue here, ubuntu 22.04, HA 2022.8.1 I got it working when running the container --privileged but this is a mere workaround. The Apparmor seems to be related to a container setting but I am not a specialist and would not know what to do without creating a possible bigger mess https://github.com/edgexfoundry-holding/device-bluetooth-c/issues/4
Upgraded to 2022.8.6 ... still the same (was not expecting a solution though)
Same here. Host Ubuntu 20.04.4 LTS and it gives this error with and without ro
mount option. Disabling apparrmor doesn't make any difference. Adding privileged: true
to the docker compose didn't help.
Same error, Ubuntu 20.04
adding privileged: true
did help, though
If it helps, running dbus-monitor from inside the container:
bash-5.1# dbus-monitor --system
Failed to open connection to system bus: An AppArmor policy prevents this sender from sending this message to this recipient; type="method_call", sender="(null)" (inactive) interface="org.freedesktop.DBus" member="Hello" error name="(unset)" requested_reply="0" destination="org.freedesktop.DBus" (bus)
bash-5.1# dbus-monitor --session
Failed to open connection to session bus: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
bash-5.1# dbus-daemon --system
dbus-daemon[99]: Failed to start message bus: Failed to bind socket "/var/run/dbus/system_bus_socket": Address in use
Just a side note which I learned recently, many people believe that the BT integration opens up ALL devices but none is more true. At present tnly very few types are auto-added via this method, see the notes. ie. even if my BT integration shows working...at present I have none of the available BT-integrations...so nothing shows.
Net: the AppArmor isssue still requires a solution
I finally got it to work. The problem was that my docker is in swarm mode, and in swarm security_opt
(and custom AppArmor profiles) are not available. I created a custom AppArmor profile and replaced the docker-default
one. Here it explains how to do that. I also had to add a few rules to /etc/dbus-1/system.d/bluetooth.conf
.
I've attached the files. They are a bit messy, but they might help.
I finally got it to work. The problem was that my docker is in swarm mode, and in swarm
security_opt
(and custom AppArmor profiles) are not available. I created a custom AppArmor profile and replaced thedocker-default
one. Here it explains how to do that. I also had to add a few rules to/etc/dbus-1/system.d/bluetooth.conf
.I've attached the files. They are a bit messy, but they might help.
You might need to open up a few more bluez endpoints on dbus next month as the Bluetooth integration evolves
I have the same issue and after reading this thread I couldn't figure out what is wrong. I am using the built-in BT adapter in the laptop.
Same problem on version 2022.8.7 with ubuntu and docker containerized app
Mine already works. I’ll post the configuration later on as I have no time now. I have it working with the laptop built-in BT adapter and an Asus BT-500. So I have it working with two BT adapters at the same time.
Mine already works. I’ll post the configuration later on as I have no time now. I have it working with the laptop built-in BT adapter and an Asus BT-500. So I have it working with two BT adapters at the same time.
In 2022.9.x if you get an extension cable or a usb to Ethernet extension you could run the second one further away and the system should pick the best path to connect to the device based on the signal strength
Mine already works. I’ll post the configuration later on as I have no time now. I have it working with the laptop built-in BT adapter and an Asus BT-500. So I have it working with two BT adapters at the same time.
Can you post your config?
I finally got it to work. The problem was that my docker is in swarm mode, and in swarm
security_opt
(and custom AppArmor profiles) are not available. I created a custom AppArmor profile and replaced thedocker-default
one. Here it explains how to do that. I also had to add a few rules to/etc/dbus-1/system.d/bluetooth.conf
.I've attached the files. They are a bit messy, but they might help.
Thank you, this fixed the issues I was having with bluetooth.
I finally got it to work. The problem was that my docker is in swarm mode, and in swarm
security_opt
(and custom AppArmor profiles) are not available. I created a custom AppArmor profile and replaced thedocker-default
one. Here it explains how to do that. I also had to add a few rules to/etc/dbus-1/system.d/bluetooth.conf
.I've attached the files. They are a bit messy, but they might help.
Thank you for this solution! (I use a standard Ubuntu 20.04, docker-compose, systemd based system)
The problem
After upgrading to the new home assistant 2022.8.1 i get an error for setting up the bluetooth
Opnieuw proberen in te stellen: Failed to start Bluetooth: [org.freedesktop.DBus.Error.AccessDenied] An AppArmor policy prevents this sender from sending this message
Tried both options mentioned in the documentation to -v the DBus
What version of Home Assistant Core has the issue?
2022.8.1
What was the last working version of Home Assistant Core?
core-2022.7.7
What type of installation are you running?
Home Assistant Container
Integration causing the issue
Bluetooth
Link to integration documentation on our website
https://www.home-assistant.io/integrations/bluetooth
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response