Wireless data send arduino uno to esp8266 using nrf24l01

hello, i am amila udayanga..

I need to send data from two arduino boards to one esp8266 board.Data comes when an arduino board is used as a receiver. But when esp8266 is used as receiver, no data can be seen in the serial monitor. When I use one transceiver and send "hello world", the data comes into the esp 8266. please help me all...

```tranceiver 1
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <DHT.h>

const uint64_t pipes[2] = {0xE8E8F0F0E1LL,0xE8E8F0F0E2LL};
#define DHTPIN 4
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
RF24 radio(7, 8); // CN and CSN pins of nrf
int sensorPin = A0; //soil moister pin

struct sensor {
int hum;// humidity
int tem;// tempereture
int soil;// soil moisture
int sensorNum;

//byte y; //soil moisture
};
sensor amila;
void setup()
{
Serial.begin(115200);
dht.begin();
radio.begin();
radio.setAutoAck(false);
radio.setDataRate(RF24_250KBPS);
radio.openWritingPipe(pipes[1]);
//amila.sensorNum=1;
}
void loop()
{
delay(1000);
amila.hum = 10;//dht.readHumidity();
amila.tem =20;// dht.readTemperature();
amila.soil =30;// analogRead(sensorPin);
amila.sensorNum=1;
// data1.h1 = 90;
// data1.t1 = 30;

if (isnan(amila.hum) || isnan(amila.tem)){
Serial.println(F("Failed to read from DHT sensor!"));
return;

}
Serial.print("Humidity: ");
Serial.print(amila.hum);
Serial.println("Temperature: ");
Serial.print(amila.tem);
Serial.println("moisture");
Serial.print(amila.soil);

radio.write(&amila, sizeof(amila));
delay(1000);
}

tranceiver 2


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

const uint64_t pipes[2] = {0xE8E8F0F0E1LL,0xE8E8F0F0E2LL};
#define DHTPIN 4
#define DHTTYPE DHT11 
 DHT dht(DHTPIN, DHTTYPE);
RF24 radio(7, 8); //  CN and CSN  pins of nrf
int sensorPin = A0; //soil moister pin
 
struct sensor {
  int hum;// humidity
  int tem;// tempereture
  int soil;//soil moisture
  int sensorNum;
  
  
  //byte y; //soil moisture
};
sensor hirusha;
void setup()
{
  Serial.begin(115200); 
  dht.begin();
  radio.begin();
  radio.setAutoAck(false);
  radio.setDataRate(RF24_250KBPS);
  radio.openWritingPipe(pipes[1]);
  
}
void loop()
{
  delay(1000);
  hirusha.hum = 20;//dht.readHumidity();
  hirusha.tem = 40;//dht.readTemperature();
  hirusha.soil =60;// analogRead(sensorPin);
  hirusha.sensorNum = 2; 
//  data1.h1 = 90;
//  data1.t1 = 30;

  if (isnan(hirusha.hum) || isnan(hirusha.tem)){
   Serial.println(F("Failed to read from DHT sensor!"));
   return;

    
  }
  Serial.print("Humidity: ");
  Serial.print(hirusha.hum);
  Serial.println("Temperature: ");
  Serial.print(hirusha.tem);
  Serial.println("moisture:");
  Serial.print(hirusha.soil);
 
 
  radio.write(&hirusha, sizeof(hirusha));
  delay(1000);
}

receiver for uno

Welcome to the forum

Your topic was MOVED to its current forum category as it is more suitable than the original

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

When you posted your code without code tags did you receive a warning message ?

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