sputnikdev / eclipse-smarthome-bluetooth-binding

Eclipse SmartHome Bluetooth Binding

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GDBus.Error:org.freedesktop.DBus.Error.AccessDenied

vkolotov opened this issue · comments

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:

  1. 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>
  1. Add openhab user to the bluetooth group:
sudo usermod -a -G bluetooth openhab
  1. Reload service definitions:
sudo systemctl daemon-reload
  1. Restart bluez:
sudo systemctl restart bluetooth