martinohanlon / BlueDot

A zero boiler plate bluetooth remote
MIT License
144 stars 45 forks source link

Running on raspbian lite, app needs root permissions, but runs without on standard raspbian #133

Closed pootle closed 5 years ago

pootle commented 5 years ago

I originally ran on a desktop version of raspbian and my app works OK by calling

python3 myapp.py both from a command prompt within a remote desktop session and when connected via ssh.

I then did a clean build of raspbian lite, but the app fails unless I use sudo.

So there is a workaround, but I'd rather not be running with root permissions. Both builds were up-to-date Buster installations

ERROR:dbus.proxies:Introspect error on :1.5:/: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type="method_call", sender=":1.24" (uid=1000 pid=683 comm="python3 blueclock.py ") interface="org.freedesktop.DBus.Introspectable" member="Introspect" error name="(unset)" requested_reply="0" destination=":1.5" (uid=0 pid=333 comm="/usr/lib/bluetooth/bluetoothd ") Traceback (most recent call last): File "blueclock.py", line 55, in <module> bd = BlueDot() File "/usr/local/lib/python3.7/dist-packages/bluedot/dot.py", line 518, in __init__ self._create_server() File "/usr/local/lib/python3.7/dist-packages/bluedot/dot.py", line 1020, in _create_server auto_start = False) File "/usr/local/lib/python3.7/dist-packages/bluedot/btcomm.py", line 212, in __init__ self._setup_adapter(device) File "/usr/local/lib/python3.7/dist-packages/bluedot/btcomm.py", line 417, in _setup_adapter self._adapter = BluetoothAdapter(device) File "/usr/local/lib/python3.7/dist-packages/bluedot/btcomm.py", line 41, in __init__ self._address = get_mac(self._device) File "/usr/local/lib/python3.7/dist-packages/bluedot/utils.py", line 38, in get_mac return get_adapter_property(device_name, "Address") File "/usr/local/lib/python3.7/dist-packages/bluedot/utils.py", line 33, in get_adapter_property adapter_path = find_adapter(device_name).object_path File "/usr/local/lib/python3.7/dist-packages/bluedot/utils.py", line 18, in find_adapter return find_adapter_in_objects(get_managed_objects(), pattern) File "/usr/local/lib/python3.7/dist-packages/bluedot/utils.py", line 15, in get_managed_objects setup pwm on pins (17, 23, 22, 27), requested frequency 10000 Hz, actual frequency is 8000 Hz return manager.GetManagedObjects() File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 70, in __call__ return self._proxy_method(*args, **keywords) File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 145, in __call__ **keywords) File "/usr/lib/python3/dist-packages/dbus/connection.py", line 651, in call_blocking message, timeout) dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type="method_call", sender=":1.24" (uid=1000 pid=683 comm="python3 blueclock.py ") interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" error name="(unset)" requested_reply="0" destination=":1.5" (uid=0 pid=333 comm="/usr/lib/bluetooth/bluetoothd ")

martinohanlon commented 5 years ago

Im not sure what to suggest. If Python, dbus and bluedot are all installed and accessible to the Pi user it would work without sudo (as running it on the Desktop version shows).

This isnt a bug with blue dot so I am going to close the issue.

Perhaps put a post on the Raspberry Pi forum?