-->
Page 1 of 1

Basic communication with nrf24l01 between nodemcu and arduin

PostPosted: Sat May 18, 2019 8:30 pm
by Alessandro Spallina
I spent the last two days to find a way to set up a basic communication between a nodemcu amica and an arduino nano with a nrf24l01 module; all of this without success.. can anyone help me with that?

Here the code uploaded on my nodemcu:

Code: Select all//Include Libraries
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

//create an RF24 object
RF24 radio(D4, D8);  // CE, CSN

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

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

  radio.begin();

  //set the address
  radio.openWritingPipe(address);

  //Set module as transmitter
  radio.stopListening();

  Serial.println("inizio ad trasmettere");
  Serial.println(radio.isChipConnected());
}
void loop()
{
  Serial.println("qui");
  const char text[] = "Hello World";
  bool ret = radio.write(&text, sizeof(text));
  Serial.print("Write ret: ");
  Serial.println(ret);
  delay(1000);
}


and here the code on the arduino side

Code: Select all//Include Libraries
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

//create an RF24 object
RF24 radio(5, 6);  // CE, CSN

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

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

  radio.begin();

  //set the address
  radio.openReadingPipe(0, address);

  //Set module as receiver
  radio.startListening();

  Serial.println("inizio ad ascoltare");
  Serial.println(radio.isChipConnected());
}

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


My nodemcu wiring scheme https://i.stack.imgur.com/C3zWN.png
and my arduino nano wiring scheme https://i.stack.imgur.com/DoeRH.png

My nrf24l01 module is this one (not the module in the fritzing scheme) https://www.amazon.it/gp/product/B06WD17WLS.

Can anyone see something that I don't see? I'm really frustrated