Hi how would I communicate simple commands and status between two ESP32 boards using my home wireless network?
Hi.
One of the easiest ways is using ESP-NOW protocol.
Check the following tutorials:
- Getting Started with ESP-NOW (ESP32 with Arduino IDE)
- ESP-NOW Two-Way Communication Between ESP32 Boards
I hope this helps.
Regards,
Sara
Thanks Sara, but I understand that ESP-NOW is a communication protocol directly between the two ESP32s and does not use the wireless network within my home as an intermediate connection. Is this correct?
I thought ESP-NOW is: ESP32#1 <–> ESP32#2
So, what I need is:
ESP32#1 <–> Wireless Network <–> ESP32#2 transmitting control and status
appreciate the help. ( btw, Great website you and Rui have!)
Hi again.
Thanks.
It doesn’t use your network, but it is a wireless protocol. Is there a specific reason why you need to use your wireless network?
What is exactly what you’re trying to achieve? So that I can search for a better solution.
We also have this tutorial that communicates using the ESP32 wi-fi network
Regards,
Sara
Thanks again Sara. I use 4 wireless Access Points around my house and outside to provide overall coverage which would otherwise be hindered by obstructions(walls, etc). The intended locations of the two ESP32s are far apart and will not allow line-of-sight for the ESP-NOW transmission to connect. So I thought I could use the existing wireless network as a sort of ‘bridge’ between the two ESP32s. (I tried the “painlessMesh.h” example but had no success in getting it to compile. A bit too complex for me).
In that case, probably the best solution is to use MQTT. But you need a broker for that.
You can set up your own broker on a Raspberry Pi or on your computer or use a cloud broker.
In my opinion, that’s the easiest way to have all boards connected if they share the same network.
Are you familiar with MQTT?
Regards,
Sara
No, I’m not familiar with MQTT but I believe there is an example in my RNT ESP32 Tutorial so l’ll have a good look at that for a start.
Thanks for your help Sara.
Yes. We have several tutorials about MQTT.
You can start here: https://randomnerdtutorials.com/what-is-mqtt-and-how-it-works/
You can check all our MQTT tutorials here:https://randomnerdtutorials.com/?s=mqtt
If you have any questions, don’t hesitate to ask.
Regards,
Sara