[nRF24L01+] How to use Auto Acknowledge

Hello all,

1. I have a transmitter (Arduino Pro Mini 5V) connected to a nRF24L01+. I use the following code to set up the radio.

    radio.begin();
    radio.setChannel(125);
    radio.setPALevel(RF24_PA_LOW);
    radio.setDataRate(RF24_1MBPS);
    radio.setAddressWidth(5);
    radio.setAutoAck(true);
    radio.setRetries(5, 3);
    radio.setPayloadSize(sizeof(radio_data));
    radio.openWritingPipe(address);
    radio.stopListening();

2. I have a receiver (ESP32) coonecter to a nRF24L01+. I use the following code to set up the radio.

    radio.begin();
    radio.setChannel(125);
    radio.setPALevel(RF24_PA_LOW);
    radio.setDataRate(RF24_1MBPS);
    radio.setAddressWidth(5);
    radio.setAutoAck(true);
    radio.setRetries(5, 3);
    radio.setPayloadSize(sizeof(radio_data));
    radio.openReadingPipe(0, address);
    radio.startListening();

3. When I want to transmit data, I call the function write.

The return of the call to the function write is always false, meaning that auto acknowledgement goes wrong.

Have you any idea of what I did wrong ?

Thanks for your help.

Parents
  • Hi 

    Is anything received by the ESP32 board?

    The nRF24L01+ is rated to 3.6V maximum, so I think the first order of business would be to test this on boards that support a lower supply voltage. Correct behavior can not be guaranteed when you're running the nRF device at 5V, and it might damage the module over time. 

    Best regards
    Torbjørn

  • Hello,

    First, the nRF24L01+ is not supplied with the 5V of transmitter Arduino, but with 3.3V.

    Second, with the channel set to 125, the receiver ESP32 is not receiving at all. If I remove the call to setChannel, the ESP32 is receiving around 20% of the frame and in that case, the Arduino is getting the ACK.
    So, 80% of frame are lost with no ACK.

    As an information, there is a 10µF capacitor at the pin GND/3.3V of the receiver nRF24L01+ and a 100µF capacitor for the transmitter nRF24L01+.

    Best regards.

  • Hi 

    _pascalh said:
    First, the nRF24L01+ is not supplied with the 5V of transmitter Arduino, but with 3.3V.

    Ok, but have you made sure that the Arduino can properly read the logic signals coming back from the nRF24L01+, which will run at 3.3V? I assume the SPI bus from the Arduino is running at 5V. 

    Do you have a picture of the modules you are using? 
    Where did you get them? 

    There are a lot of fake nRF234L01+ modules around, which may or may not work as well as the genuine parts. If we suspect that you are having fake parts I recommend ordering a couple of modules from a reputable vendor to see if you get the same issues or not. 

    Best regards
    Torbjørn

  • Hello,

    Even if you're right that my part is not genuine, it seems to work correctly.

    Here after are some evidences. I use a digital oscilloscope to get them. It also to decode the nRF24 protocol (see information squared in grey).

    1. Frames exchanged every 100ms between Arduino transmitter and nRF24.

    2. At the begining of each frame, there is a TX payload.

    3. After the TX payload, it seems to wait for the ACK from the receiver.

    4. At the end of the frame, finally with no ACK, the trnasmitter decides to stop.

    Best regards.

  • Hi 

    It looks like you are using the Saleae Logic analyzer. Would you be able to attach the trace files to the case so I can look at them directly? 

    Also, would you be able to do a read out of all the configuration registers after you have run all the init commands? 

    Probably the Arduino libraries don't have a function for reading raw registers, but doing so is as easy as letting the first byte of the SPI transaction be a number between 0-0x1D, and reading the bytes that follow. 

    The SPI commands are described on page 51 of the nRF24L01+ product specification (you would use the R_REGISTER command to read the registers), and the various registers are described from page 57 and out. 

    Best regards
    Torbjørn

  • Hello,

    I put a link to the sal file from Saleae logic analyzer which captures SPI during more than 2 seconds. 2 frames have been ACKed (the 2nd one and the 15th one). All others, no ACK.

    I used the function printPrettyDetails of the Arduino library to get information about configuration of radio. Here after are the results. Let me know if you need more.

    SPI Frequency = 1 Mhz
    Channel = 76 (~ 2476 MHz)
    Model = nRF24L01+
    RF Data Rate = 1 MBPS
    RF Power Amplifier = PA_MIN
    RF Low Noise Amplifier = Enabled
    CRC Length = 16 bits
    Address Length = 5 bytes
    Static Payload Length = 20 bytes
    Auto Retry Delay = 1500 microseconds
    Auto Retry Attempts = 15 maximum
    Packets lost on
    current channel = 0
    Retry attempts made for
    last transmission = 15
    Multicast = Disabled
    Custom ACK Payload = Disabled
    Dynamic Payloads = Disabled
    Auto Acknowledgment = Enabled
    Primary Mode = TX
    TX address = 0x3145504950
    pipe 0 ( open ) bound = 0x3145504950
    pipe 1 ( open ) bound = 0xc2c2c2c2c2
    pipe 2 (closed) bound = 0xc3
    pipe 3 (closed) bound = 0xc4
    pipe 4 (closed) bound = 0xc5
    pipe 5 (closed) bound = 0xc6

    My feeling is that the transmitter works fine, but the problem is more on the ESP32 receiver.

    Best regards.

    https://drive.google.com/file/d/1JlGj0eRhPx7e-lvl3_OzgsQCcF71NEYF/view?usp=drive_link

Reply
  • Hello,

    I put a link to the sal file from Saleae logic analyzer which captures SPI during more than 2 seconds. 2 frames have been ACKed (the 2nd one and the 15th one). All others, no ACK.

    I used the function printPrettyDetails of the Arduino library to get information about configuration of radio. Here after are the results. Let me know if you need more.

    SPI Frequency = 1 Mhz
    Channel = 76 (~ 2476 MHz)
    Model = nRF24L01+
    RF Data Rate = 1 MBPS
    RF Power Amplifier = PA_MIN
    RF Low Noise Amplifier = Enabled
    CRC Length = 16 bits
    Address Length = 5 bytes
    Static Payload Length = 20 bytes
    Auto Retry Delay = 1500 microseconds
    Auto Retry Attempts = 15 maximum
    Packets lost on
    current channel = 0
    Retry attempts made for
    last transmission = 15
    Multicast = Disabled
    Custom ACK Payload = Disabled
    Dynamic Payloads = Disabled
    Auto Acknowledgment = Enabled
    Primary Mode = TX
    TX address = 0x3145504950
    pipe 0 ( open ) bound = 0x3145504950
    pipe 1 ( open ) bound = 0xc2c2c2c2c2
    pipe 2 (closed) bound = 0xc3
    pipe 3 (closed) bound = 0xc4
    pipe 4 (closed) bound = 0xc5
    pipe 5 (closed) bound = 0xc6

    My feeling is that the transmitter works fine, but the problem is more on the ESP32 receiver.

    Best regards.

    https://drive.google.com/file/d/1JlGj0eRhPx7e-lvl3_OzgsQCcF71NEYF/view?usp=drive_link

Children
Related