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

ESP-NOW - Peer to Peer ESP32 Network

49 Posts
9 Users
6 Likes
4,239 Views
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1081
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)
Member
Joined: 4 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)
Member
Joined: 3 years ago
Posts: 493
 

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)
Member
Joined: 3 years ago
Posts: 493
 
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)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6970
 

@mmonti The Randomnerds have a tutorial on this.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6970
 

@yurkshirelad Check the Randomnerds

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
MACE and YurkshireLad reacted
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1037
 

@dronebot-workshop

Awesome video Bill!

SteveG


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

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


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6970
 

@mmonti You are welcome

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Russ Terry
(@russ-terry)
Member
Joined: 3 years ago
Posts: 16
 

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)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6970
 

@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.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


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

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)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6970
 

@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

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Russ Terry
(@russ-terry)
Member
Joined: 3 years ago
Posts: 16
 

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)
Member
Joined: 3 years ago
Posts: 493
 
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