2

I'm running an up to date version of Buster on a Pi 3B+ (v1.3) and my Python program dies with

txdbus.error.remoteerror:
org.freedesktop.DBus.Error.AccessDenied: Rejected send message

errors unless I run under root (e.g. sudo python3 myblepgm.py) at which point it completes fine.

Checking the groups defined in /etc/group, I cannot see an obvious one that 'pi' could join to give access to Bluetooth / BLE devices.

I am loath to run the program long term under root if it's not needed (and would be happy to create a specific user for this), so does anyone know what rights / groups the program and user need?

1 Answers1

4

I'm not sure this will help, but:

I found during a recent exercise that user pi is not necessarily a member of the BT group. In my case, this was cured as follows:

$ sudo usermod -G bluetooth -a pi

You may need a reboot after making this change.

Seamus
  • 21,900
  • 3
  • 33
  • 70
  • Thanks for that - no idea why I missed that group when I listed them! –  Dec 28 '20 at 01:31
  • @Andyroo, was this on the lite version of the OS? – ukBaz Dec 28 '20 at 07:07
  • @ukBaz A bit of a mix it's the full version (without 'recommended software') but starting in command line mode as it ended up headless. –  Dec 28 '20 at 13:20
  • @Seamus I used getent group as Pi (and sudo less /etc/group) but was watching TV and working off my iPad at the time so the screen only has about 10 lines with the keyboard up! The group is there, I just missed it so was stuck where to start (blush). –  Dec 28 '20 at 13:25