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 cli on rpi #7

Closed
minscof opened this issue Dec 1, 2019 · 4 comments
Closed

error cli on rpi #7

minscof opened this issue Dec 1, 2019 · 4 comments

Comments

@minscof
Copy link
Contributor

minscof commented Dec 1, 2019

Thanks for your code. I bought a danfoss eco valve, and I try to manage it.
When I launch the scan in root, I have this error

(libetrv) root@rpiA-parents:/home/pi/libetrv# python3 -m libetrv.cli scan
Detected eTRV devices:
Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/pi/libetrv/libetrv/cli.py", line 76, in
fire.Fire(CLI)
File "/home/pi/venv/libetrv/lib/python3.5/site-packages/fire/core.py", line 127, in Fire
component_trace = _Fire(component, args, context, name)
File "/home/pi/venv/libetrv/lib/python3.5/site-packages/fire/core.py", line 366, in _Fire
component, remaining_args)
File "/home/pi/venv/libetrv/lib/python3.5/site-packages/fire/core.py", line 542, in _CallCallable
result = fn(*varargs, **kwargs)
File "/home/pi/libetrv/libetrv/cli.py", line 22, in scan
for device in eTRVDevice.scan(timeout):
File "/home/pi/libetrv/libetrv/device.py", line 37, in scan
devices = btle.Scanner().scan(timeout)
File "/home/pi/venv/libetrv/lib/python3.5/site-packages/bluepy/btle.py", lin e 852, in scan
self.start(passive=passive)
File "/home/pi/venv/libetrv/lib/python3.5/site-packages/bluepy/btle.py", lin e 797, in start
self._mgmtCmd(self._cmd()+"end")
File "/home/pi/venv/libetrv/lib/python3.5/site-packages/bluepy/btle.py", lin e 312, in _mgmtCmd
raise BTLEManagementError("Failed to execute management command '%s'" % (c md), rsp)
bluepy.btle.BTLEManagementError: Failed to execute management command 'scanend ' (code: 11, error: Rejected)

Can you help ?

@AdamStrojek
Copy link
Owner

Hi,
It sounds like you do not have sufficient permissions to perform this action. Start this as root or follow guide in README

@minscof
Copy link
Contributor Author

minscof commented Dec 7, 2019

Thanks for your answer, but I already ran the command as root.

So I searched on google and I find this post with the same error, the proposed fix was to add "passive=True" in the btle.Scanner().scan(timeout).
I tried, and the error disapperead but the trv has not be found.
Is there something else to do to detect it ?

@minscof
Copy link
Contributor Author

minscof commented Dec 7, 2019

I increase the timeout value and I stop another processus that was using the bluetooth dongle, and it works now.

I close the issue

@minscof minscof closed this as completed Dec 7, 2019
@AdamStrojek
Copy link
Owner

I have also noticed that only one device can access Bluetooth, this is a common problem and I do not know any solution for that.

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