painlessMesh with softwareSerial

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

Suggest you start here:
ESP-MESH with ESP32 and ESP8266: Getting Started | Random Nerd Tutorials

Yeah, I read that article, and the first esp8266 can connect with esp32 and receive data from it, what I need is how to painlessmesh not distract when the second esp8266 sends data and the first esp8266 receive that data and the painlessmesh work simultaneously

Call me stupid, but I honestly have no understanding of what you are trying to accomplish.

ESP-NOW is a variation on the mesh. I assume you have looked at that too:

Then there is UDP broadcast protocol that can send sensor data to many listeners. I have an ESP8266 and GPS serially wired that is high in my attic for good satellite reception: that unit broadcasts time/date to three other receivers who add their own room temperature info and all gets put on an LCD.

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