BlueSTSDK_Python icon indicating copy to clipboard operation
BlueSTSDK_Python copied to clipboard

Is it possible to receive data as non-root?

Open aditi1prakash opened this issue 2 years ago • 3 comments

Current example scripts need root access, is it possible to connect and receive data as non-root?

If not, then why is root access required?

aditi1prakash avatar Mar 16 '22 17:03 aditi1prakash

Hello @aditi1prakash, Let's say no, unless some work to configure the Bluetooth stack. The following is what I've found on the Internet, but I've never tried it actually.

By default, on Linux, the Bluetooth protocol stack needs special privileges to interact with. These privileges are implemented through properties called "capabilities" (see man 7 capability for details), and the tool to assign capabilities is "setcap".

Since the Python version of the BlueSTSDK makes use of the bluepy library, it is the binary "bluepy-helper" that interacts with the Bluetooth protocol stack; hence, in case you want to do so, you should locate where it is installed and assign the proper capabilities to it. See also here.

Regards, Davide

davidroid avatar Apr 14 '22 17:04 davidroid

Hi Davide,

Thanks for the inputs. I modified the capabilities of the bluepy-helper file.

After assigning the capabilities, the blue_st_sdk throws a 'ModuleNotFoundError' for Manager module. image

The required capabilities are set for the bluepy-helper file. image

Any thoughts on a fix/workaround would be helpful.

Regards, Aditi Prakash

aditi1prakash avatar Apr 20 '22 11:04 aditi1prakash

Hello @aditi1prakash, Can you check the output of the following command, to see whether the SDK is there?

find / | grep blue_st_sdk

Thank you, Davide

davidroid avatar Apr 20 '22 14:04 davidroid