IanHarvey / bluepy

Python interface to Bluetooth LE on Linux
Other
1.58k stars 490 forks source link

bluepy.btle.BTLEManagementError: Failed to execute management command 'scan' #483

Closed Da-Eli closed 2 years ago

Da-Eli commented 2 years ago

Hello, i am runnig a Pi4 with the latest Raspbian. I've written a Python script that uses the scanner class to scan for a certain device and log its data in an endless loop. Up until now it worked just fine. Then, out of the blue i got this error message and even sudo blescan does not work anymore. I've tried it to run from /ect/profile as to run it automatically on startup. This did yield a similar error message as seen below. I'm getting following dialogue when tying to run sudo blescan:

pi@raspberrypi:~ $ sudo blescan Scanning for devices... Traceback (most recent call last): File "/usr/local/bin/blescan", line 8, in sys.exit(main()) File "/usr/local/lib/python3.9/dist-packages/bluepy/blescan.py", line 122, in main devices = scanner.scan(arg.timeout) File "/usr/local/lib/python3.9/dist-packages/bluepy/btle.py", line 852, in scan self.start(passive=passive) File "/usr/local/lib/python3.9/dist-packages/bluepy/btle.py", line 800, in start self._mgmtCmd(self._cmd()) File "/usr/local/lib/python3.9/dist-packages/bluepy/btle.py", line 312, in _mgmtCmd raise BTLEManagementError("Failed to execute management command '%s'" % (cmd), rsp) bluepy.btle.BTLEManagementError: Failed to execute management command 'scan'

The output is consistantly the same. Uninstalling and reinstalling bluepy had no use.

Da-Eli commented 2 years ago

Update: Whatever it was, after formatting the SD-Card and getting a fresh image, all seems to be working again. Sorry for bothering.