I am working with ESB between 2 nRF5340DK's (w/ no need to be cross compatible w/ other devices) and with NCS v2.5.0. I am using ESB to wirelessly transmit data every 2ms, and have been mostly able to achieve it by relying on the example projects (located at NCS, nrf/samples/esb/) and by using the following settings:
- PTX
struct esb_config config = ESB_DEFAULT_CONFIG; config.protocol = ESB_PROTOCOL_ESB_DPL; config.bitrate = ESB_BITRATE_2MBPS; config.mode = ESB_MODE_PTX; config.retransmit_count = 2; config.selective_auto_ack = false; config.retransmit_delay = 400;
- PRX
struct esb_config config = ESB_DEFAULT_CONFIG; config.protocol = ESB_PROTOCOL_ESB_DPL; config.bitrate = ESB_BITRATE_2MBPS; config.mode = ESB_MODE_PRX; config.selective_auto_ack = false;
However, occasionally I will see the payload arrive at PRX a little late and then "recover" (for example, I see payloads at t=0, 2ms, 4ms, 6.5ms, 8ms, 10ms, 12ms, ...). From debugging, it appears to be due to the retransmission delay. It appears that the payload being slightly late like this is unavoidable, seeing as:
- Payloads stop getting sent after several seconds if the retransmit delay is too low i.e., 100 or 150 (us is the units for these I imagine)
- I get too many TX_FAILED events if I use no retransmits
I just wanted to get a 2nd opinion to see if this conclusion seems valid. If not, what other things could I look into that could explain (and ideally fix) this issue that I'm seeing?
--------
EDIT #1 - Corrected the timing example. I previously said I see payloads at t=0, 2ms, 4ms, 5.5ms, 5.7ms, 6ms, 8ms, ... I meant to say I see payloads at t=0, 2ms, 4ms, 6.5ms, 8ms, 10ms, 12ms, ...