IanHarvey / bluepy

Python interface to Bluetooth LE on Linux
Other
1.59k stars 491 forks source link

BTLEManagementError: Management not available (permissions problem?) #373

Closed MysticNynja closed 4 years ago

MysticNynja commented 5 years ago

I'm running this repository: https://github.com/GammaGames/kano-wand-demos and am getting this error from bluepy

Scanning... Scanning for 1.0 seconds... Traceback (most recent call last): File "callback.py", line 64, in <module> main() File "callback.py", line 19, in main wands = shop.scan(connect=True) File "/home/nynja/Wand/kano-wand-demos/kano_wand/kano_wand.py", line 669, in scan self._scanner.scan(timeout) File "/usr/local/lib/python3.7/dist-packages/bluepy-1.3.0-py3.7.egg/bluepy/btle.py", line 852, in scan self.start(passive=passive) File "/usr/local/lib/python3.7/dist-packages/bluepy-1.3.0-py3.7.egg/bluepy/btle.py", line 790, in start self._mgmtCmd("le on") File "/usr/local/lib/python3.7/dist-packages/bluepy-1.3.0-py3.7.egg/bluepy/btle.py", line 309, in _mgmtCmd rsp = self._waitResp('mgmt') File "/usr/local/lib/python3.7/dist-packages/bluepy-1.3.0-py3.7.egg/bluepy/btle.py", line 366, in _waitResp raise BTLEManagementError("Management not available (permissions problem?)", resp) bluepy.btle.BTLEManagementError: Management not available (permissions problem?)

So I tried to just run the bluepy-helper and when i type the scan command I get nomngt error code.

Is there something i have to do to get permissions?

I am running Debian on Windows 10 - https://www.microsoft.com/en-us/p/debian/9msvkqc78pk6?activetab=pivot:overviewtab

I don't know if that is the issue or not, but I don't have another machine that is linux based available to me right now.

Thanks

MysticNynja commented 5 years ago

When I run the bluepy-helper command I get this error

rsp=$errcode=$nomgmt

sterwen commented 4 years ago

Looks a permission problem really. To perform a BLE scan you need to be root. Don't know the fundamental reason behind that, but if the bluepy-helper executable does not have root permissions it fails.

MysticNynja commented 4 years ago

I run it with sudo and I almost am sure my user has root access. Is there something else I need to do?

InquisitiveAS commented 4 years ago

I am having the same issue, did someone figure out the issue

MysticNynja commented 4 years ago

I had to log in as root and that fixed it for me.

teojunjie commented 3 years ago

Any luck with this?