Hello,
I am trying to send a large file through BLE from an nRF52811 to a Raspberry Pi 4. File size is about 77 kilobytes.
Here is BLE setup on the nRF side:
- Custom profile
- Data characteristic has a 509 bytes length
- Notifications enabled
- For throughput testing purpose, nRF sends 509 bytes notifications back to back:
- Send first notification as soon as notifications have been enabled
- Send the next notification as soon as the BLE_GATTS_EVT_HVN_TX_COMPLETE event has been triggered in ble_evt_handler() function on main.c
- etc.
On the Raspberry Pi side:
- Use gatttool in interactive mode
- Change mtu to 512 by "mtu 512" command
- Activate notifications by writing 0100 value to characteristic CCCD
- gatttool prints the values (succesfully gets the 509 bytes for each notification)
My problem is that I cannot make the nRF send more than about 4 notifications per second.
I tried to decrease the connection interval as low as I could while keeping the nRF from crashing but the lowest values I could get are:
- MIN_CONN_INTERVAL = 8 x 1.25 ms
- MAX_CONN_INTERVAL = 50 x 1.25 ms
Anything lower than that cases the nRF to stay stuck either right away when really fast, or after having sent a few notifications.
If I try to send multiple notifications without waiting for the BLE_GATTS_EVT_HVN_TX_COMPLETE event the nRF also gets stuck.
I've seen on this post dealing large data packet's through ble to call the sd_ble_gatts_hvx() multiple times until the BLE_ERROR_NO_TX_BUFFERS error is returned but in my case the function returns 0 (ok) but stays stuck.
Is there a way to increase the rate of notifications without the nRF being stuck ?
BTW the Softdevice is s112.
Thanks in advance.