hbldh/bleak

Could not start notify on 0011: Unreachable

snowuyl opened this issue · 2 comments

  • bleak version: v0.21.1
  • Python version: v3.11.5
  • Operating System: Windows 11

Description

I run main.py for testing Nordic UART service. But exception occurred with the following log messages.

Logs

D:\workspace_Python\bleak-example>python3 main.py
Zephyr Bluetooth device
D7:D2:19:5F:4D:5D
Paired: True
D:\workspace_Python\bleak-example\main.py:108: FutureWarning: is_connected has been changed to a property. Calling it as an async method will be removed in a future version
x = await client.is_connected()
manual
C. Capture
M. Measure
S. Stop measure
R. Reading result
Q. Quit

Enter an option: Disconnected callback called!
Exception in thread Thread-1 (thread_function):
Traceback (most recent call last):
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1520.0_x64__qbz5n2kfra8p0\Lib\threading.py", line 1038, in _bootstrap_inner
self.run()
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1520.0_x64__qbz5n2kfra8p0\Lib\threading.py", line 975, in run
self._target(*self._args, **self.kwargs)
File "D:\workspace_Python\bleak-example\main.py", line 170, in thread_function
loop.run_until_complete(run_uart(bt_mac_address, loop))
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1520.0_x64__qbz5n2kfra8p0\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "D:\workspace_Python\bleak-example\main.py", line 111, in run_uart
await client.start_notify(UART_RX_UUID, notification_handler)
File "C:\Users\broth\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\bleak_init
.py", line 834, in start_notify
await self._backend.start_notify(characteristic, wrapped_callback, **kwargs)
File "C:\Users\broth\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\bleak\backends\winrt\client.py", line 973, in start_notify
_ensure_success(
File "C:\Users\broth\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\bleak\backends\winrt\client.py", line 163, in _ensure_success
raise BleakError(f"{fail_msg}: Unreachable")
bleak.exc.BleakError: Could not start notify on 0011: Unreachable

Procedures to reproduce this issues are as follows.

  1. Unzipping bleak-example.zip to D:\workspace_Python folder.
  2. cd D:\workspace_Python\bleak-example
  3. python3 main.py