Hi, I trying to build an automatic hydroponic, and I send the sensor data ESP32, The first Esp8266 will receive the data from esp32 and I trying to build WSN, but I am new to ESP-Mesh with esp32 and the sensor data will send it to the first esp8266, and sensor data will send to the second esp8266 will send it the data to firebase and I need LCD for Monitoring and Control Pump, the LCD will be in the second esp8266 and the relay data will send from the second esp8266 to the first esp8266 with software, but when me trying to send the data painlessmesh to distract receiving data from the second esp8266. Why am I using esp8266? cause I need a minimal budget for building this.
and this is my code for the first esp8266
#include "global_var.h"
#include "send_slave.h"
#include "mesh.h"
#include "setup_btn.h"
#include "lcd_functions.h"
static painlessMesh mesh;
void setup() {
Serial.begin(9600);
sendSerialBegin();
// btnSetup();
Serial.println("\nWSN MASTER");
mesh.setDebugMsgTypes(ERROR | STARTUP); // set before init() so that you can see startup messages
mesh.init(MESH_PREFIX, MESH_PASSWORD, MESH_PORT, WIFI_AP_STA, 1, 1);
mesh.onReceive(&receivedCallback);
mesh.onNewConnection(&newConnectionCallback);
mesh.onChangedConnections(&changedConnectionCallback);
mesh.onNodeTimeAdjusted(&nodeTimeAdjustedCallback);
//
// lcdInit();
// lcdBegin();
// updateMenu();
}
void loop() {
mesh.update();
receiveRelayFromSlave();
// readBtnRight();
// readBtnSelect();
// readBtnBack();
// readBtnLeft();
}
receiveRelayFromSlave()
void receiveRelayFromSlave() {
while (swSer.available() > 0) {
data = swSer.read();
Serial.print("Received Data : ");
Serial.println(data);
}
}
and this is the code for esp8266
void sendRelayToMaster() {
swSer.print('c');
delay(200);
}
it is just for checking the data received to the first eps8266

