[Python] "Could not read characteristic handle 90: Protocol Error 0x0F: Insufficient...

Discussão em 'Python' iniciado por Stack, Agosto 21, 2025.

  1. Stack

    Stack Membro Participativo

    My aim is to develop a python script on Windows PC. It should connect to a BLE gateway server (linux), read data, write data, via BLE. On Windows, Python bleak library currently has limited support for secure pairing and encrypted characteristics.

    Does anyone know how to fix this? I want it in Windows and most of my work already is windows.

    Steps:

    1. Paired the gateway manually from Windows Bluetooth Manager.
    2. Ran the script.
    3. The script successfully connect to the Gateway and retrieved the UUID characteristics.

    The issue is, when I attempt to read or write any particular UUID characteristic, I encounter some errors.

    ERROR:__main__: Connectivity read error: Could not read characteristic handle 90: Protocol Error 0x0F: Insufficient Encryption
    ERROR:__main__: Status read error: Could not read characteristic handle 93: Protocol Error 0x0F: Insufficient Encryption
    INFO:__main__: Sending command: 010203
    ERROR:__main__: Command error: Could not write value b'\x01\x02\x03' to characteristic 0064: Protocol Error 0x0F: Insufficient Encryption


    async def read_connectivity_info_only():
    try:
    async with BleakClient (ADDRESS, timeout=30.0) as client:
    if not client.is_connected:
    print("Failed to connect")
    return
    print("Connected to device.")
    for i in range(100):
    print(i)
    try:
    value = await client.read_gatt_char(CONNECTIVITY_INFO_UUID)
    timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
    print(f"[{i}] {timestamp} - connectivity info: {value}")
    await asyncio.sleep(1.0)
    except Exception as e:
    print(f"Error on read {i}: {e}")
    break

    except Exception as e:
    print(f"Connection error: {e}")




    asyncio.run(read_connectivity_info_only())

    Continue reading...

Compartilhe esta Página