Communication problem with NRF24L01 and 2 Arduino Nano

Hey

I try to communicate 2 Arduino Nano with a NRF24L01 and i can’t get a response.

If I use the Nano as a transmitter and an Arduino Mega as a receiver it works but if I use the Mega as an transmitter and the Nano as a receiver it doesn’t work.

Can someone tell me why it doesn’t work.
Transmitter code

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
const byte address[6] = "00001";
void setup() {
  radio.begin();
  radio.openWritingPipe(address);
  radio.setPALevel(RF24_PA_MIN);
  radio.stopListening();
}
void loop() {
  const char text[] = "Hello World";
  radio.write(&text, sizeof(text));
  delay(1000);
}

Receiver code

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
RF24 radio(7, 8); // CE, CSN
const byte address[6] = "00001";
void setup() {
  Serial.begin(9600);
  radio.begin();
  radio.openReadingPipe(0, address);
  radio.setPALevel(RF24_PA_MIN);
  radio.startListening();
}
void loop() {
  if (radio.available()) {
    char text[32] = "";
    radio.read(&text, sizeof(text));
    Serial.println(text);
  }
}

How are you powering the two NRF24L01s ?
How have you connected the NRF24L01s to the Nano and Mega ( pin numbers ) ?

Power by USB

Nano
3v3
GND
CSN - 8
CE - 7
MOSI - 11
SCK - 13
MISO - 12

Mega
3v3
GND
CSN - 8
CE - 7
MOSI - 51
SCK - 52
MISO - 50

If it works in one way should work in the other
i just don't know

Have a look at this Simple nRF24L01+ Tutorial.

Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.

The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work

There is also a connection test program to check that the Arduino can talk to the nRF24 it is connected to.

A common problem with nRF24 modules is insufficient 3.3v current from the Arduino 3.3v pin. This seems to be a particular problem with the nano but I have experienced it with a Mega clone. The high-power nRF24s (with the external antenna) will definitely need an external power supply. At least for testing try powering the nRF24 with a pair of AA alkaline cells (3v) with the battery GND connected to the Arduino GND.

If you are using the high-power nRF24s (with the external antenna) make sure there is sufficient distance between the two nRF24s so that the signal does not overwhelm the receiver - try 3 metres separation. If you are new to nRF24s it may be better to start with a pair of low power modules with the pcb antenna.

...R

I ran into a very similar situation.
I used the Arduino project hub sample code (example 1)
It worked perfectly with UNOs, but when I swapped to NANO clones (LAFVIN), I experienced all kinds of issues.
Due to the fact that the errors were inconsistent, a proper troubleshooting seemed to be beyond my competence.
I'm almost certain though that this is not a wireless communication issue.