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

Error starting for first time #73

Closed
patrickstanley opened this issue Feb 3, 2022 · 4 comments
Closed

Error starting for first time #73

patrickstanley opened this issue Feb 3, 2022 · 4 comments

Comments

@patrickstanley
Copy link

Tried installing the component, but ran into the following error. Running 2021.12.1 inside docker. I am also running Passive BLE monitor integration which work fine, so HA can talk to the bluetooth dongle. Any suggestions?

`This error originated from a custom integration.

Logger: custom_components.airthings_wave.sensor
Source: custom_components/airthings_wave/airthings.py:164
Integration: airthings_wave (documentation, issues)
First occurred: 9:37:21 PM (1 occurrences)
Last logged: 9:37:21 PM

Failed intial setup.
Traceback (most recent call last):
File "/config/custom_components/airthings_wave/sensor.py", line 183, in setup_platform
num_devices_found = airthingsdetect.find_devices()
File "/config/custom_components/airthings_wave/airthings.py", line 164, in find_devices
advertisements = scanner.scan(timeout)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 852, in scan
self.start(passive=passive)
File "/usr/local/lib/python3.9/site-packages/bluepy/btle.py", line 790, in start
self._mgmtCmd("le on")
File "/usr/local/lib/python3.9/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)`

@sverrham
Copy link
Collaborator

sverrham commented Feb 3, 2022

Some access rights, see this IanHarvey/bluepy#313 (comment)

@patrickstanley
Copy link
Author

patrickstanley commented Feb 5, 2022

Challenge seems to be that inside the alpine docker container, there is no setcap.

`$ docker exec -it home-assistant bash

bash-5.1# whoami

root

bash-5.1# setcap 'cap_net_raw,cap_net_admin+eip' bluepy-helper

bash: setcap: command not found
`

@sverrham
Copy link
Collaborator

sverrham commented Feb 5, 2022

You need to up your google fu 😂
https://command-not-found.com/setcap

@patrickstanley
Copy link
Author

Thanks. I am embarrassed that I didn't find that sooner with the amount of time I spent searching. I knew it would be simple, but I just wasn't getting it. It all works now so thank you again.

For the record, I did the following from within the docker container:

apk add libcap
setcap 'cap_net_raw,cap_net_admin+eip' $(readlink -f $(which python3))
setcap 'cap_net_raw+ep' $(readlink -f $(which hcitool))

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