ESP-NOW with ESP32 EXPLAINED: Easiest Wireless Communication Between Boards (ESP8266 Compatible)

  Переглядів 93,798

Rui Santos

Рік тому

For complete project details (schematics + source code), visit ►
Getting Started with ESP-NOW on ESP32 ►
Getting Started with ESP-NOW on ESP8266 ►

ESP-NOW is a fast connectionless communication protocol developed by Espressif that features short packet transmission and allows multiple boards to exchange data without using Wi-Fi.

Learn how to establish a two-way communication between two ESP32 boards using ESP-NOW. As an example, two ESP32 boards will exchange sensor readings (with a range in open field up to 220 meters ~ 722 feet).

This protocol also works with the ESP8266 NodeMCU board and we've tested the communication range between the two boards up to 140 meters (approximately 459 feet) in open field. In this experiment both ESP8266 on-board antennas were pointing to each other.

Like my page on Facebook:
Follow me on twitter:

Subscribe for more projects like this!

Lou Xamd
Lou Xamd 9 днів тому
Just need a gps and a script to pair them in a line to extend it past the limits
Wimal Manage
Wimal Manage 22 дні тому
‌Thanks a lot Rui. Happy to see a person like you. Your site is very interesting. I learned lot from you. Wish you all the best.
gazzacroy Місяць тому
cool stuff fella really good video thanks fella :)
WistrelChianti Місяць тому
Thanks! Very clear overview and explanation and nice test results. Out of interest, does ESPNOW work as an addition to wifi and bluetooth? Could all 3 protocols/radios be active at once? So for example, could I send control commands to an ESP32 via bluetooth, receive telemetry via wifi, and have it communicate with other ESP32's via ESPNOW all at the same time?
Electrical Coder
Electrical Coder 2 місяці тому
when i tried practical communication of two esp boards using espnow i get only 15-20metre maximum range not a completely open area ,almost 2-3 walls were there between the two boards. I still dont understand how people claim to have range of above 200metres oin blogs and videos .Do you experience the same Santos?
Hans de Groot
Hans de Groot 3 місяці тому
Hi. Wil wifi still work when using esp now?
Touseef z
Touseef z 3 місяці тому
Dear Rui Santos I am trying to send flex sensor value which i am receiving serially from arduino uno i am able to read the serial values on ESP Master and able to read the values on ESP Client but they don't get updated over time everytime i have to press RESET button on master ESP to update to date values on Client side Please let me know if you can help it's urgent Best regards
Touseef z
Touseef z 4 місяці тому
Dear Rui Thanks for your great tutorial I'm trying to run this code on ESP8266boards and end up with the following error esp_now.h: No such file or directory while if i try to compile the same code by selecting ESP32 board I'm not getting this error Can you please help me out on this Regards
Touseef z
Touseef z 3 місяці тому
PicoNano 5 місяців тому
Enjoyed your video very much. I wonder if I can use 4 ESP32 boards to make 2-way intercom 200 feet apart in a wooded area? I want to use the I2S along side ESP-NOW to accomplish this. Am I dreaming? PS: I can design and build Op Amp amplifiers and active filters to use in this project.
FPChris 5 місяців тому
So you have to put the mac address of the OTHER board into the .ino?
abdulraheem m
abdulraheem m 6 місяців тому
Is this function possible with esp8266 ????
Justin Anderson
Justin Anderson 7 місяців тому
Does this have to come from github? I have a “simple esp now connection.h” in IDE but no espnow.
Dan inWY
Dan inWY 5 місяців тому
clone the github repo for esp8266 rtos. It's in the examples directory when you clone it.
kumar jha
kumar jha 7 місяців тому
Dear Sir, You have done great work. Still I have one doubt regarding Multiple transmitters and single receiver that>>>>>> I am getting the data from all transmitters with their ID. But want to achieve data sequentially. How to obtain data coming from 3 transmitter sequentially? Thanks.
Zhou Crance
Zhou Crance 8 місяців тому
Woow i was looking for this video for long time you are a live saver. Can i calculate distance between two those two and when it reaches 2 meters then beeps an alarm. Reply please i working on my final school project. Thank you!!
Terry Peake
Terry Peake 7 місяців тому
No effective distance measurement is available on ESP_now
Bisma Surya
Bisma Surya 9 місяців тому
How to send receive data between 2 board ESP32 over BLE?
Bisma Surya
Bisma Surya 9 місяців тому
please make the tutorial
Prince Banini
Prince Banini 9 місяців тому
Is esp now MQTT?
Partou Electric
Partou Electric 10 місяців тому
Hi, Rui Thanks for your great video Your video is very close to my application. Is it possible to use it for audio streaming? I don't need high-quality audio Regards, Kazem
deeksha rahanoo
deeksha rahanoo 11 місяців тому
This is a great project. I am actually trying to make communication between two esp32 with different message to be sent. I have seen your detail tutorial, just wondering about power supply thing for the working
Jairo Reyes
Jairo Reyes Рік тому
Nice video, I'm making a project where I need to communicate multiple esp to one, and then send this data via Bluetooth to a cellphone. Is this protocol compatible with Bluetooth? Thanks
Gianfranco Perini
Gianfranco Perini Рік тому
Good evening. This library is very very good... But two questions: 1) is possible one device can be bridge too? 2) I have throuble to transmission a structure message: If I use this example... after some time all data are stable except one: String type... myData.d. Why? @}-,-'--------- Gianfranco
TOM TOM Рік тому
Thank You
Rui Santos
Rui Santos Рік тому
You're welcome!
Yasir Ali
Yasir Ali Рік тому
can we have same mac address for number of esp32 slaves
Murat TÜREL Рік тому
Thanks for all your videos that have NO crazy shity music on the background.
Long ngô
Long ngô Рік тому
Hi, Rui, how long the many ESP 8266 communicate together in ESP-NOW protocol ?Thanks for useful video
Matej Oder
Matej Oder Рік тому
hello i have problem solving difference between code for ESP32 and ESP8266. also where can i found sample code for two way multiple boards ( 5 boards)
Valendorn N
Valendorn N Рік тому
I'm trying to find a project for a board ESP32 but I can’t find anything I need to do a radio control on the sticks of the joystick, can you help?
Davide Perini
Davide Perini Рік тому
can we have both ESP NOW and Wifi running simultaneously? I want to have an esp acting like a slave, receive the message from esp now, and then send it into an MQTT queue via wifi, is this possible?
Steve Gables
Steve Gables 9 місяців тому
g g
g g Рік тому
Does esp now allow you to lower transmission rates so you can get several km/miles like you can with other protocols?
Werachai Srisupinanont
Werachai Srisupinanont Рік тому
I really want like this ...thanks a lot
mel bryant
mel bryant Рік тому
hello! i want to know if it is possible to use an encryption algorithm or something if i want to secure the data that transmit between those two nodes???
Jairo Reyes
Jairo Reyes Рік тому
Hi, I have the same question, did you you find something related?
Red King
Red King Рік тому
Rui, Great video!!! Can you make a super simple video/program, that has two esp32's controlling each others led's with a simple button on each device. And maybe how to expand it to 3 or 4 devices. Thank you very much.
pkilo2811 Рік тому
Great video..Can you implement ESP-NOW with Micropython?
James Cullins
James Cullins Рік тому
I tried to use this code on the ESP8266 Wemos D1 R1 but it would not compile. I changed the #include #include The above did not work I changed to the ESP32 D1 R1 below and it did compile. #include #include How do I make it work on the ESP8266? Thanks my friend.
Rui Santos
Rui Santos Рік тому
Please use the code for the right board. ESP32 with ESP-NOW Protocol ► ESP8266 NodeMCU board ESP-NOW ► You might also need to modify some of the code (not only the libraries imported)
The Hermit
The Hermit Рік тому
Thanks for the ESP-NOW video. This looks like just what I need. But, I'm currently coding w/Python & microPython using MQTT. Can ESP-NOW be configured from within Python and replace MQTT? Okay, I'll RTFM. But, thanks for the pointer.😎
On board
On board Рік тому
How many esp now videos have I watched now... think you are the only one that actually says how to send data.. thanks. :)
On board
On board Рік тому
@Rui Santos with this video I managed yesterday to connect a m5stickc with env hat to an esp32 sending all temp, acc, gyro, humidity and heading flawlessly. Works brilliantly. Thanks again.
Rui Santos
Rui Santos Рік тому
You're welcome. I'm glad it was helpful!
Internet e Coisas
Internet e Coisas Рік тому
Hello Rui, As always, very interesting content. Greetings!
Rui Santos
Rui Santos Рік тому
Jean-Pol Deloyer
Jean-Pol Deloyer Рік тому
Very great
Rui Santos
Rui Santos Рік тому
Hans Middelbeek
Hans Middelbeek Рік тому
Thanks a lot for your explanation! I just had a problem sending a string with a space between two words: all seems to go OK, ( sending and receiving) but the string is not received in the variable... what could be the cause?
Vinicius Рік тому
Could you make a exemple where it is possible to alter the values of the variable through the webpage?
Rui Santos
Rui Santos Рік тому
Take a look at this guide: Or this one:
tripodalt Рік тому
mate you get a 12% hunidity diference betwwen the ten centineter of your desktop
TRCC 11 місяців тому
Udo Schmelmer
Udo Schmelmer Рік тому
mate its called humidity
tinkmarshino Рік тому
very interesting I just stumbled on to your site by accident but I am rather glad I did.. I have been wanting to play around with my esp boards but just haven't really had the time to investigate them much.. I just popped onto your site and found that this is the place to come.. so I have subed up and will be pursuing your sites and gleaning all of your teaching very soon.. thanks for sharing what you have learned.. carry on..
George Ou
George Ou Рік тому
How quickly can you wake an ESP32 or ESP8286, send a message, and go back to sleep? This is critical for battery life.
Namer Num
Namer Num Рік тому
How about communication with computer
pov4756 Рік тому
How exactly is this "safe"?
Terry Peake
Terry Peake 7 місяців тому
Encryption option available in Library
Naguesh Verlekar
Naguesh Verlekar Рік тому
Hi sir, is there any external antenna connected to make it 220 meters?? When I tried I lost the signal at 50 metres.
Mucit Pilot
Mucit Pilot 9 місяців тому
he says "we used onboard antennas" in the video which means they did not use any external ones.
weerobot Рік тому
Asger Vestbjerg
Asger Vestbjerg Рік тому
Looking great Tanks for sharing
Rui Santos
Rui Santos Рік тому
Thanks for your feedback, I'm, glad it was helpful!
kimoy milo
kimoy milo Рік тому
Amazing videos Rui, do you have a video about bluetooh low energy using esp32?
Raveway Pro
Raveway Pro Рік тому
Novo seguidor aqui ... =)
woo ask
woo ask Рік тому
реализуй для начала
Adrian Schwizgebel
Adrian Schwizgebel Рік тому
Wow that's very interesting! Do you know if ESP-NOW and a regular WiFi connection to a router can be done simultaneously?
Alexey Fyodorov
Alexey Fyodorov Рік тому
Thanks a lot!
Ownedyou Рік тому
Love it!
id Рік тому
thank, very interesting
Bobby Downgrades
Bobby Downgrades Рік тому
Bluetooth does the same thing. SPP profile is both fast and reliable. You can setup a larger network with Bluetooth EDR and the speed of transmission is instant for a distance of say 30 meters through multiple walls. Not sure why so many new wireless types are being made when we have had Bluetooth 2.1 for so long. But fair play for making a video to show people and help publicise ESP.
Can we make mesh network from esp 32?
Joaquim Pedro
Joaquim Pedro Рік тому
Ob Rui pelo teu excelente trabalho!
Rui Santos
Rui Santos Рік тому
Espero que tenha sido útil. Abraço, Rui
jesus cardona
jesus cardona Рік тому
Excellent. Which is the difference between LORA and this protocol?.
Michael Bishton
Michael Bishton Рік тому
I am looking forward to an example of many-to-many devices. ESP_NOW seems like it only supports explicit data distribution; a known variable to a known (MAC address) device. What about a process like MQTT that distributes all information across any/all subscribers? How does ESP_NOW handle transmission collisions or message timing? Many thanks.
Michael Bishton
Michael Bishton Рік тому
@Rui Santos You response, in conjunction with what Jay Nottelling said below, I was wondering... Can ESP-NOW and WiFi run simultaneously? If so, the ESPs can create proper MQTT strings that are passed out to all ESP-NOW devices that read the string into a variable and consume parts of the string as appropriate. The EXP32 running WiFi can bridge the MQTT string to the internet. You form the data one time as an MQTT message and use it across both communications methods. I'm sure I'm missing something...
Rui Santos
Rui Santos Рік тому
Hi! Unfortunately ESP-NOW doesn't support some of those features and in my opinion MQTT will be more reliable. If you set this MAC Address: uint8_t broadcastAddress[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; Your ESP-NOW sender will broadcast your message (data) to all nearby ESP-NOW devices that can receive the same data structure.
Jay Nottelling
Jay Nottelling Рік тому
Espnow is great, I use it for my greenhouse sensors as they don't get WiFi. The hardest part I found was getting the data to my MQTT server while still listening for espnow data. I settled storing 10 readings, restart with WiFi squirt the data and repeat. I'd be very happy if you could do a follow up video showing a better way than I managed
Adam Рік тому
That's a pretty clever way of doing it if there's no way for both protocols to run at the same time
Filipe Brandão
Filipe Brandão Рік тому
Will esp-now work on ESP8266?
WaschyNumber1 Рік тому
Very cool video 👍
Rui Santos
Rui Santos Рік тому
Anders Jackson
Anders Jackson Рік тому
Fun to lab with, but not standard, which is a problem if you want to use it with others.
Uwe Ri_
Uwe Ri_ Рік тому
awesome stuff. I'll try it soon. I get in trouble with amount of all my internet device connection in the MASH enviroment. These can be a solution. Combine a group of ESP devices in a group. But in these scenario I need one ESP in the group that can communicate with multiple ESP devices and a raspberry pi MQTT server at same time. Do you believe these is possible ?
Rob K
Rob K Рік тому
maybe try uart between master esp and the pi?
FilmFactry Рік тому
Absolutely excellent. So, I haven't looked at the code yet. So, the incoming data, sensor data, on the receiver is just a variable? Can't wait to try this.
Corgitronics Рік тому
Great timing! I was just going to look into that for a project I'm hoping to start soon. Looking forward to the next video on this.
Rui Santos
Rui Santos Рік тому
More projects on this subject coming soon
HocusPocus Рік тому
What od somebody set Mac and there are two devices with same address?
mike shaw
mike shaw Рік тому
MAC Addresses should be unique.
HocusPocus Рік тому
Great :)
ProjectHivemind Рік тому
This is why I subscribe!
Ed19601 Рік тому
Interesting. I will see if i can combine it with regular wifi and if i can make it work on an esp8266
Tom Power
Tom Power Рік тому
Curious if you got both Wi-Fi and esp now working Simultaneously
if one slave how many master is connected ,and range of maximun slave and master;
Eddy Maue
Eddy Maue Рік тому
Shaker Ileiwat
Shaker Ileiwat Рік тому
@Rui Santos you are a great , I love it ♥♥♥
Rui Santos
Rui Santos Рік тому
ATS3788 Рік тому
Cool, That was what I'm looking for.
ATS3788 Рік тому
@Rui Santos Actually you are a great guy doing wonderful Project. I'm just jealous
Rui Santos
Rui Santos Рік тому
I'm glad it was helpful!
bm830810 Рік тому
Can ESP Now work alongside traditional WIFI, for example each slave do its initialization and MAC address exchange via wifi and then switch to ESP now, for this the masters wifi should be always enabled
bm830810 Рік тому
@Eddy Maue thanks for the response, how can you multiplex both ESP now and WIFI on the same 2.4GHz radio, don't WIFI need to be always available?
Eddy Maue
Eddy Maue Рік тому
this is doable ... The problem with Arduino is that everything is declared as global (public). It becomes simple if you wrap classes in different modes of communications. So what becomes public is the declaration of objects and in each of these objects you fill in the attributes specific to each mode of communication (espNow, Web, client, server and others). By using an interruption based on the clock in mili-seconds you scan your client, retrieve information and redistribute yourself according to your good wishes to whom it may concern . the only limit I know is the one you imposed on yourself cela est faisable ... Le probleme avec Arduino c'est que tout est déclaré comme global(publique) . Cela devient simple si vous encapsulé dans des classes les différents modes de communications. Alors ce qui devient publique c'est la déclaration d'objets et dans chacun de ces objets vous renseignez les attributs propre à chaque mode de communication (espNow, Web,client,server et autres). En utilisant une interruption basé sur l'horloge en mili-secondes vous scruter vos clients , récupérer l'information et vous redristibuer selon vos bons plaisires à qui de droit la seul limite que je connaisse c'est celle que vous vous imposé
Rui Santos
Rui Santos Рік тому
I think it should work, but I haven't tried it yet.
DocM Рік тому
Very nice project, I know understand esp-now a bit more. Does this also work on the esp8266??
Richard Pesti
Richard Pesti Рік тому
@Eddy Maue Hi! Could you send me a sample code? I am working on a similar project, I'd like to send an accelerometer's value via esp-now using ESP8266. And I am very disappointed because I am struggleing with that already 2weeks and I didnt find any useful on the internet yet. Thanks in advance!
Patrick Keel
Patrick Keel Рік тому
Have also a look at the video of Andreas Spiess
DocM Рік тому
@Eddy Maue Thanks, mixing was the 2nd question!!
Eddy Maue
Eddy Maue Рік тому
@DocMyes it works for the esp8266 and you can mix
DocM Рік тому
@Rui Santos Thank You
Hedley Davidson
Hedley Davidson Рік тому
Thanks - clear and concise . Wonder why the pressure values are different with sensors at same altitude 😀
Eddy Maue
Eddy Maue Рік тому
with regard to the BMP280 I tested on 10 units and I noted minus 1% of errors. The test was done in a closed environment. however I was not interested in atmospheric pressure .. I should have ... on my next order I will pour ce qui est du BMP280 j'ai fait le test sur 10 unités et j,ai noté moins 1% d'erreurs. Le test a été fait dans un environnement clos. cependant je ne me suis pas intéressé à la pression atmosphérique.. J'aurais du ... à ma prochaine commande je le ferai
Hedley Davidson
Hedley Davidson Рік тому
Rui Santos thanks for reply . I use these sensors my airplane so guess for product each sensor has to be individually calibrated and then software offset inserted before shipping .
Rui Santos
Rui Santos Рік тому
The humidity values are actual quite different, but that's why you should test multiple sensors to see which one gives you the most accurate readings
TRAC UET Taxila Рік тому
Thank you so much
TRAC UET Taxila Рік тому
@Rui Santos actually I was waiting for it from a long time 😊
Rui Santos
Rui Santos Рік тому
You're welcome! Thanks for watching
Rui Santos
Rui Santos Рік тому
Find the complete project details (schematics + source code) on my blog ► You might also like reading our Getting Started with ESP-NOW Protocol ► Getting Started with ESP-NOW on ESP8266 NodeMCU board ►
dex dipa
dex dipa Рік тому
what distinguishes it from esp mesh library
Introduction to ESP32 - Getting Started
DroneBot Workshop
Переглядів 667 тис.
#149 ESP32 Deep Sleep, RTC Memory, "Secret" LoLin Pins
Andreas Spiess
Переглядів 119 тис.
Comedy Club: премьерный выпуск 17 сезона
Телеканал ТНТ
Переглядів 2,9 млн
TamerlanAlena - Детка (Official Video 2021)
Переглядів 1 млн
ESP NOW Range Test with ESP 01
Переглядів 2,5 тис.
Professor Eric Laithwaite  "Motors Big and Small"  - 1971
Переглядів 431 тис.
Top 5 Arduino projects 2021 never seen before
Mr Innovative
Переглядів 393 тис.
ESP-Now mesh network demo 1
Nick Reynolds
Переглядів 17 тис.
Comedy Club: премьерный выпуск 17 сезона
Телеканал ТНТ
Переглядів 2,9 млн
TamerlanAlena - Детка (Official Video 2021)
Переглядів 1 млн
10AGE - Topic
Переглядів 201 тис.
Яхты, взятки и любовница. Что скрывает министр Лавров
Переглядів 270 тис.