sputnikdev / eclipse-smarthome-bluetooth-binding

Eclipse SmartHome Bluetooth Binding
46 stars 10 forks source link

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

Closed vkolotov closed 6 years ago

vkolotov commented 6 years ago

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