Notifications
Clear all

ESP32 Peer 2 Peer

5 Posts
3 Users
0 Likes
1,455 Views
Me-Chiel
(@me-chiel)
Member
Joined: 3 years ago
Posts: 9
Topic starter  

Direct duplex connections between several ESP32's sounded like a good idea. Sadly, I've been digging trough the internet for some clear info how to achieve peer 2 peer communication with ESP32 processors.

I discovered the ESP-NOW protocol with a lot of possibilities, but this is without connection to my WiFi.
It is possible to connect an ESP-NOW sender to an ESP-NOW receiver that is connected to Wifi.

but I want more;)

I want to be able to control the GPIO's on the sender as well via the receiver.
Maybe I missed something completely.

my perfect scenario:

ESP32#1 Master (many potmeters & switches)

ESP32#2 Button + motor

ESP32#3 Microphone + motor

all connected to my WiFi and the Master will host a website to control several GPIO's.

for example, when a button is Pushed on ESP32#2 the ESP32#1 receives this signal and will change the status of it's GPIO's. ESP32#1 can in due time send a signal to ESP32#2 to start it's motor.

Or ESP32#3 gets a peak in it's volume, and sends a notification to the ESP#1. When flipping a switch on the ESP32#1 the motor of ESP32#3 starts for a few seconds. 

Next to that I prefer to use the ESPAsyncWebServer library since I love that piece of software a lot.
Not that I want it to be a commercial product, I would prefer not to enter IP-adresses in the code to adress the different ESP32's. I had some succes with mDNS to identify the ESP32's without hardcoding IP-adresses.

This is all very specific but maybe someone can help me with some pointers I probably missed looking to solve this problem.

Kind regards, Michiel


   
Quote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2504
 
Posted by: @me-chiel

Direct duplex connections between several ESP32's sounded like a good idea. Sadly, I've been digging trough the internet for some clear info how to achieve peer 2 peer communication with ESP32 processors.

I discovered the ESP-NOW protocol with a lot of possibilities, but this is without connection to my WiFi.
It is possible to connect an ESP-NOW sender to an ESP-NOW receiver that is connected to Wifi.

but I want more;)

I want to be able to control the GPIO's on the sender as well via the receiver.
Maybe I missed something completely.

my perfect scenario:

ESP32#1 Master (many potmeters & switches)

ESP32#2 Button + motor

ESP32#3 Microphone + motor

all connected to my WiFi and the Master will host a website to control several GPIO's.

for example, when a button is Pushed on ESP32#2 the ESP32#1 receives this signal and will change the status of it's GPIO's. ESP32#1 can in due time send a signal to ESP32#2 to start it's motor.

Or ESP32#3 gets a peak in it's volume, and sends a notification to the ESP#1. When flipping a switch on the ESP32#1 the motor of ESP32#3 starts for a few seconds. 

I don't use ESPs, but it seems to me that your problem is using WIFI and ESP-NOW simultaneously. I don't know if you have already seen this article, but it may help.

https://www.electrosoftcloud.com/en/esp32-wifi-and-esp-now-simultaneously/

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Me-Chiel
(@me-chiel)
Member
Joined: 3 years ago
Posts: 9
Topic starter  

@will thanks for the heads-up, but this was known by the folks at Randomnerdstutorials as well. This is the furthest I got with my set-up sofar. Do appreciate the effort though!


   
ReplyQuote
(@yurkshirelad)
Member
Joined: 3 years ago
Posts: 493
 

Wow, I didn't realise you could use ESP-Now and WiFi on the same MCU. I'll have to try this in the future - thanks!


   
ReplyQuote
Me-Chiel
(@me-chiel)
Member
Joined: 3 years ago
Posts: 9
Topic starter  

@yurkshirelad 🙂 Happy to help with that;)


   
ReplyQuote