Arduino uno & nano cannot communicate with nrf24l01

Hi can anyone pleas help me? I bought two nrf24l01s and basses but I cannot get my arduino uno or nano to communicate with it. I checked my wireing and it is all right can anyone pleas help me. Thank you.

master uno

/*

Demonstrates sending and receiving packets of different length.

Radio    Arduino
CE    -> 9
CSN   -> 10 (Hardware SPI SS)
MOSI  -> 11 (Hardware SPI MOSI)
MISO  -> 12 (Hardware SPI MISO)
SCK   -> 13 (Hardware SPI SCK)
IRQ   -> No connection
VCC   -> No more than 3.6 volts
GND   -> GND

*/

#include <SPI.h>
#include <NRFLite.h>

const static uint8_t RADIO_ID = 1;
const static uint8_t DESTINATION_RADIO_ID = 0;
const static uint8_t PIN_RADIO_CE = 9;
const static uint8_t PIN_RADIO_CSN = 10;

struct RadioPacket1
{
    uint8_t FromRadioId;
    uint8_t Counter;
};

struct RadioPacket2
{
    uint8_t FromRadioId;
    char Message[31];    // Note the max packet size is 32, so 31 is all we can use here.
};

NRFLite _radio;
RadioPacket1 _radioData1;
RadioPacket2 _radioData2;

void setup()
{
    Serial.begin(115200);

    if (!_radio.init(RADIO_ID, PIN_RADIO_CE, PIN_RADIO_CSN))
    {
        Serial.println("Cannot communicate with radio");
        while (1); // Wait here forever.
    }

    _radioData1.FromRadioId = RADIO_ID;
    _radioData2.FromRadioId = RADIO_ID;
}

void loop()
{
    // Pick a number from 0 - 60,000.
    uint16_t randomNumber = random(60001);

    if (randomNumber > 30000)
    {
        // Send RadioPacket1.

        _radioData1.Counter++;

        Serial.print("Sending ");
        Serial.print(_radioData1.Counter);

        if (_radio.send(DESTINATION_RADIO_ID, &_radioData1, sizeof(_radioData1)))
        {
            Serial.println("...Success");
        }
        else
        {
            Serial.println("...Failed");
        }
    }
    else
    {
        // Send RadioPacket2.

        // Create a message and assign it to the packet.
        // Strings need to be converted to a char array and note they cannot be longer
        // than 31 characters since that is the size of _radioData2.Message.
        String msg = "Hello " + String(randomNumber);
        msg.toCharArray(_radioData2.Message, msg.length() + 1);

        Serial.print("Sending '");
        Serial.print(msg);
        Serial.print("'");

        if (_radio.send(DESTINATION_RADIO_ID, &_radioData2, sizeof(_radioData2)))
        {
            Serial.println("...Success");
        }
        else
        {
            Serial.println("...Failed");
        }
    }

    delay(1000);
}

slave nano

/*

Demonstrates sending and receiving packets of different length.

Radio    Arduino
CE    -> 9
CSN   -> 10 (Hardware SPI SS)
MOSI  -> 11 (Hardware SPI MOSI)
MISO  -> 12 (Hardware SPI MISO)
SCK   -> 13 (Hardware SPI SCK)
IRQ   -> No connection
VCC   -> No more than 3.6 volts
GND   -> GND

*/

#include <SPI.h>
#include <NRFLite.h>

const static uint8_t RADIO_ID = 0;
const static uint8_t PIN_RADIO_CE = 9;
const static uint8_t PIN_RADIO_CSN = 10;

struct RadioPacket1
{
    uint8_t FromRadioId;
    uint8_t Counter;
};

struct RadioPacket2
{
    uint8_t FromRadioId;
    char Message[31];    // Note the max packet size is 32, so 31 is all we can use here.
};

NRFLite _radio;
RadioPacket1 _radioData1;
RadioPacket2 _radioData2;

void setup()
{
    Serial.begin(115200);

    if (!_radio.init(RADIO_ID, PIN_RADIO_CE, PIN_RADIO_CSN))
    {
        Serial.println("Cannot communicate with radio");
        while (1); // Wait here forever.
    }
}

void loop()
{
    // 'hasData' returns the size of the packet that was received, or 0 if there is no data.
    uint8_t packetSize = _radio.hasData();

    if (packetSize > 0)
    {
        if (packetSize == sizeof(RadioPacket1))
        {
            _radio.readData(&_radioData1);

            Serial.print("Received ");
            Serial.print(_radioData1.Counter);
            Serial.print(" from radio ");
            Serial.println(_radioData1.FromRadioId);
        }
        else if (packetSize == sizeof(RadioPacket2))
        {
            _radio.readData(&_radioData2);

            String msg = String(_radioData2.Message);

            Serial.print("Received '");
            Serial.print(msg);
            Serial.print("' from radio ");
            Serial.println(_radioData2.FromRadioId);
        }
        else
        {
            // We have a packet with an unexpected size, either an invalid packet or packet
            // that was sent from a radio that we cannot handle, so remove it from the radio.

            Serial.print("Received packet with length '");
            Serial.print(packetSize);
            Serial.println("', it will be discarded");

            _radio.discardData(packetSize);
        }
    }
}

You need to describe the actual error you are getting, what for instance is displayed in the Serial Monitor ?

More like there. The library could not communicate with the chip properly.

-> Bad wiring, bad wires, bad NRF module.

I bought the nrf mod yesterday

There is no filthy wire

My wiring is correct

this is an example of the library I am using

have you seen in the code: "No more than 3.6 volts"
how did you power your modules ?

Yes I did I powered it with 3.3v

it has got a base

from the 3.3V pin? did you add a cap on the nrf24l01 module ? not enough power is usually a common issue with those modules

I'm not familiar with the NRFLite library, I use what most people on the forum I've seen use : the RF24 library

it has a base that has a cap on it. I have the same library.

you don't... I see #include <NRFLite.h>

sorry I have both. :frowning:

don't be sorry. use the library you want. I've never used that one so don't know if you are using it the right way or if it works at all

I will post it and you can try it if you want to.

if you want to see if your modules work, try this sample NRF24L01 code. Post is in French but code is code. what you type in one Serial monitor should show up on the other side.

if code does not work, then you probably have a hardware or wiring or power issue

just a min and I will try it.

what is radio absente!!

radio missing... --> hardware issue. the library can't find the chip
double check all your cables, make sure they are short and connected the right way. triple check :slight_smile:

checked six times i will send photo now.