Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bleak pair failed with protection_level 1 #1372

Open
snowuyl opened this issue Jul 24, 2023 · 0 comments
Open

bleak pair failed with protection_level 1 #1372

snowuyl opened this issue Jul 24, 2023 · 0 comments
Labels
3rd party issue The issue is with the Bluetooth stack, the BLE device, or other 3rd party code not with Bleak itself Backend: WinRT Issues or PRs relating to the WinRT backend

Comments

@snowuyl
Copy link

snowuyl commented Jul 24, 2023

  • bleak version: v0.20.2
  • Python version: v3.11.4
  • Operating System: Windows 11

Description

I added the following code in sample program uart_service.py for pairing with Nordic nRF5340 device.

async with BleakClient(device, disconnected_callback=handle_disconnect) as client:
        await client.start_notify(UART_TX_CHAR_UUID, handle_rx)
        paired = await client.pair(protection_level=1)
        print(f"Paired: {paired}")

Logs

Log messages of Windows 11 command prompt is as follows.

D:\workspace_Python\bleak\examples>python3 uart_service.py
Device was disconnected, goodbye.

Log messages of RTT Viewer is as follows.

00> *** Booting Zephyr OS build v3.2.99-ncs2 ***
00> btInit() e
00> btInit() x
00> _btReady(0) e
00> Bluetooth initialized
00> _btReady(0) x
00> connected() e
00> Connected D8:F8:83:9F:72:1A (public)
00> _gCurrentConn=0x20001568
00> state = connect
00> connected() x
00> _gBtNusMtu=244
00> BT NUS thread starts running
00> [00:00:16.780,761] <wrn> btnus: NUS send timeout
00> Security failed: D8:F8:83:9F:72:1A (public) level 1 err 9Pairing failed conn: D8:F8:83:9F:72:1A (public), reason 9state = disconnect
00> Disconnected: D8:F8:83:9F:72:1A (public) (reason 19)
@dlech dlech added 3rd party issue The issue is with the Bluetooth stack, the BLE device, or other 3rd party code not with Bleak itself Backend: WinRT Issues or PRs relating to the WinRT backend labels Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party issue The issue is with the Bluetooth stack, the BLE device, or other 3rd party code not with Bleak itself Backend: WinRT Issues or PRs relating to the WinRT backend
Projects
None yet
Development

No branches or pull requests

2 participants