NRF52840 Central lost some packets

Greetings
starting from the 'ble aggregator' example I developed a BLE central on NRF52840 with NRF5 SDK 17.02, capable of managing multiple peripherals which, once connected, periodically send MIDI data over bluetooth. But I have performance problems with devices that overload the channel by sending many packets in a short time and some packets are lost.
I tried to optimize the application by acting on the following parameters:

#define MIN_CONN_INTERVAL               MSEC_TO_UNITS(5, UNIT_1_25_MS)
#define MAX_CONN_INTERVAL               MSEC_TO_UNITS(35, UNIT_1_25_MS)
#define MIN_PERIPHERAL_CON_INT       6
#define MAX_PERIPHERAL_CON_INT       MSEC_TO_UNITS(10, UNIT_1_25_MS)

Something has improved, but every now and then some packages don't arrive.
I wanted to know if it is possible to act on other parameters or adopt other strategies useful for improving performance.

  • Thanks, this is also interesting,

    but I think you are referring to a software application for smartphones, or am I wrong?
    In my case I have a doongle with my firmware and the other device managed by its firmware and there is no automatic reconnection mechanism between the two, the connection is always initiated by the user... or are you referring to some low level BLE mechanism that I don't know ?

  • Sam.Art said:
    if you have any other suggestions on the matter, they are welcome.

    Adding the fact that other devices don't have issue with the Orba 2, it becomes more likely that the problem lies on the nRF side.

    If the sniffer check shows that all packets are transmitted, then you might want to have an extremely rudimentary handler that just count packets, see if something that basic works in the first place.

    With the sniffer, you can also check what connection parameters the commercial devices are having success with and use it as a reference. In the same online course that has the sniffer lesson I linked, there is also a lesson on all other connection parameters, if you want to have a deeper understanding.

  • Hi Hieu

    I was checking my code, tell me if I associated the defines correctly

    • GAP Data Length = NRF_SDH_BLE_GAP_DATA_LENGTH (244 in my case)
    • GATT MTU = NRF_SDH_BLE_GATT_MAX_MTU_SIZE (247 )
    • GAP Connection Interval = NRF_SDH_BLE_GAP_EVENT_LENGTH (3)

    thanks

  • Hi Sam.Art,

    Sam.Art said:
    • GAP Data Length = NRF_SDH_BLE_GAP_DATA_LENGTH (244 in my case)
    • GATT MTU = NRF_SDH_BLE_GATT_MAX_MTU_SIZE (247 )

    These are correct.

    As for connection interval, you were tweaking it in your opening post. See MAX and MIN_CONN_INTERVAL macro defined in most examples and how they are used.

Related