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

[Andorid]bleak.exc.BleakError: ('onConnectionStateChange', 'Insufficient Authorization', 0) #1696

Open
tsiens opened this issue Dec 10, 2024 · 0 comments

Comments

@tsiens
Copy link

tsiens commented Dec 10, 2024

  • bleak version: 0.22.3
  • Python version: 3.11.0
  • Operating System: android
  • BlueZ version (bluetoothctl -v) in case of Linux:

Description

I have packaged a Flask single-threaded app using p4a WebView. When I use Bleak and intentionally turn off the Bluetooth Low Energy (BLE) power, an error occurs and the entire app becomes unresponsive and crashes. This issue does not occur in Windows.

Logs

12-10 22:38:34.273 20315 20406 I python  : Exception in callback AsyncJavaCallbacks._result_state_unthreadsafe('Insufficient Authorization', 'onConnectionStateChange', (0,))
12-10 22:38:34.273 20315 20406 I python  : handle: <Handle AsyncJavaCallbacks._result_state_unthreadsafe('Insufficient Authorization', 'onConnectionStateChange', (0,))>
12-10 22:38:34.273 20315 20406 I python  : Traceback (most recent call last):
12-10 22:38:34.273 20315 20406 I python  :   File "/home/user/.local/share/python-for-android/build/other_builds/python3/arm64-v8a__ndk_target_24/python3/Lib/asyncio/events.py", line 80, in _run
12-10 22:38:34.273 20315 20406 I python  :   File "/home/user/.local/share/python-for-android/build/python-installs/tda/arm64-v8a/bleak/backends/p4android/utils.py", line 94, in _result_state_unthreadsafe    
12-10 22:38:34.273 20315 20406 I python  : bleak.exc.BleakError: ('onConnectionStateChange', 'Insufficient Authorization', 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants