You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BlueZ version (bluetoothctl -v) in case of Linux: 5.64
Description
I'm trying to connect to multiple BLE peripherals in one program, which needs to repeatedly read a characteristic from peripherals. I wrote my program referring to https://github.com/hbldh/bleak/blob/develop/examples/two_devices.py. When the first attempt to connect fails and the second attempt is made, the program will report errors.
[test0] Job started for 8C:F6:81:59:EB:C8[test2] Job started for B4:35:22:B8:88:C5[test1] Job started for 8C:F6:81:58:E1:CD[test0] Scanning...[test0] Found Blitz_LEE-59EBC8, connecting...[test0] Failed connecting. Error <class 'asyncio.exceptions.TimeoutError'>:[test2] Scanning...[test2] Found BlitzLEE-88C5, connecting...[test2] Failed connecting. Error <class 'bleak.exc.BleakError'>: failed to discover services, device disconnected[test1] Scanning...[test1] Found Blitz_LEE-58E1CD, connecting...[test1] Failed connecting. Error <class 'asyncio.exceptions.TimeoutError'>:[test0] Scanning...ERROR:root:A message handler raised an exception: 'org.bluez.Device1'.Traceback (most recent call last): File "src/dbus_fast/message_bus.py", line 811, in dbus_fast.message_bus.BaseMessageBus._process_message File "/usr/local/lib/python3.10/dist-packages/bleak/backends/bluezdbus/manager.py", line 854, in _parse_msg condition_callback() File "/usr/local/lib/python3.10/dist-packages/bleak/backends/bluezdbus/manager.py", line 709, in callback self._properties[device_path][defs.DEVICE_INTERFACE][property_name]KeyError: 'org.bluez.Device1'ERROR:root:A message handler raised an exception: 'org.bluez.Device1'.Traceback (most recent call last): File "src/dbus_fast/message_bus.py", line 811, in dbus_fast.message_bus.BaseMessageBus._process_message File "/usr/local/lib/python3.10/dist-packages/bleak/backends/bluezdbus/manager.py", line 854, in _parse_msg condition_callback() File "/usr/local/lib/python3.10/dist-packages/bleak/backends/bluezdbus/manager.py", line 709, in callback self._properties[device_path][defs.DEVICE_INTERFACE][property_name]KeyError: 'org.bluez.Device1'ERROR:root:A message handler raised an exception: 'org.bluez.Device1'.Traceback (most recent call last): File "src/dbus_fast/message_bus.py", line 811, in dbus_fast.message_bus.BaseMessageBus._process_message File "/usr/local/lib/python3.10/dist-packages/bleak/backends/bluezdbus/manager.py", line 854, in _parse_msg condition_callback() File "/usr/local/lib/python3.10/dist-packages/bleak/backends/bluezdbus/manager.py", line 709, in callback self._properties[device_path][defs.DEVICE_INTERFACE][property_name]KeyError: 'org.bluez.Device1'
The error message repeats many times, but the program is still running.
Thanks if anyone can help me.
The text was updated successfully, but these errors were encountered:
Thanks for the report. I think this should be fixed by #1399.
It looks like a reasonable way to maintain connections... although for this kind of polling, it could be better for battery life to disconnect and reconnect every time you want to read.
I tried the develop branch and didn't see that error again. Seems it has been successfully fixed. Thank you!
Those peripherals are made by myself. They consume less power in connections than in advertisements (thanks to the feature of BLE connection latency). That's why I'd like to maintain connections. Thanks for your suggestions!
bluetoothctl -v
) in case of Linux: 5.64Description
I'm trying to connect to multiple BLE peripherals in one program, which needs to repeatedly read a characteristic from peripherals. I wrote my program referring to https://github.com/hbldh/bleak/blob/develop/examples/two_devices.py. When the first attempt to connect fails and the second attempt is made, the program will report errors.
What I Did
Minimal reproducible example:
Logs
Outputs:
The error message repeats many times, but the program is still running.
Thanks if anyone can help me.
The text was updated successfully, but these errors were encountered: