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

deal with ble failure #16

Open
jblance opened this issue Nov 5, 2024 · 0 comments
Open

deal with ble failure #16

jblance opened this issue Nov 5, 2024 · 0 comments

Comments

@jblance
Copy link
Owner

jblance commented Nov 5, 2024

 $ powermon -C ../neey.yaml -a info
Received an adhoc command
Running adhoc command to non-connected device
not found error BleakDeviceNotFoundError()
2024-11-06 09:40:53,796:ERROR:device:run@204: Error decoding result: Unable to connect to port: None
Traceback (most recent call last):
  File "/home/johnb/.cache/pypoetry/virtualenvs/powermon-0AIXnVh3-py3.11/bin/powermon", line 6, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/johnb/powermon/powermon/runner.py", line 175, in main
    _run_async(device.run(True))
  File "/home/johnb/powermon/powermon/runner.py", line 36, in _run_async
    return async_loop.run_until_complete(coroutine)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/johnb/powermon/powermon/device.py", line 205, in run
    raise exception
  File "/home/johnb/powermon/powermon/device.py", line 199, in run
    result: Result = await self.port.run_command(command)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/johnb/powermon/powermon/ports/abstractport.py", line 84, in run_command
    raise ConnectionError(f"Unable to connect to port: {self.error_message}")
ConnectionError: Unable to connect to port: None

bluetoothctl shows controller 'stuck'??

$ bluetoothctl
Agent registered
[GW-24S4EB]#

bleReset (sometimes) clears the problem

$ powermon-cli --bleReset
$ bluetoothctl
Agent registered
[bluetooth]#

other times it fails are requires bluetooth service restart

$ powermon-cli --bleReset
command execution failed
Command '['bluetoothctl', 'power', 'off']' returned non-zero exit status 1.
$ bluetoothctl
Agent registered
[GW-24S4EB]# exit
$ sudo systemctl restart bluetooth
$ bluetoothctl
Agent registered
[bluetooth]# exit
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

1 participant