STMicroelectronics / BlueSTSDK_Python

Bluetooth Low Energy Sensors Technology Software Development Kit (Python version for Linux Gateways)
https://www.st.com/en/embedded-software/bluest-sdk.html
BSD 3-Clause "New" or "Revised" License
61 stars 19 forks source link

"Bluetooth scanning requires root privilege" #3

Closed CaliforniaHobo closed 5 years ago

CaliforniaHobo commented 6 years ago

When running the example script #1 in Ubuntu 16.04 under Python 3.6 AS ROOT, I get the following error: "Bluetooth scanning requires root privilege, so please run the script as "sudo". Exiting..."

I have tried running with the sudo command as well, with same result. I looked in the manager.py file, and I see that this error is being raised by an actual BTLEException, so this is not something I should probably try to override. Any idea what's going on here? By the way, when I try to run the script under Python2.7, it throws syntax errors, so I'm assuming it was written for Python3, even though the SDK itself says it's compatible with 2.7.

CaliforniaHobo commented 6 years ago

Ok, Solved this; I discovered it was because I was running it in a VM, and the VM couldn't figure out how to talk to the bluetooth hardware correctly.