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
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.
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.
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/
@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.
@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.
@yurkshirelad Just the ticket... Thank You, It took a bit of fiddling but its working nicely.
@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.
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?
@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.
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.
@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.
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....
@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.