Multi-host Channel Allocation Problem

hi,I am using the NRF52840, softdevice: s140, 

If a Bluetooth host simultaneously connects to multiple Bluetooth peripherals, and the peripherals transmit data to the host via notifications.

However, different peripherals transmit data to the host at varying frequencies and sizes. When the peripherals transmit relatively small amounts of data, the host can receive all the data.

However, when the peripherals transmit larger amounts of data, it may result in an NRF_ERROR_RESOURCES error.

What are the ways to allocate more channel resources for peripherals that send more data, so that all data from the peripherals can be transmitted? Or are there other solutions?

  • Hi

    What SDK version are you working on? What function is it that returns NRF_ERROR_RESOURCES exactly? That should give us an idea as to what is claiming there are insufficient resources. My guess is that it would be a buffer of the data being sent that is exceeding its size and causes this to return. And how much data are we talking on these larger transmissions?

    If the issue is indeed with channels and the time on air for each peripherals, timeslots might be an option. Please check out the Timeslot API in the SoftDevice specification here for details.

    Best regards,

    Simon

  • What SDK version are you working on?

    I'm working on nRF5_SDK_17.1.0_ddde560 with s140。

    What function is it that returns NRF_ERROR_RESOURCES exactly?
    sd_ble_gatts_hvx() returns NRF_ERROR_RESOURCES;
    For example, multiple peripherals are concurrently connected to a host and sending data packets to it, each identified by an ID as shown in the diagram.
    When the peripherals send fewer data packets, sd_ble_gatts_hvx does not return the NRF_ERROR_RESOURCES error, meaning the number of data packets attempted to be sent by the peripherals equals the number successfully sent; thus, the gray and orange quantities in the diagram are equal.
    However, when the peripherals send more data packets, sd_ble_gatts_hvx returns the NRF_ERROR_RESOURCES error, indicating that the number of data packets attempted to be sent exceeds the number successfully sent; hence, the gray quantity exceeds the orange quantity.
    Is this related to the host's throughput limitation and the fact that the amount of data packets attempted to be sent by the peripherals exceeds the throughput the host can handle within the allocated connection time for the peripherals?
    If I want to allocate more connection time for peripherals that need to send more data packets, how should I proceed?
    Thank you in advance.
  • Hi

    An NRF_ERROR_RESOURCES from the sd_ble_gatts_hvx() function points to too many notifications being queued, and you should wait for a BLE_GATTS_EVT_HVN_TX_COMPLETE event and retry. This is mentioned in the ble_gatts.h file for the SoftDevice used.

    Best regards,

    Simon

Related