I have the exact same issue on my Raspberry Pi Zero W with Raspbian Stretch lite (4.14). I tried all possible combinations of setcap (also looking into #190), without any success.
pi:/usr/local/lib/python3.5/dist-packages/bluepy $ sudo setcap 'cap_net_raw,cap_net_admin+eip' bluepy-helper
pi:/usr/local/lib/python3.5/dist-packages/bluepy $ getcap bluepy-helper
bluepy-helper = cap_net_admin,cap_net_raw+eip
pi:~/projects/bluepy/bluepy $ python3 scanner.py
Traceback (most recent call last):
File "scanner.py", line 18, in <module>
scanner.scan(10.0, passive=True)
File "/home/pi/.local/lib/python3.5/site-packages/bluepy/btle.py", line 852, in scan
self.start(passive=passive)
File "/home/pi/.local/lib/python3.5/site-packages/bluepy/btle.py", line 790, in start
self._mgmtCmd("le on")
File "/home/pi/.local/lib/python3.5/site-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 'le on' (code: 20, error: Permission Denied)
</module>
The strange thing is: after setting the capabilities, I was able to execute 'le on' manually without using sudo:
pi:/usr/local/lib/python3.5/dist-packages/bluepy $ sudo setcap '' bluepy-helper
pi:/usr/local/lib/python3.5/dist-packages/bluepy $ ./bluepy-helper 0
# bluepy-helper.c version 1.3.0 built at 12:54:59 on Dec 3 2018
le on
rsp=$mgmtcode=$mgmterrestat=h14emsg='Permission Denied
quit
pi:/usr/local/lib/python3.5/dist-packages/bluepy $ sudo setcap 'cap_net_raw,cap_net_admin+eip' bluepy-helper
pi:/usr/local/lib/python3.5/dist-packages/bluepy $ ./bluepy-helper 0
# bluepy-helper.c version 1.3.0 built at 12:54:59 on Dec 3 2018
le on
rsp=$mgmtcode=$success
quit
Any ideas what might be going wrong here?
Thanks a lot! Michael