I was working with the py-opendisplay CLI on windows, and was entirely unable to connect to my OD device. The browser on the same machine works fine (toolbox & ble tester), so I was puzzled.
Apparently, something in Windows has a hard time with the way the GATT service is exposed. When I changed the characteristics GUID to be something different than the service, it works consistently.
I cannot immediately find guidance stating that they should be different - I can just observe that various guides pick different GUIDs for services & characteristics.
On Windows, py-opendisplay cli said:
Error: BLE connection failed: Failed to connect: Service 00002446-0000-1000-8000-00805F9B34FB not found
I added some debug emissions to see which services were exposed, and sure enough, the service wasn't there:
DEBUG Discovered GATT table for E0:72:A1:F9:00:75: connection.py:146
DEBUG Service 00001800-0000-1000-8000-00805f9b34fb (Generic Access Profile) connection.py:148
DEBUG Characteristic 00002a00-0000-1000-8000-00805f9b34fb [read] connection.py:151
DEBUG Characteristic 00002a01-0000-1000-8000-00805f9b34fb [read] connection.py:151
DEBUG Service 00001801-0000-1000-8000-00805f9b34fb (Generic Attribute connection.py:148
Profile)
DEBUG Characteristic 00002a05-0000-1000-8000-00805f9b34fb [indicate] connection.py:151
DEBUG Descriptor 00002902-0000-1000-8000-00805f9b34fb connection.py:153
DEBUG Characteristic 00002b3a-0000-1000-8000-00805f9b34fb [read] connection.py:151
DEBUG Characteristic 00002b29-0000-1000-8000-00805f9b34fb [read, write] connection.py:151
I had an agent fix something for me, and to be frank, I'm not entirely sure what was wrong. Here is what the agent describes:
Two issues were identified:
-
Missing CCCD descriptor — The characteristic was configured with the NOTIFY property but lacked a Client Characteristic Configuration Descriptor (CCCD / BLE2902). Without a CCCD, a central (including Windows) cannot actually subscribe to notifications, even though the property is advertised. Some BLE stacks silently fail or refuse to enumerate a service that advertises NOTIFY without a corresponding CCCD.
-
UUID construction method — The service and characteristic UUIDs were constructed using the full 128-bit string form. The ESP32 BLE stack normalises UUIDs internally using the 16-bit alias form for standard Bluetooth base UUIDs. The mismatch between the construction method and the internal representation caused inconsistent behaviour during service advertisement and discovery, particularly affecting how the service was exposed to Windows clients.
--
Am I the only one who's seen this on Windows?
I can submit the fix I have, but I can't explain it, yet :|
I was working with the py-opendisplay CLI on windows, and was entirely unable to connect to my OD device. The browser on the same machine works fine (toolbox & ble tester), so I was puzzled.
Apparently, something in Windows has a hard time with the way the GATT service is exposed. When I changed the characteristics GUID to be something different than the service, it works consistently.
I cannot immediately find guidance stating that they should be different - I can just observe that various guides pick different GUIDs for services & characteristics.
On Windows, py-opendisplay cli said:
Error: BLE connection failed: Failed to connect: Service 00002446-0000-1000-8000-00805F9B34FB not foundI added some debug emissions to see which services were exposed, and sure enough, the service wasn't there:
I had an agent fix something for me, and to be frank, I'm not entirely sure what was wrong. Here is what the agent describes:
Two issues were identified:
Missing CCCD descriptor — The characteristic was configured with the
NOTIFYproperty but lacked a Client Characteristic Configuration Descriptor (CCCD / BLE2902). Without a CCCD, a central (including Windows) cannot actually subscribe to notifications, even though the property is advertised. Some BLE stacks silently fail or refuse to enumerate a service that advertises NOTIFY without a corresponding CCCD.UUID construction method — The service and characteristic UUIDs were constructed using the full 128-bit string form. The ESP32 BLE stack normalises UUIDs internally using the 16-bit alias form for standard Bluetooth base UUIDs. The mismatch between the construction method and the internal representation caused inconsistent behaviour during service advertisement and discovery, particularly affecting how the service was exposed to Windows clients.
--
Am I the only one who's seen this on Windows?
I can submit the fix I have, but I can't explain it, yet :|