Closed celiafb closed 1 year ago
Please provide Bleak debug logs and Wireshark Bluetooth packet capture as described in the troubleshooting page of the docs.
- bleak version: 22.2.2
There is no such Bleak version, what is the actual version used?
- Operating System: Windows 10
What is the exact Windows 10 version, e.g. 22H1. It is the same or different from the working computer?
I'm sorry about that, let me clarify:
Bleak debugs:
DeprecationWarning: There is no current event loop
loop = asyncio.get_event_loop()
Device: DE:D3:4D:CA:60:FD
2022-11-22 12:44:29,945 bleak.backends.winrt.scanner DEBUG: Received B2:5C:DA:64:FE:26: .
2022-11-22 12:44:29,946 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:29,953 bleak.backends.winrt.scanner DEBUG: Received 62:76:1C:3B:B8:B4: .
2022-11-22 12:44:29,954 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:29,955 bleak.backends.winrt.scanner DEBUG: Received 74:C9:AB:C8:0D:BB: .
2022-11-22 12:44:29,956 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:29,959 bleak.backends.winrt.scanner DEBUG: Received 74:C9:AB:C8:0D:BB: .
2022-11-22 12:44:29,960 bleak.backends.winrt.scanner DEBUG: Received 7B:25:33:9C:A0:7E: .
2022-11-22 12:44:29,964 bleak.backends.winrt.scanner DEBUG: Received 25:47:E6:8F:3A:2A: .
2022-11-22 12:44:29,971 bleak.backends.winrt.scanner DEBUG: Received 73:56:4B:BE:83:9A: .
2022-11-22 12:44:29,972 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:29,974 bleak.backends.winrt.scanner DEBUG: Received 73:56:4B:BE:83:9A: .
2022-11-22 12:44:30,077 bleak.backends.winrt.scanner DEBUG: Received 16:EC:3F:48:BC:E5: .
2022-11-22 12:44:30,187 bleak.backends.winrt.scanner DEBUG: Received 32:37:4A:5F:A0:23: .
2022-11-22 12:44:30,190 bleak.backends.winrt.scanner DEBUG: Received 04:D4:75:3F:92:7A: .
2022-11-22 12:44:30,195 bleak.backends.winrt.scanner DEBUG: Received 23:D8:7F:B3:C9:64: .
2022-11-22 12:44:30,295 bleak.backends.winrt.scanner DEBUG: Received 2C:E2:A3:A0:41:4E: .
2022-11-22 12:44:30,305 bleak.backends.winrt.scanner DEBUG: Received 7A:E8:D1:10:BA:EA: .
2022-11-22 12:44:30,305 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:30,310 bleak.backends.winrt.scanner DEBUG: Received 3A:A1:E0:68:FC:4C: .
2022-11-22 12:44:30,311 bleak.backends.winrt.scanner DEBUG: Received 3A:FE:C2:76:F6:6F: .
2022-11-22 12:44:30,318 bleak.backends.winrt.scanner DEBUG: Received 29:74:13:41:A6:6B: .
2022-11-22 12:44:30,416 bleak.backends.winrt.scanner DEBUG: Received 3A:FE:C2:76:F6:6F: .
2022-11-22 12:44:30,420 bleak.backends.winrt.scanner DEBUG: Received 0F:97:25:E9:25:C4: .
2022-11-22 12:44:30,424 bleak.backends.winrt.scanner DEBUG: Received 1A:56:3B:D0:CE:80: .
2022-11-22 12:44:30,429 bleak.backends.winrt.scanner DEBUG: Received 11:7E:7F:CC:90:A6: .
2022-11-22 12:44:30,437 bleak.backends.winrt.scanner DEBUG: Received 58:C2:EA:31:5C:50: .
2022-11-22 12:44:30,438 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:30,439 bleak.backends.winrt.scanner DEBUG: Received 58:C2:EA:31:5C:50: .
2022-11-22 12:44:30,533 bleak.backends.winrt.scanner DEBUG: Received 11:7E:7F:CC:90:A6: .
2022-11-22 12:44:30,547 bleak.backends.winrt.scanner DEBUG: Received 38:F0:13:43:07:8B: .
2022-11-22 12:44:30,657 bleak.backends.winrt.scanner DEBUG: Received 73:EA:CA:C7:66:DF: .
2022-11-22 12:44:30,658 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:30,660 bleak.backends.winrt.scanner DEBUG: Received 73:EA:CA:C7:66:DF: .
2022-11-22 12:44:30,665 bleak.backends.winrt.scanner DEBUG: Received 54:4E:F4:81:71:A3: .
2022-11-22 12:44:30,665 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:30,666 bleak.backends.winrt.scanner DEBUG: Received 54:4E:F4:81:71:A3: .
2022-11-22 12:44:30,672 bleak.backends.winrt.scanner DEBUG: Received 5D:FC:71:70:D9:2E: .
2022-11-22 12:44:30,673 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:30,675 bleak.backends.winrt.scanner DEBUG: Received 5D:FC:71:70:D9:2E: .
2022-11-22 12:44:30,677 bleak.backends.winrt.scanner DEBUG: Received 25:47:E6:8F:3A:2A: .
2022-11-22 12:44:30,775 bleak.backends.winrt.scanner DEBUG: Received 7B:F9:05:D2:19:13: .
2022-11-22 12:44:30,776 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:30,779 bleak.backends.winrt.scanner DEBUG: Received 25:47:E6:8F:3A:2A: .
2022-11-22 12:44:30,790 bleak.backends.winrt.scanner DEBUG: Received B2:5C:DA:64:FE:26: .
2022-11-22 12:44:30,790 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:30,792 bleak.backends.winrt.scanner DEBUG: Received 39:F8:69:48:59:F8: .
2022-11-22 12:44:30,794 bleak.backends.winrt.scanner DEBUG: Received 04:D4:75:3F:92:7A: .
2022-11-22 12:44:30,796 bleak.backends.winrt.scanner DEBUG: Received 16:9A:5A:59:30:BF: .
2022-11-22 12:44:30,891 bleak.backends.winrt.scanner DEBUG: Received 04:D4:75:3F:92:7A: .
2022-11-22 12:44:30,897 bleak.backends.winrt.scanner DEBUG: Received 5F:B1:59:15:F5:BE: .
2022-11-22 12:44:30,898 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:30,904 bleak.backends.winrt.scanner DEBUG: Received 16:9A:5A:59:30:BF: .
2022-11-22 12:44:31,005 bleak.backends.winrt.scanner DEBUG: Received B2:5C:DA:64:FE:26: .
2022-11-22 12:44:31,005 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:31,008 bleak.backends.winrt.scanner DEBUG: Received B2:5C:DA:64:FE:26: .
2022-11-22 12:44:31,010 bleak.backends.winrt.scanner DEBUG: Received 3E:84:DC:4F:21:DF: .
2022-11-22 12:44:31,015 bleak.backends.winrt.scanner DEBUG: Received 42:E2:3C:49:50:E8: .
2022-11-22 12:44:31,015 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:31,016 bleak.backends.winrt.scanner DEBUG: Received 42:E2:3C:49:50:E8: .
2022-11-22 12:44:31,019 bleak.backends.winrt.scanner DEBUG: Received 7B:59:87:27:DD:C2: .
2022-11-22 12:44:31,019 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:31,023 bleak.backends.winrt.scanner DEBUG: Received 7B:59:87:27:DD:C2: .
2022-11-22 12:44:31,027 bleak.backends.winrt.scanner DEBUG: Received 23:D8:7F:B3:C9:64: .
2022-11-22 12:44:31,030 bleak.backends.winrt.scanner DEBUG: Received 7B:62:C8:81:F8:14: .
2022-11-22 12:44:31,030 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:31,122 bleak.backends.winrt.scanner DEBUG: Received 32:37:4A:5F:A0:23: .
2022-11-22 12:44:31,137 bleak.backends.winrt.scanner DEBUG: Received 3A:FE:C2:76:F6:6F: .
2022-11-22 12:44:31,241 bleak.backends.winrt.scanner DEBUG: Received 5F:FB:C6:42:5A:32: .
2022-11-22 12:44:31,242 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:31,244 bleak.backends.winrt.scanner DEBUG: Received 5F:FB:C6:42:5A:32: .
2022-11-22 12:44:31,246 bleak.backends.winrt.scanner DEBUG: Received 3A:FE:C2:76:F6:6F: .
2022-11-22 12:44:31,252 bleak.backends.winrt.scanner DEBUG: Received 1A:56:3B:D0:CE:80: .
2022-11-22 12:44:31,257 bleak.backends.winrt.scanner DEBUG: Received 3B:98:FC:71:E2:94: .
2022-11-22 12:44:31,290 bleak.backends.winrt.scanner DEBUG: Received 25:47:E6:8F:3A:2A: .
2022-11-22 12:44:31,361 bleak.backends.winrt.scanner DEBUG: Received 73:56:4B:BE:83:9A: .
2022-11-22 12:44:31,363 bleak.backends.winrt.scanner DEBUG: Received 73:56:4B:BE:83:9A: .
2022-11-22 12:44:31,366 bleak.backends.winrt.scanner DEBUG: Received 39:F8:69:48:59:F8: .
2022-11-22 12:44:31,371 bleak.backends.winrt.scanner DEBUG: Received 60:8C:C9:6A:8C:3C: .
2022-11-22 12:44:31,371 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:31,372 bleak.backends.winrt.scanner DEBUG: Received 60:8C:C9:6A:8C:3C: .
2022-11-22 12:44:31,375 bleak.backends.winrt.scanner DEBUG: Received 05:43:AF:98:0D:A3: .
2022-11-22 12:44:31,379 bleak.backends.winrt.scanner DEBUG: Received 42:E2:3C:49:50:E8: .
2022-11-22 12:44:31,382 bleak.backends.winrt.scanner DEBUG: Received 42:E2:3C:49:50:E8: .
2022-11-22 12:44:31,479 bleak.backends.winrt.scanner DEBUG: Received 05:43:AF:98:0D:A3: .
2022-11-22 12:44:31,486 bleak.backends.winrt.scanner DEBUG: Received 11:7E:7F:CC:90:A6: .
2022-11-22 12:44:31,491 bleak.backends.winrt.scanner DEBUG: Received 54:4E:F4:81:71:A3: .
2022-11-22 12:44:31,493 bleak.backends.winrt.scanner DEBUG: Received 54:4E:F4:81:71:A3: .
2022-11-22 12:44:31,605 bleak.backends.winrt.scanner DEBUG: Received 7A:E8:D1:10:BA:EA: .
2022-11-22 12:44:31,607 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:31,609 bleak.backends.winrt.scanner DEBUG: Received 3A:A1:E0:68:FC:4C: .
2022-11-22 12:44:31,612 bleak.backends.winrt.scanner DEBUG: Received 04:D4:75:3F:92:7A: .
2022-11-22 12:44:31,717 bleak.backends.winrt.scanner DEBUG: Received 5F:B1:59:15:F5:BE: .
2022-11-22 12:44:31,717 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:31,721 bleak.backends.winrt.scanner DEBUG: Received 5F:B1:59:15:F5:BE: .
2022-11-22 12:44:31,736 bleak.backends.winrt.scanner DEBUG: Received 16:9A:5A:59:30:BF: .
2022-11-22 12:44:31,837 bleak.backends.winrt.scanner DEBUG: Received 74:C9:AB:C8:0D:BB: .
2022-11-22 12:44:31,841 bleak.backends.winrt.scanner DEBUG: Received 74:C9:AB:C8:0D:BB: .
2022-11-22 12:44:31,844 bleak.backends.winrt.scanner DEBUG: Received 16:9A:5A:59:30:BF: .
2022-11-22 12:44:31,846 bleak.backends.winrt.scanner DEBUG: Received B2:5C:DA:64:FE:26: .
2022-11-22 12:44:31,852 bleak.backends.winrt.scanner DEBUG: Received 03:21:3D:25:B0:CF: .
2022-11-22 12:44:31,952 bleak.backends.winrt.scanner DEBUG: Received 7B:25:33:9C:A0:7E: .
2022-11-22 12:44:31,968 bleak.backends.winrt.scanner DEBUG: Received 2C:E2:A3:A0:41:4E: .
2022-11-22 12:44:32,070 bleak.backends.winrt.scanner DEBUG: Received 58:C2:EA:31:5C:50: .
2022-11-22 12:44:32,075 bleak.backends.winrt.scanner DEBUG: Received 58:C2:EA:31:5C:50: .
2022-11-22 12:44:32,079 bleak.backends.winrt.scanner DEBUG: Received 5B:0E:3E:79:89:C7: .
2022-11-22 12:44:32,080 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:32,081 bleak.backends.winrt.scanner DEBUG: Received 3A:FE:C2:76:F6:6F: .
2022-11-22 12:44:32,083 bleak.backends.winrt.scanner DEBUG: Received 3B:98:FC:71:E2:94: .
2022-11-22 12:44:32,086 bleak.backends.winrt.scanner DEBUG: Received 1A:56:3B:D0:CE:80: .
2022-11-22 12:44:32,088 bleak.backends.winrt.scanner DEBUG: Received DE:D3:4D:CA:60:FD: .
2022-11-22 12:44:32,088 bleak.backends.winrt.scanner DEBUG: skipping callback, waiting for scan response
2022-11-22 12:44:32,090 bleak.backends.winrt.scanner DEBUG: Received DE:D3:4D:CA:60:FD: Celia's ADC Measure.
2022-11-22 12:44:32,096 bleak.backends.winrt.scanner DEBUG: Received 05:43:AF:98:0D:A3: .
2022-11-22 12:44:32,100 bleak.backends.winrt.scanner DEBUG: 33 devices found. Watcher status: 3.
2022-11-22 12:44:32,101 bleak.backends.winrt.client DEBUG: Connecting to BLE device @ DE:D3:4D:CA:60:FD
2022-11-22 12:44:32,226 bleak.backends.winrt.client DEBUG: Get Services...
2022-11-22 12:44:32,503 bleak.backends.winrt.client DEBUG: session_status_changed_event_handler: id: <_bleak_winrt_Windows_Devices_Bluetooth.BluetoothDeviceId object at 0x000001E2D7185210>, error: 0, status: 1
2022-11-22 12:44:33,044 bleak.backends.winrt.client DEBUG: DE:D3:4D:CA:60:FD: services changed
2022-11-22 12:44:33,044 bleak.backends.winrt.client WARNING: DE:D3:4D:CA:60:FD: unhandled services changed event
2022-11-22 12:44:33,101 bleak.backends.winrt.client DEBUG: DE:D3:4D:CA:60:FD: services changed
2022-11-22 12:44:33,101 bleak.backends.winrt.client WARNING: DE:D3:4D:CA:60:FD: unhandled services changed event
2022-11-22 12:44:33,157 bleak.backends.winrt.client DEBUG: DE:D3:4D:CA:60:FD: services changed
2022-11-22 12:44:33,158 bleak.backends.winrt.client WARNING: DE:D3:4D:CA:60:FD: unhandled services changed event
Traceback (most recent call last):
File "C:\Users\Celia\AppData\Local\Programs\Python\Python311\Lib\site-packages\bleak\backends\winrt\client.py", line 383, in connect
await asyncio.gather(wait_connect_task, wait_get_services_task)
File "C:\Users\Celia\AppData\Local\Programs\Python\Python311\Lib\site-packages\bleak\backends\winrt\client.py", line 643, in get_services
await characteristic.get_descriptors_async(*args),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Celia\Scripts\Python\csblesimp.py", line 103, in <module>
loop.run_until_complete(main())
File "C:\Users\Celia\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 650, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\Celia\Scripts\Python\csblesimp.py", line 85, in main
await data_client(device)
File "C:\Users\Celia\Scripts\Python\csblesimp.py", line 31, in data_client
async with BleakClient(device) as client:
File "C:\Users\Celia\AppData\Local\Programs\Python\Python311\Lib\site-packages\bleak\__init__.py", line 436, in __aenter__
await self.connect()
File "C:\Users\Celia\AppData\Local\Programs\Python\Python311\Lib\site-packages\bleak\__init__.py", line 474, in connect
return await self._backend.connect(**kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Celia\AppData\Local\Programs\Python\Python311\Lib\site-packages\bleak\backends\winrt\client.py", line 382, in connect
async with async_timeout(timeout):
File "C:\Users\Celia\AppData\Local\Programs\Python\Python311\Lib\asyncio\timeouts.py", line 98, in __aexit__
raise TimeoutError
TimeoutError
Wireshark BTP capture:
No. Time Source Destination Protocol Length Info
1 0.000000 host controller HCI_CMD 6 Sent LE Set Scan Enable
2 0.005204 controller host HCI_EVT 7 Rcvd Command Complete (LE Set Scan Enable)
3 0.005233 host controller HCI_CMD 6 Sent Vendor Command 0x001E (opcode 0xFC1E)
4 0.007192 controller host HCI_EVT 8 Rcvd Command Complete (Vendor Command 0x001E [opcode 0xFC1E])
5 0.007208 host controller HCI_CMD 11 Sent LE Set Scan Parameters
6 0.009213 controller host HCI_EVT 7 Rcvd Command Complete (LE Set Scan Parameters)
7 0.009236 host controller HCI_CMD 6 Sent LE Set Scan Enable
8 0.012201 controller host HCI_EVT 7 Rcvd Command Complete (LE Set Scan Enable)
9 0.014203 controller host HCI_EVT 44 Rcvd LE Meta (LE Advertising Report)
10 0.022220 controller host HCI_EVT 33 Rcvd LE Meta (LE Advertising Report)
11 0.024265 controller host HCI_EVT 32 Rcvd LE Meta (LE Advertising Report)
12 0.025244 controller host HCI_EVT 15 Rcvd LE Meta (LE Advertising Report)
13 0.026207 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
14 0.028215 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
15 0.040221 controller host HCI_EVT 32 Rcvd LE Meta (LE Advertising Report)
16 0.041259 controller host HCI_EVT 15 Rcvd LE Meta (LE Advertising Report)
17 0.147216 controller host HCI_EVT 43 Rcvd LE Meta (LE Advertising Report)
18 0.258215 controller host HCI_EVT 42 Rcvd LE Meta (LE Advertising Report)
19 0.260226 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
20 0.265219 controller host HCI_EVT 43 Rcvd LE Meta (LE Advertising Report)
21 0.366215 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
22 0.375215 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
23 0.376202 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
24 0.380220 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
25 0.388212 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
26 0.487216 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
27 0.491219 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
28 0.494229 controller host HCI_EVT 43 Rcvd LE Meta (LE Advertising Report)
29 0.500211 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
30 0.507214 controller host HCI_EVT 32 Rcvd LE Meta (LE Advertising Report)
31 0.508202 controller host HCI_EVT 15 Rcvd LE Meta (LE Advertising Report)
32 0.604216 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
33 0.618215 controller host HCI_EVT 43 Rcvd LE Meta (LE Advertising Report)
34 0.727216 controller host HCI_EVT 33 Rcvd LE Meta (LE Advertising Report)
35 0.728260 controller host HCI_EVT 15 Rcvd LE Meta (LE Advertising Report)
36 0.735223 controller host HCI_EVT 34 Rcvd LE Meta (LE Advertising Report)
37 0.736204 controller host HCI_EVT 15 Rcvd LE Meta (LE Advertising Report)
38 0.742235 controller host HCI_EVT 33 Rcvd LE Meta (LE Advertising Report)
39 0.743201 controller host HCI_EVT 15 Rcvd LE Meta (LE Advertising Report)
40 0.745213 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
41 0.845222 controller host HCI_EVT 33 Rcvd LE Meta (LE Advertising Report)
42 0.848215 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
43 0.860204 controller host HCI_EVT 44 Rcvd LE Meta (LE Advertising Report)
44 0.862347 controller host HCI_EVT 30 Rcvd LE Meta (LE Advertising Report)
45 0.865203 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
46 0.867219 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
47 0.962336 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
48 0.967219 controller host HCI_EVT 34 Rcvd LE Meta (LE Advertising Report)
49 0.974214 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
50 1.075215 controller host HCI_EVT 44 Rcvd LE Meta (LE Advertising Report)
51 1.076200 controller host HCI_EVT 26 Rcvd LE Meta (LE Advertising Report)
52 1.079225 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
53 1.084211 controller host HCI_EVT 30 Rcvd LE Meta (LE Advertising Report)
54 1.085205 controller host HCI_EVT 15 Rcvd LE Meta (LE Advertising Report)
55 1.089220 controller host HCI_EVT 33 Rcvd LE Meta (LE Advertising Report)
56 1.090203 controller host HCI_EVT 15 Rcvd LE Meta (LE Advertising Report)
57 1.097225 controller host HCI_EVT 43 Rcvd LE Meta (LE Advertising Report)
58 1.100209 controller host HCI_EVT 32 Rcvd LE Meta (LE Advertising Report)
59 1.193215 controller host HCI_EVT 42 Rcvd LE Meta (LE Advertising Report)
60 1.208215 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
61 1.311216 controller host HCI_EVT 34 Rcvd LE Meta (LE Advertising Report)
62 1.312207 controller host HCI_EVT 15 Rcvd LE Meta (LE Advertising Report)
63 1.313201 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
64 1.323212 controller host HCI_EVT 43 Rcvd LE Meta (LE Advertising Report)
65 1.328213 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
66 1.360218 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
67 1.430214 controller host HCI_EVT 32 Rcvd LE Meta (LE Advertising Report)
68 1.431203 controller host HCI_EVT 15 Rcvd LE Meta (LE Advertising Report)
69 1.432205 controller host HCI_EVT 30 Rcvd LE Meta (LE Advertising Report)
70 1.441213 controller host HCI_EVT 34 Rcvd LE Meta (LE Advertising Report)
71 1.442199 controller host HCI_EVT 15 Rcvd LE Meta (LE Advertising Report)
72 1.444208 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
73 1.450215 controller host HCI_EVT 30 Rcvd LE Meta (LE Advertising Report)
74 1.451201 controller host HCI_EVT 15 Rcvd LE Meta (LE Advertising Report)
75 1.550215 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
76 1.556217 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
77 1.560254 controller host HCI_EVT 34 Rcvd LE Meta (LE Advertising Report)
78 1.561230 controller host HCI_EVT 15 Rcvd LE Meta (LE Advertising Report)
79 1.676214 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
80 1.679220 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
81 1.682231 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
82 1.787215 controller host HCI_EVT 34 Rcvd LE Meta (LE Advertising Report)
83 1.788203 controller host HCI_EVT 15 Rcvd LE Meta (LE Advertising Report)
84 1.807213 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
85 1.907216 controller host HCI_EVT 32 Rcvd LE Meta (LE Advertising Report)
86 1.908207 controller host HCI_EVT 15 Rcvd LE Meta (LE Advertising Report)
87 1.912230 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
88 1.915214 controller host HCI_EVT 44 Rcvd LE Meta (LE Advertising Report)
89 1.923212 controller host HCI_EVT 43 Rcvd LE Meta (LE Advertising Report)
90 2.022374 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
91 2.039212 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
92 2.140216 controller host HCI_EVT 32 Rcvd LE Meta (LE Advertising Report)
93 2.141209 controller host HCI_EVT 15 Rcvd LE Meta (LE Advertising Report)
94 2.143215 controller host HCI_EVT 32 Rcvd LE Meta (LE Advertising Report)
95 2.146218 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
96 2.148221 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
97 2.149209 controller host HCI_EVT 43 Rcvd LE Meta (LE Advertising Report)
98 2.154222 controller host HCI_EVT 36 Rcvd LE Meta (LE Advertising Report)
99 2.155209 controller host HCI_EVT 36 Rcvd LE Meta (LE Advertising Report)
100 2.163272 controller host HCI_EVT 46 Rcvd LE Meta (LE Advertising Report)
101 2.171599 host controller HCI_CMD 6 Sent LE Set Scan Enable
102 2.174214 controller host HCI_EVT 7 Rcvd Command Complete (LE Set Scan Enable)
103 2.174231 host controller HCI_CMD 6 Sent Vendor Command 0x001E (opcode 0xFC1E)
104 2.176212 controller host HCI_EVT 8 Rcvd Command Complete (Vendor Command 0x001E [opcode 0xFC1E])
105 2.176249 host controller HCI_CMD 11 Sent LE Set Scan Parameters
106 2.178220 controller host HCI_EVT 7 Rcvd Command Complete (LE Set Scan Parameters)
107 2.178534 host controller HCI_CMD 6 Sent LE Set Scan Enable
108 2.181275 controller host HCI_EVT 7 Rcvd Command Complete (LE Set Scan Enable)
109 2.296700 host controller HCI_CMD 6 Sent LE Set Scan Enable
110 2.299239 controller host HCI_EVT 7 Rcvd Command Complete (LE Set Scan Enable)
111 2.299322 host controller HCI_CMD 11 Sent LE Add Device To White List
112 2.301224 controller host HCI_EVT 7 Rcvd Command Complete (LE Add Device To White List)
113 2.301244 host controller HCI_CMD 6 Sent LE Set Scan Enable
114 2.304213 controller host HCI_EVT 7 Rcvd Command Complete (LE Set Scan Enable)
115 2.304255 host controller HCI_CMD 29 Sent LE Create Connection
116 2.306192 controller host HCI_EVT 7 Rcvd Command Status (LE Create Connection)
117 2.568216 controller host HCI_EVT 22 Rcvd LE Meta (LE Connection Complete)
118 2.568280 host controller HCI_CMD 6 Sent LE Read Channel Map
119 2.569210 controller host HCI_EVT 30 Rcvd Vendor-Specific
120 2.570198 controller host HCI_EVT 14 Rcvd Command Complete (LE Read Channel Map)
121 2.571704 localhost () de:d3:4d:ca:60:fd (Celia's ADC Measure) ATT 12 Sent Exchange MTU Request, Client Rx MTU: 527
122 2.580044 de:d3:4d:ca:60:fd (Celia's ADC Measure) localhost () L2CAP 21 Rcvd Connection Parameter Update Request
123 2.580068 localhost () de:d3:4d:ca:60:fd (Celia's ADC Measure) L2CAP 15 Sent Connection Parameter Update Response (Accepted)
124 2.580111 host controller HCI_CMD 18 Sent LE Connection Update
125 2.582198 controller host HCI_EVT 7 Rcvd Command Status (LE Connection Update)
126 2.641218 controller host HCI_EVT 8 Rcvd Number of Completed Packets
127 2.699940 de:d3:4d:ca:60:fd (Celia's ADC Measure) localhost () ATT 12 Rcvd Exchange MTU Response, Server Rx MTU: 23
128 2.701134 localhost () de:d3:4d:ca:60:fd (Celia's ADC Measure) ATT 16 Sent Read By Group Type Request, GATT Primary Service Declaration, Handles: 0x0001..0xffff
129 2.701203 controller host HCI_EVT 8 Rcvd Number of Completed Packets
130 2.821215 controller host HCI_EVT 8 Rcvd Number of Completed Packets
131 2.879922 de:d3:4d:ca:60:fd (Celia's ADC Measure) localhost () ATT 23 Rcvd Read By Group Type Response, Attribute List Length: 2, Generic Access Profile, Generic Attribute Profile
132 2.880602 localhost () de:d3:4d:ca:60:fd (Celia's ADC Measure) ATT 16 Sent Read By Group Type Request, GATT Primary Service Declaration, Handles: 0x000c..0xffff
133 2.941215 controller host HCI_EVT 8 Rcvd Number of Completed Packets
134 2.999999 de:d3:4d:ca:60:fd (Celia's ADC Measure) localhost () ATT 31 Rcvd Read By Group Type Response, Attribute List Length: 1, Unknown
135 3.001015 localhost () de:d3:4d:ca:60:fd (Celia's ADC Measure) ATT 16 Sent Read By Type Request, GATT Characteristic Declaration, Handles: 0x0008..0x000b
136 3.121213 controller host HCI_EVT 8 Rcvd Number of Completed Packets
137 3.719893 de:d3:4d:ca:60:fd (Celia's ADC Measure) localhost () ATT 18 Rcvd Read By Type Response, Attribute List Length: 1, Service Changed
138 3.720385 localhost () de:d3:4d:ca:60:fd (Celia's ADC Measure) ATT 16 Sent Read By Type Request, GATT Characteristic Declaration, Handles: 0x0001..0x0007
139 3.722200 controller host HCI_EVT 13 Rcvd LE Meta (LE Connection Update Complete)
140 6.183216 controller host HCI_EVT 8 Rcvd Number of Completed Packets
141 7.320051 de:d3:4d:ca:60:fd (Celia's ADC Measure) localhost () ATT 32 Rcvd Read By Type Response, Attribute List Length: 3, Device Name, Appearance, Peripheral Preferred Connection Parameters
142 7.320554 localhost () de:d3:4d:ca:60:fd (Celia's ADC Measure) ATT 16 Sent Read By Type Request, GATT Characteristic Declaration, Handles: 0x0007..0x0007
143 8.521214 controller host HCI_EVT 8 Rcvd Number of Completed Packets
144 9.719915 de:d3:4d:ca:60:fd (Celia's ADC Measure) localhost () ATT 14 Rcvd Error Response - Attribute Not Found, Handle: 0x0007 (Generic Access Profile: Peripheral Preferred Connection Parameters)
145 9.720476 localhost () de:d3:4d:ca:60:fd (Celia's ADC Measure) ATT 16 Sent Read By Type Request, GATT Characteristic Declaration, Handles: 0x000a..0x000b
146 10.921219 controller host HCI_EVT 8 Rcvd Number of Completed Packets
147 12.119921 de:d3:4d:ca:60:fd (Celia's ADC Measure) localhost () ATT 14 Rcvd Error Response - Attribute Not Found, Handle: 0x000a (Generic Attribute Profile: Service Changed)
148 12.120706 localhost () de:d3:4d:ca:60:fd (Celia's ADC Measure) ATT 14 Sent Find Information Request, Handles: 0x000b..0x000b
149 12.289848 host controller HCI_CMD 6 Sent LE Set Scan Enable
150 12.292214 controller host HCI_EVT 7 Rcvd Command Complete (LE Set Scan Enable)
151 12.292241 host controller HCI_CMD 11 Sent LE Remove Device From White List
152 12.294221 controller host HCI_EVT 7 Rcvd Command Complete (LE Remove Device From White List)
153 12.294282 host controller HCI_CMD 6 Sent LE Set Scan Enable
154 12.297244 controller host HCI_EVT 7 Rcvd Command Complete (LE Set Scan Enable)
155 13.321222 controller host HCI_EVT 8 Rcvd Number of Completed Packets
156 14.519962 de:d3:4d:ca:60:fd (Celia's ADC Measure) localhost () ATT 15 Rcvd Find Information Response, Handle: 0x000b (Generic Attribute Profile: Service Changed: Client Characteristic Configuration)
157 14.520598 localhost () de:d3:4d:ca:60:fd (Celia's ADC Measure) ATT 12 Sent Read Request, Handle: 0x0003 (Generic Access Profile: Device Name)
158 15.721211 controller host HCI_EVT 8 Rcvd Number of Completed Packets
159 16.919987 de:d3:4d:ca:60:fd (Celia's ADC Measure) localhost () ATT 17 Rcvd Read Response, Handle: 0x0003 (Generic Access Profile: Device Name)
160 16.920597 localhost () de:d3:4d:ca:60:fd (Celia's ADC Measure) ATT 14 Sent Write Request, Handle: 0x000b (Generic Attribute Profile: Service Changed: Client Characteristic Configuration)
161 18.121211 controller host HCI_EVT 8 Rcvd Number of Completed Packets
162 19.319965 de:d3:4d:ca:60:fd (Celia's ADC Measure) localhost () ATT 10 Rcvd Write Response, Handle: 0x000b (Generic Attribute Profile: Service Changed: Client Characteristic Configuration)
163 19.320530 localhost () de:d3:4d:ca:60:fd (Celia's ADC Measure) ATT 12 Sent Read Request, Handle: 0x0005 (Generic Access Profile: Appearance)
164 20.521213 controller host HCI_EVT 8 Rcvd Number of Completed Packets
165 21.719982 de:d3:4d:ca:60:fd (Celia's ADC Measure) localhost () ATT 12 Rcvd Read Response, Handle: 0x0005 (Generic Access Profile: Appearance)
166 21.721100 localhost () de:d3:4d:ca:60:fd (Celia's ADC Measure) ATT 12 Sent Read Request, Handle: 0x0007 (Generic Access Profile: Peripheral Preferred Connection Parameters)
167 22.921214 controller host HCI_EVT 8 Rcvd Number of Completed Packets
168 24.120058 de:d3:4d:ca:60:fd (Celia's ADC Measure) localhost () ATT 18 Rcvd Read Response, Handle: 0x0007 (Generic Access Profile: Peripheral Preferred Connection Parameters)
169 27.184063 host controller HCI_CMD 7 Sent Disconnect
170 27.187187 controller host HCI_EVT 7 Rcvd Command Status (Disconnect)
171 27.722205 controller host HCI_EVT 7 Rcvd Disconnect Complete
172 27.723210 controller host HCI_EVT 19 Rcvd Vendor-Specific
Thanks for the logs. Can you zip and upload the full wireshark logs?
Also, can you share the program to reproduce the problem?
Yes, I think these are the full Wireshark logs -- please let me know if there's something else you need.
Thank you! BTP.pcapng.zip csblesimp.py.zip
File "C:\Users\Celia\AppData\Local\Programs\Python\Python311\Lib\site-packages\bleak\backends\winrt\client.py", line 382, in connect
Line 382 is blank in Bleak v0.19.5. Are you sure you are using that version?
Also try rebooting the computer to rule out any Windows Bluetooth stack issues.
Just tried rebooting -- same issue, unfortunately. Sorry, the Bleak version is v0.19.4 (just confirmed in the command prompt by running "pip show bleak").
Please try with v0.19.5.
Just updated to v0.19.5 using "pip install -U bleak", then tried again, and getting the same TimeoutError.
Can you redo the logs with the new version?
Yes, will start on those now.
logs.txt still looks like the old version.
File "C:\Users\Celia\AppData\Local\Programs\Python\Python311\Lib\site-packages\bleak\backends\winrt\client.py", line 382, in connect
Is there another way I can ensure I'm updating bleak? Running "pip install -U bleak" seemed to update it, and then running "pip show bleak" shows v019.5 as the current version...
Do you have multiple versions of Python installed? Maybe pip is running on a different Python install? You can try running py -3.11 -m pip show bleak
to ensure a specific Python version and then run the program with py -3.11 program.py
.
Or ideally use a virtual environment.
Okay, yeah, I think the Bleak v0.19.5 was only updated for my past Python 3.10 version. Now, I updated Bleak to v0.19.5 on Python 3.11 which I am using to run the script. Same issue, and I'm attaching the logs. logs3.txt BTP3.pcapng.zip
Looks like there was a typo setting BLEAK_LOGGING in logs3.txt so it didn't take effect.
Also, you should change
if __name__ == "__main__":
loop = asyncio.get_event_loop()
try:
loop.run_until_complete(main())
finally:
loop.close()
to
if __name__ == "__main__":
asyncio.run(main())
for proper cleanup of tasks on exit/crash
Sorry about that. I fixed the typo and regenerated the logs, and I changed the code according to your suggestion (thank you by the way!). logs4.txt BTP4.pcapng.zip
Does the other Windows 10 computer that was working still work with Bleak v0.19.5?
Does it make a difference if you make the timeout longer?
Do older versions of Bleak work (i.e. 0.18.x)?
Does #1143 make a difference? Even it it doesn't can you capture the debug logs since more logging was added there?
The computer where it does work has v0.18.1 installed. How can I install this version on my current desktop to check if it would work?
Also, I'm not sure how to make the Timeout longer. I'll check out #1143 and get back to you.
Thanks!
you can pip install bleak==0.18.1
to install a specific version. Likewise, you can pip install https://github.com/hbldh/bleak/archive/refs/heads/winrt-fix-leaking-services.zip
to get the branch from #1143.
To change the timeout, add a timeout=30
argument to BleakClient(...)
.
Okay, I haven't changed the timeout yet, but I'll do that next.
Running with the #1143 branch seems to connect to my peripheral, but then nothing gets logged and everything becomes sort of stuck, until I keyboard interrupt with Ctrl+C. BTPlogs5.pcapng.zip logs5.txt
With this setup, changing the timeout to 30 does not make a difference.
FYI, I just pushed some more changes to #1143 to disable the retry altogether since the hang seems to always happen after that.
Thanks for following up. Updating to the latest version in #1143 unfortunately didn't solve the issue either.
Can you share the logs for this latest attempt?
I still see "restarting get services due to services changed event" in the logs, so either I didn't do the change right or you didn't get the latest changes. Do you see _retry_on_services_changed
in your local copy of bleak/backends/winrt/client.py
?
No, I can't find _retry_on_services_changed in my local copy of bleak/backends/winrt/client.py.
I installed the updated branch using pip install https://github.com/hbldh/bleak/archive/refs/heads/winrt-fix-leaking-services.zip
Maybe you got a cached version of the zip file? The latest changes should have _retry_on_services_changed
in the code.
Hm, okay. Is there a different link that I should be using for the update?
Add --no-cache-dir
to the pip install
command?
Done. Still no change.
It looks like it is still running the wrong version. Are you sure you are installing the package in the right place? (like in https://github.com/hbldh/bleak/issues/1137#issuecomment-1324296824)
I think so? My logs7.txt file shows the command I used to install it, and I made sure to run py -3.11
to specify this. Does that seem incorrect?
Uninstall it then install it again? If I manually download that zip file, it looks right.
Thanks! Okay, so now _retry_on_services_changed
is definitely in client.py
. Here are my logs.
OK, making progress now. I had a mistake in my latest change that caused the new exception. I just pushed the fix, so try uninstalling and installing the package again.
Oh, it works now! It was able to connect to the peripheral and receive the bytearray values as expected. I'm attaching the logs again in case that's helpful now or in the future.
Thank you so much, David, for helping me deal with this issue!
Thanks for all of the testing!
bluetoothctl -v
) in case of Linux:Description
I'm trying to run a custom script to connect to a peripheral. This script works perfectly on my Mac and on my other Windows 10, and everything works, but when trying to set it up on a new Windows 10 laptop, I keep getting this TimeOut error.
What I Did
This is the error that I get: