GDBus.Error:org.freedesktop.DBus.Error.AccessDenied
vkolotov opened this issue · 0 comments
vkolotov commented
I installed the binding but nothing happens and I see the following error in the logs:
java java.lang.RuntimeException: Error getting object manager client:
GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules;
Cause:
The "openhab" system user has insufficient permissions to access Bluez B-Bus interface.
Resolution:
- Edit Bluez DBus config to add a permission to access Bluez for the bluetooth group (/etc/dbus-1/system.d/bluetooth.conf):
<busconfig>
<policy user="root">
...
</policy>
<policy group="bluetooth">
<allow send_destination="org.bluez"/>
</policy>
...
</busconfig>
- Add openhab user to the bluetooth group:
sudo usermod -a -G bluetooth openhab
- Reload service definitions:
sudo systemctl daemon-reload
- Restart bluez:
sudo systemctl restart bluetooth