This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf24l01+ help receiving Ack payload

I know this has been asked a few times, but I am having a hell of a time receiving a ACK packet from my nrf24l01+ receiver (PRX). I am able to successfully send packets from 5 radios to my receiver. My issue is I am not getting an ACK back from the receiver. Here is my configuration:

Settings Receiver (PRX):

STATUS: 0x0E – Initial status – TX FIFO is empty and No Data Pipe Received

CONFIG: 0x4B - PRIM_RX = 1, PWR_UP = 1, EN_CRC = 1, MASK_RX_DR = 1

RF_CH: 0x47 – Channel 71

RF SETUP: 0x26 – RF_PWR = 0dBm, RF_DR_LOW = 1

EN_AA: 0x3F - All pipes enable Auto Acknowledgment

EN_RXADDR: 0x3F – Enable all RX addresses

FEATURE: 0x06 – EN_ACK_PAY = 1, EN_DPL = 1

DYNPD: 0x3F – Dynamic Payload enabled all pipes

OBSERVE_TX: 0x0F -

RX_ADDR_P0: 0x78 0x78 0x78 0x78 0x78

RX_ADDR_P1: 0xB3 0xB4 0xB5 0xB6 0xF1

RX_ADDR_P2: 0xB3 0xB4 0xB5 0xB6 0xCD

RX_ADDR_P3: 0xB3 0xB4 0xB5 0xB6 0xA3

RX_ADDR_P4: 0xB3 0xB4 0xB5 0xB6 0xF

RX_ADDR_P5: 0xB3 0xB4 0xB5 0xB6 0x5

Settings Sender (PTX5) – 5 node

STATUS: 0x0E

CONFIG: 0x4B

RF_CH: 0x47

RF SETUP: 0x26

EN_AA: 0x3F

EN_RXADDR: 0x3F

FEATURE: 0x06

DYNPD: 0x3F

OBSERVE_TX: 0x0F

TX_ADDR: 0xB3 0xB4 0xB5 0xB9 0x5

RX_ADDR_P0: 0xB3 0xB4 0xB5 0xB9 0x5

In my code, I am loading the ack packet before anything is received.

void receive_data(){
    
    // preload ack data
    ack_payload[0] = 0xFF;
    nrf24_setAckPayLoad(&ack_payload, 5,BUF_LENGTH); // load ack for pipe 5

    if(nrf24_dataReady())
    {    
        // get the payload size
        uint8_t payLoadsize = nrf24_getPayloadLength();
        
        if(payLoadsize > 32){

            printf("Invalid payload length received: %d\n\r", payLoadsize);
            return;
        }
        printf("Payload Size: %d\n\r", payLoadsize);

        nrf24_getPayLoad(&data_array, payLoadsize);                
        // TEST READ BACK        
        for(uint8_t i = 0; i < payLoadsize ;i++){            
            printf("Received Data %d: %d\n\r", i, data_array[i]);            
        }                        
        printf("<<< Data Complete From Radio Pipe %d>>>\n\r", data_array[0]);    
        
    }    
}

My Transmitter is sending the data and checking for ACK here:

void send_data(){
    
    if(fakeval > 120){
        fakeval = 0; // reset
    }
    data_array[0] = node; // node id
    
    for(uint8_t z = 1; z < 32; z++){
        data_array[z] = fakeval++; // fill with dummy data
    }

    printf("Sending Payload size: %d\n\r", sizeof(data_array));
    
    nrf24_sendPayLoad(&data_array, sizeof(data_array));
    while(nrf24_isSending()){};
    
    // get ack payload
    uint8_t ackdata = nrf24_rxFifoEmpty();
    printf("Ack? : %d\n\r", ackdata);
    
    if(ackdata == 0){ // rx has data when 0
        // grab data from RX FIFO
    }
}

Any advice is greatly appreciated.

Related