Slow BLE data flow after reconnection following a sudden disconnection

Waganama
Posts: 1
Joined: Tue Sep 24, 2024 9:52 am

Slow BLE data flow after reconnection following a sudden disconnection

Postby Waganama » Tue Sep 24, 2024 10:07 am

Hello everyone,

I'm asking for your help in resolving an issue concerning BLE data transfer.

Context:
I'm using an ESP32 device running the Nimble host with ESP-IDF version 5.0.
To connect and send data to my device, I use a PC running Windows 10 or 11 with a Python script (using the Bleak module).
My device has one characteristic registered to a GATT service.

Actual behavior:
After a sudden BLE disconnection during data transfer, the device behaves strangely. Upon reconnection, the data transfer is incredibly slow, and the device automatically disconnects after receiving a few packets.

Expected behavior:
The data transfer should remain smooth and uninterrupted.

Here are steps to reproduce:
  • Enable and initialize a characteristic for one GATT characteristic on Nimble for an ESP32 device.
  • Start advertising for the device to be discoverable.
  • On the PC, launch a Python script (using Bleak) to connect and send data (500 or more packets of 514 bytes).
  • Disconnect Bluetooth on the PC (disable the Bluetooth button or disconnect the Bluetooth antenna). The transfer and connection are interrupted.
  • Relaunch the same Python script. Here, the data reception on the device side is very slow, and the connection is interrupted after receiving a few data packets.
You will find attached the terminal log of the current issue and the sample project I used to reproduce it.

PS: I'm unable to reproduce the issue on ESP32-S3, ESP32-C3.

Cheers
Attachments
log.poc_ble.20240924110311.txt
(15.18 KiB) Downloaded 81 times
ble_sample.zip
(10.38 KiB) Downloaded 90 times

Who is online

Users browsing this forum: No registered users and 43 guests