• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

One ESP32 as main controller and multiple ESP8266

Q&A Forum › Category: ESP32 › One ESP32 as main controller and multiple ESP8266
0 Vote Up Vote Down
Ashish Garg asked 5 years ago

Hello, I am doing one project in which I have one ESP32 as the main controller connected with multiple ESP8266 with PIR, Magnetic Switch and Flame Sensor. ESP8266 and ESP32  working in STATION MODE. All ESP8266 sending their respective message to ESP32 like Motion Detection, Gate open and Fire. Now I wish that ESP32 should send the Message to all ESP8266 to activate the Buzzer after getting the messages like Motion Detection, Gate open and Fire. How to send the message to different ESP8266 as they have different IP addresses? Please Help me with this. How to do this. Link of Block Diagram is given below:
https://imgur.com/nuebVRl

Question Tags: ESP32, ESP8266
5 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi.
How are you exchanging data between your boards? Can you provide more details about the setup you have already?
Using MQTT can be one of the best choices. You can also use ESP-NOW. But you need to know the MAC address of each board to send data.
Regards,
Sara
 

0 Vote Up Vote Down
Ashish Garg answered 5 years ago

I am just using <WiFi.h> library. I am connecting all the ESP8266 by ESP32 through the IP address of the ESP32. Means,  I am just feeding the IP address of the ESP32 to ESP8266. And doing by client-server model.
 

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Hi.

The ESP32 can have a variable that changes if you need to activate something. For example, in case of the flame sensor:

armFlamesensor = 0;

In case of fire, the ESP8266 sends something to the ESP32 (the ESP32 receives a request on a specific URL, for example /firetrue) to tell that there is fire and the armFlamesensor variable is now:

armFlamesensor =1;

The ESP8266 with flame sensor and buzzer makes requests on that specific variable path every x number of seconds, and if that variable is 1, it activates the buzzer.

Then, if the flame sensor is not activated, the first ESP8266 makes a request on something like /firefalse, and the ESP32 changes the  armFlamesensor variable to 0 again.

With this approach all ESP8266 are clients making requests on different paths of the ESP32 server.

I don’t know if I explain myself clearly, just let me know.

Take a look at these projects that might help you understand what I’m talking about:
https://randomnerdtutorials.com/esp32-client-server-wi-fi/
https://randomnerdtutorials.com/esp8266-nodemcu-client-server-wi-fi/

Let me know if this helps.

I don’t know what your current scenario is, so I don’t know if this will be easy to fit in.
Regards,
Sara

0 Vote Up Vote Down
Ashish Garg answered 5 years ago

Thank You, Mam, for your elaborated answer, and I will try as per your answer and let you know if this helps. Thanks again.

0 Vote Up Vote Down
Sara Santos Staff answered 5 years ago

Ok.
Keep us updated.
Regards,
Sara

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn LVGL: Build GUIs for ESP32 Projects – Version 1.5 July 7, 2025
  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.