Communication speed of NRF24L01

I have a problem with the low speed of transferring data through the NRF24L01 modules. I use transmitting and receiving codes below:

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

receiving code:

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

//create an RF24 object
RF24 radio(7, 8); // CE, CSN

//address through which two modules communicate.
const byte address[6] = "00009";

void setup()
{
while (!Serial);
Serial.begin(9600);
radio.begin();
radio.openReadingPipe(0, address);
radio.startListening();
}

void loop()
{
if (radio.available())
{
char text[32] = {0};
radio.read(&text, sizeof(text));
Serial.println(text);
}
}

You need to explain what you mean by 'slow speed'

Please follow the advice given in the link below when posting code . Use code tags when posting code here to make it easier to read and copy for examination

What slow speed are you talking about?

Sending a single packet each second is not the way to test the speed of an NRF module.

Using 9600 baud to echo all packets to the serial port is the biggest bottleneck you constructed,
but should in no way impact the transmission of your single packet.

If you want to be as fast as possible, you should use dynamic payloads,
in your current setting all packets will carry 32 byte of data.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.