I am using ESB to send package from a nrf52832 (primary transmitter) to a nrf42840 (primary receiver). I use nrf5 SDK v15.3 on both of them. I send a ping message (12 bytes) every 10ms from the primary transmitter using tmsi_esb_ptx_send command. however somehow once in every 180 or so ping messages I send, I receive the ping message I send. This happens even if I remove the power the primary receiver.
I am using the following code for the callback function that get's called when the ping message is send.
static void nrf_esb_event_handler(nrf_esb_evt_t const * p_event)
{
int foobar;
switch (p_event->evt_id)
{
case NRF_ESB_EVENT_TX_SUCCESS:
(*tmsi_esb_ptx_tx_succes)();
break;
case NRF_ESB_EVENT_TX_FAILED:
(void) nrf_esb_flush_tx();
(void) nrf_esb_start_tx();
(*tmsi_esb_ptx_tx_failed)();
break;
case NRF_ESB_EVENT_RX_RECEIVED:
foobar = 1;
nrf_esb_payload_t rx_payload;
//NRF_LOG_DEBUG("RX RECEIVED EVENT");
while (nrf_esb_read_rx_payload(&rx_payload) == NRF_SUCCESS)
{
if (rx_payload.length > 0)
{
(*tmsi_esb_ptx_rx_received)(&rx_payload);
}
}
break;
}
}
I have absolutely no idea how this could happen. Does maybe one of you have a clue?
Best regards,
Martijn