IanHarvey / bluepy

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

Scan error #121

Open xbassols opened 8 years ago

xbassols commented 8 years ago

Hi Ian,

I've been dealing with this issue and I can't figure out a way to solve it.

Scanning for devices...
Running  /root/bluepy/bluepy/bluepy-helper
Sent:  le on

Got: 'rsp=$mgmt code=$protoerr\n'
Stopping  /root/bluepy/bluepy/bluepy-helper
Traceback (most recent call last):
  File "./blescan.py", line 133, in <module>
    main()
  File "./blescan.py", line 115, in main
    devices = scanner.scan(arg.timeout)
  File "/root/bluepy/bluepy/btle.py", line 631, in scan
    self.start()
  File "/root/bluepy/bluepy/btle.py", line 569, in start
    self._mgmtCmd("le on")
  File "/root/bluepy/bluepy/btle.py", line 240, in _mgmtCmd
    "Failed to execute mgmt cmd '%s'" % (cmd))
btle.BTLEException: Failed to execute mgmt cmd 'le on'

I had to modify from . import btle to import btle inside the file blescan.py in order to import the library but then the issue above happens.

I'm testing with python3.4 and the file is being executed as python3 blescan.py -v (I also tried with just python blescan.py -v).

I looked at the issue #94 so I'm running the code as root and Debugging is set to True.

I've tried multiple things but can't make it work.

Any insights?

Thanks!

bbreton09 commented 7 years ago

Hello, have you found a solution? I find the same error on an Orange PI Zero under Armbian. Error: "btle.BTLEException: Failed to execute mgmt cmd 'on'" A scan with hcitool lescan works perfectly.

Thank you

ghost commented 7 years ago

Same issue with Orange Pi PC Plus under Armbian. Same code works on Rapsberry Pi 3.

bbreton09 commented 7 years ago

For Armbian just use kernel developper in version 4.x solve issue on Orange PI Zero

edouardkleinhans commented 7 years ago

any news on Orange Pi PC plus under Armbian ?

robertcsakany commented 6 years ago

+1