Hello,
I am trying to get central to concurrently connect to multiple (as many as possible) peripherals and stream data from each peripheral concurrently at 12KBytes/s. But I keep getting the error below. The error indicates that it can't send the data within the given event length. But from my calculation below this should not happen.
<error> nrf_ble_gatt: sd_ble_gap_data_length_update() (request) on connection 0x0 returned NRF_ERROR_RESOURCES. <error> nrf_ble_gatt: The requested TX/RX packet length is too long by 94/94 octets. <error> nrf_ble_gatt: sd_ble_gap_data_length_update() (request) on connection 0x0 returned NRF_ERROR_RESOURCES. <error> nrf_ble_gatt: The requested TX/RX packet length is too long by 94/94 octets.
What I need to achieve
- I need to connect central to as many peripherals as possible while maintaining a baud rate of 12KBytes/s (i.e 600 bytes within 50ms)
- I can connect to 1 peripheral and get a max through put of 32KBytes/s
- The connection intervals are 7.5ms
- Date Rate: 1Mbps
- The data length = 251
- The MTU size = 247
- Packet per connection interval: 1 (peripheral can only send 1 packet per connection interval)
- By my calculations I can connect 3 peripherals and support this baud rate.
- It would take 3 connection intervals to send all 600 bytes and 3 connection intervals only takes 22.5ms which is well below 50ms.
- Set the event length on central to 2.5ms
- This should allow the soft device to connect to 3 peripherals within that 7.5ms window. Every event length it connect to another peripheral.
- To send 265bytes of data on 1Mbps connection only takes 2.12ms
- I have setup the event length to be 3.75 to just be safe and I still get the error above
SDK configuration applied
-
NRF_SDH_BLE_GAP_DATA_LENGTH = 251
-
NRF_SDH_BLE_PERIPHERAL_LINK_COUNT = 0
-
NRF_SDH_BLE_CENTRAL_LINK_COUNT = 6
-
NRF_SDH_BLE_TOTAL_LINK_COUNT = 6
-
NRF_SDH_BLE_GAP_EVENT_LENGTH = 3 --> 3*1.25 = 3.75ms
-
NRF_SDH_BLE_GATT_MAX_MTU_SIZE = 247
- I have also enabled extended BLE connection events as seen below
ble_opt_t opt = { 0 }; opt.common_opt.conn_evt_ext.enable = 1; rc = sd_ble_opt_set(BLE_COMMON_OPT_CONN_EVT_EXT, &opt); assert(NRF_SUCCESS == rc);
This is for a S140 softdevice