NimBLE reconnection fails when paired with Secure Connection enabled

StevePeake
Posts: 8
Joined: Mon Nov 30, 2020 10:52 am

NimBLE reconnection fails when paired with Secure Connection enabled

Postby StevePeake » Wed Feb 03, 2021 11:18 am

Hello

I've just started using BLE in my project, using NimBLE (esp-idf v3.3.4).

I am using the bleprph example, with CONFIG_EXAMPLE_BONDING, CONFIG_EXAMPLE_MITM, and CONFIG_EXAMPLE_USE_SC all enabled.

I am connecting with an Android phone, using the LightBlue app.

I can connect, disconnect, and reconnect fine - so long as I don't write to the gatt_svr_chr_sec_test_static_uuid characteristic.

If I write to this characteristic, I have to accept a pairing request.

If I then disconnect, reconnecting fails.

After this failure, I can reconnect successfully.

I've seen exactly the same behaviour with the nRF Connect app. Using Bluetooth LE Explorer from my Win10 desktop has similar issues - trying to reconnect once paired causes a repeated stream of disconnections.

If I disable CONFIG_EXAMPLE_USE_SC, I can reconnect without being disconnected.

Logs from LightBlue app and bleprph output:
LightBlue_log.txt
(4.35 KiB) Downloaded 365 times
bleprph_log.txt
(5.37 KiB) Downloaded 328 times
Any suggestions how to investigate further would be appreciated.

Who is online

Users browsing this forum: No registered users and 265 guests