ESB lose packet, retransmit_count not work

Hi all:

I use SDK17.1.0, nRF52832 to develop my program.

I have two device, one is used to be PTX, another is PRX, when I send data over esb, I found a part of packet was lost, and I set retransmit_count to 1 the packet lost looks like same.

I send 90000 packet(32bytes), and received is about 89500. And retransmit_count = 0 / 1 / 3 is similar. 

1. What's wrong with it?

2. I have to send data every 2ms, What is the maximum value I can set?

Tx init code is here

uint32_t esb_tx_init(uint8_t ch, uint8_t pipe, uint8_t retrans_count)
{
    uint32_t err_code;

    nrf_esb_config_t nrf_esb_tx_config         = NRF_ESB_DEFAULT_CONFIG;
    nrf_esb_tx_config.protocol                 = NRF_ESB_PROTOCOL_ESB_DPL;
    nrf_esb_tx_config.bitrate                  = NRF_ESB_BITRATE_2MBPS;
    nrf_esb_tx_config.event_handler            = nrf_esb_event_handler;
    nrf_esb_tx_config.mode                     = NRF_ESB_MODE_PTX;
    nrf_esb_tx_config.selective_auto_ack       = false;
    nrf_esb_tx_config.retransmit_delay         = 250,
    nrf_esb_tx_config.retransmit_count         = retrans_count;
    nrf_esb_tx_config.tx_output_power          = NRF_ESB_TX_POWER_4DBM;

    tx_payload.noack = false;  //!< Flag indicating that this packet will not be acknowledgement. Flag is ignored when selective auto ack is enabled.

    err_code = nrf_esb_init(&nrf_esb_tx_config);

    VERIFY_SUCCESS(err_code);

    err_code = nrf_esb_set_base_address_0(base_addr_0);
    VERIFY_SUCCESS(err_code);

    err_code = nrf_esb_set_base_address_1(base_addr_1);
    VERIFY_SUCCESS(err_code);

    err_code = nrf_esb_set_prefixes(addr_prefix, NRF_ESB_PIPE_COUNT);
    VERIFY_SUCCESS(err_code);

    nrf_esb_set_rf_channel(ch);

    set_tx_pipe(pipe);

    return err_code;
}

By the way, what does the tx_payload.noack mean?

Best regards,

Lurn

Parents
  • Hi,

    In a wireless system there is packet loss, and how the application handle this packet loss depend on the application. If you need to ensure that all packets are successfuly sent, then I suggest to increase the retrans_count (I think 15 is max). Even then you can experience packet loss, especially if you are at the range limit where there is very much packet loss. So if you experience max retransmit event you need to decide if you want to try again, or if you want to discard that packet and send the next instead. You write that you want to send data every 2ms, you don't however say anything about the amount of data, maybe it's better to combine the data into larger packet, so that you can send them a little less frequently, and thereby have more time to retransmit.

    Kenneth

  • Hi,

    Every packet is 32bytes, it will be sent every 2ms.

    What's the best value about retransmit_delay for me?

    And what value should I set tx_payload.noack to?

Reply Children
Related