NRF24L01 code working only one way

Hi everyone,

I've been using NRF24L01+ for a long time now and I'm doing pretty good with. But recently I needed to increase the range so I bought 3 NRF24L01+PA+LNA.

I would like to use one NRF24L01+PA+LNA with a regular NRF24L01, I've read that it should work without problems.

So I've been testing a really simple "send" and "receive" code to see if it works.

It's working in the NRF24L01+ :arrow_right: NRF24L01+PA+LNA way
but not in the NRF24L01+PA+LNA :arrow_right: NRF24L01+ way whereas it's the exact same code...

I'm a little bit lost and I don't know what to do. I tried to change the channel, the adresses but no matter what it doesn't work.

Has anyone ever had the problem before?

Thank you in advance and have a nice week-end !

Without seeing your code it is difficult to help.

A common problem with nRF24 modules is insufficient 3.3v current from the Arduino 3.3v pin. 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.

Also I believe it is important to keep some distance between the high power Tx and the Rx - I suggest 3 metres.

...R
Simple nRF24L01+ Tutorial

Thank you for your response.

Here is the code :

RF_send.io :

#include <SPI.h>  
#include "RF24.h"

#include "nRF24L01.h"

RF24 myRadio (7, 8);
byte addresses[][6] = {"0"};

struct package {
  int id=1;
  float temperature = 18.3;
  char  text[300] = "Text to be transmit";
};


typedef struct package Package;
Package data;


void setup() {
  Serial.begin(115200);
  delay(1000);
  
  myRadio.begin();  
  myRadio.setChannel(115); 
  myRadio.setPALevel(RF24_PA_MAX);
  myRadio.setDataRate( RF24_250KBPS );
  myRadio.openWritingPipe(addresses[0]);
}

void loop() {
  myRadio.write(&data, sizeof(data)); 

  Serial.print("\nPackage:");
  Serial.print(data.id);
  Serial.print("\n");
  Serial.println(data.temperature);
  Serial.println(data.text);
  data.id = data.id + 1;
  data.temperature = data.temperature+0.1;
  delay(100);
}

RF_receive.ino :

#include <SPI.h>  
#include "RF24.h" 

#include "nRF24L01.h"

RF24 myRadio (7, 8); 
byte addresses[][6] = {"0"};

struct package {
  int id=0;
  float temperature = 0.0;
  char  text[300] ="empty";
}; 

typedef struct package Package;
Package data;

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

  myRadio.begin(); 
  myRadio.setChannel(115); 
  myRadio.setPALevel(RF24_PA_MAX);
  myRadio.setDataRate( RF24_250KBPS );
  
  myRadio.openReadingPipe(1, addresses[0]);
  myRadio.startListening();
}


void loop()  {
  if ( myRadio.available()) {
    while (myRadio.available()){
      myRadio.read( &data, sizeof(data) );
    }
    Serial.print("\nPackage:");
    Serial.print(data.id);
    Serial.print("\n");
    Serial.println(data.temperature);
    Serial.println(data.text);
  }
}

I tried an external power supply on the NRF24L01+PA+LNA and I moved the receiver 3 meters away from the emitter.

Still not working...

If it works in one direction and not the other I don't know what else to suggest.

Have you tried the examples in my Simple nRF24L01+ Tutorial without any changes to the code.

The 2nd and 3rd examples are for 2-way communication.

If the problem seems to be due to the high-power module I suggest you get the examples working with a pair of low-power modules first.

Have you a spare high-power module in case the first one is faulty?

...R

I tried the simple RX and TX code and then the swapping role example.
It works fine with the low power version and doesnt work with the high power module...

I tried with an other high power module, it also doesn't work.

I tried to communicate between two high power module, and always the same problem.

radio.write sends back 0. No problem for receiving

My modules were close to a wifi router, so I turned it off but did nothing...

I'm in a crowded city with a probably a lot of 2.4 Ghz usage, maybe there are some interferences...

Miniradi:
I'm in a crowded city with a probably a lot of 2.4 Ghz usage, maybe there are some interferences...

Perhaps try some different channels

...R