ESP-NOW - Peer to P...
 
Notifications
Clear all

ESP-NOW - Peer to Peer ESP32 Network

49 Posts
9 Users
6 Likes
1,734 Views
DroneBot Workshop
(@dronebot-workshop)
Noble Member Admin
Joined: 3 years ago
Posts: 1144
Topic starter  

Set up a private peer-to-peer network without WiFi using ESP-NOW! I’ll show you how to use this powerful protocol with several ESP32 boards.

 

Article with code samples: https://dronebotworkshop.com/esp-now

ESP-NOW is a protocol that allows you to use ESP32 and ESP8866 boards to create a private peer to peer network. Use two boards, or use ten. Transmit in one direction (half-duplex) or bidirectionally (full-duplex). With or without encryption.

This magic all comes courtesy of the 2.4GHz radio transceiver that powers the ESP board's WiFi and Bluetooth features. We can also use this radio to set up a network to send small (250 bytes) packets of data between ESP boards.

No WiFi or Router is required. Mix and match boards as much as you want.

I’ll be showing you how ESP-NOW works, and we’ll perform a few simple experiments with a bunch of ESP32 boards. We’ll end by building a remote temperature sensor system, then expanding it to use multiple sensors.

Here is the Table of Contents for today's video!

00:00 - Introduction
01:59 - ESP-NOW
06:56 - Getting MAC Address
09:59 - Getting Started with ESP-NOW
19:05 - ESP-NOW Broadcast Mode
28:26 - Remote Temperature Sensing
35:57 - Multiple Temperature Sensors
40:58 - Conclusion

I’ve only scratched the surface of what we can do with ESP-NOW in this video, so I'll probably be incorporating it into another project soon.

Hope you find it interesting!

😎

Bill

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
Quote
mmonti
(@mmonti)
New Member
Joined: 3 years ago
Posts: 3
 

Can ESP-NOW and WifiManager be used togther to make the remote sensors report to a web page ? Maby an example of this usage. Thanks for the great lessons and examples.


   
ReplyQuote
YurkshireLad
(@yurkshirelad)
Honorable Member
Joined: 2 years ago
Posts: 470
 

I think I posted about this on these forums a while ago. I found a blog post somewhere that claimed it was possible, but I couldn't get it to work.


   
ReplyQuote
YurkshireLad
(@yurkshirelad)
Honorable Member
Joined: 2 years ago
Posts: 470
 
Posted by: @yurkshirelad

I think I posted about this on these forums a while ago. I found a blog post somewhere that claimed it was possible, but I couldn't get it to work.

https://forum.dronebotworkshop.com/esp32-esp8266/using-espnow-and-wifi-at-the-same-time-on-an-esp32/

 


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3392
 

@mmonti The Randomnerds have a tutorial on this.

"Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3392
 

@yurkshirelad Check the Randomnerds

"Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon


   
MACE and YurkshireLad reacted
ReplyQuote
codecage
(@codecage)
Noble Member Admin
Joined: 3 years ago
Posts: 1165
 

@dronebot-workshop

Awesome video Bill!

SteveG


   
ReplyQuote
mmonti
(@mmonti)
New Member
Joined: 3 years ago
Posts: 3
 

@yurkshirelad Just the ticket... Thank You, It took a bit of fiddling but its working nicely.


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3392
 

@mmonti You are welcome

"Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon


   
ReplyQuote
Russ Terry
(@russ-terry)
Active Member
Joined: 1 year ago
Posts: 17
 

This video and the sketches arrived just in time. I am in the process of making my boat smart.

I do have a couple of questions though. Bill mentioned that if using an 8266, the library would be different, but never said what it was. What library do I use?

Also, I noticed he was using a Unix machine for the xmit -- rcv sketches. When I tried to get both serial monitors up (on Windows) to compare the sent and received output, I could get one or the other, but not both at once. Is this a Windows quirk or am I not setting something?


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3392
 

@russ-terry EDIT: Tried it, not the board library, no idea now. For library, he probably just meant the board library. Just select the 8266 board and it should be ok, if not come back and ask again.

You need to have 2 instances of the IDE running, I think in windows you can 2 of something that isn't the same as an instance, but it's been a while, try right clicking the exe and look for INSTANCE or search windows help, it is likely a variant of rt clk. OR it's just windows being a pain.

"Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon


   
ReplyQuote
YurkshireLad
(@yurkshirelad)
Honorable Member
Joined: 2 years ago
Posts: 470
 

I think if you hold down the SHIFT key when you click on the IDE's icon at the bottom of the screen, it will start a new instance.


   
ReplyQuote
Ron
 Ron
(@zander)
Famed Member
Joined: 2 years ago
Posts: 3392
 

@yurkshirelad According to what I just read you have to have a second user on your PC, then rt clk and select run/open as different user. At least on Win 11

"Don't tell people how to do things. Tell them what to do and let them surprise you with their results.” - G.S. Patton, Gen. USA
"Never wrestle with a pig....the pig loves it and you end up covered in mud..." anon


   
ReplyQuote
Russ Terry
(@russ-terry)
Active Member
Joined: 1 year ago
Posts: 17
 

I can get two instances of the IDE open and can compile and upload both programs. I just cannot get both serial screens open at the same time. Both com ports are shown.

I got the 8266 board installed, but must have done something wrong somewhere along the process. The ESP-NOW library is missing. Enough for today. I will bang my head against that wall tomorrow or so.... 


   
ReplyQuote
YurkshireLad
(@yurkshirelad)
Honorable Member
Joined: 2 years ago
Posts: 470
 
Posted by: @zander

@yurkshirelad According to what I just read you have to have a second user on your PC, then rt clk and select run/open as different user. At least on Win 11

I don't know about windows 11, but on 10 you don't need a different user. I can right click on the icon at the bottom and click the apps name and it starts a second instance.


   
ReplyQuote
Page 1 / 4