Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Errno 13] Permission denied on bluepy-helper even though permissions are correctly set #482

Open
ekatiyar opened this issue May 1, 2022 · 1 comment

Comments

@ekatiyar
Copy link

ekatiyar commented May 1, 2022

I am running scan.py:

from bluepy.btle import Scanner, DefaultDelegate

class ScanDelegate(DefaultDelegate):
    def __init__(self):
        DefaultDelegate.__init__(self)

    def handleDiscovery(self, dev, isNewDev, isNewData):
        if isNewDev:
            print("Discovered device", dev.addr)
        elif isNewData:
            print("Received new data from", dev.addr)

scanner = Scanner().withDelegate(ScanDelegate())
devices = scanner.scan(10.0)

for dev in devices:
    print("Device %s (%s), RSSI=%d dB".format(dev.addr, dev.addrType, dev.rssi))
    for (adtype, desc, value) in dev.getScanData():
        print("  %s = %s".format(desc, value)

but am getting this issue:

Traceback (most recent call last):
  File "/config/scan.py", line 14, in <module>
    devices = scanner.scan(10.0)
  File "/config/.local/lib/python3.9/site-packages/bluepy/btle.py", line 852, in scan
    self.start(passive=passive)
  File "/config/.local/lib/python3.9/site-packages/bluepy/btle.py", line 789, in start
    self._startHelper(iface=self.iface)
  File "/config/.local/lib/python3.9/site-packages/bluepy/btle.py", line 279, in _startHelper
    self._helper = subprocess.Popen(args,
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
PermissionError: [Errno 13] Permission denied: '/config/.local/lib/python3.9/site-packages/bluepy/bluepy-helper'

As you can see, bluepy-helper has the widest possible permissions:

root@pi:/config# ls -la /config/.local/lib/python3.9/site-packages/bluepy/bluepy-helper
-rwxrwxrwx 1 abc users 858172 May  1 00:16 /config/.local/lib/python3.9/site-packages/bluepy/bluepy-helper

For some context I'm running this in a docker ocntainer for home assistant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants