I only started using ESP32s last year (I think it was). I fell in love with them due to their communications abilities. Connecting to the router is easy and flawless. HOWEVER, for my main project (Whole House Monitor) I ran some tests using ESP-NOW and discovered "Broadcast" mode, which suited my project much better than going through the main router. Now, several boards, just talk to each other directly and without issue. I like this because I don't have to hard code the MAC addresses of the "senders". Love it!
If you're serious about implementing ESP-NOW, I recommend using the ESP-MDF framework which adds extra functionality to ESP-NOW (its called Mespnow idk who names these things...), namely retransmission filter, Cyclic Redundancy Check (CRC), and data fragmentation features
When you said if there was a way to do device to device without a router, you missed the fact that you can host a Wi-Fi hotspot on one of the devices (of cause needs to support it, most Wi-Fi chips nowadays do though) which is what i.e cameras do to have a fast wireless transfer of high res photos
Yes, obviously, but if you want to connect 3 devices what do you do then? Route everything through one of the microcontrollers? You are just basically adding adding a router.
@@GaryExplains I mean yeah. Wi-Fi chips are pretty powerful if the ones in phones are a benchmark. I know this because for a long time I used one of my old phones as a Wi-Fi extender (bad Wi-Fi signal, student accommodation) and it was perfectly fine handling several devices. If you wanted to connect 3 devices, we can create a similar mechanism where we pass the relevant information that device X is hosting. Yes you are creating a router behind the scenes, but I don't think it matters in this case since it's not a literal physical router you need to configure, it's handled in the background. That way you can have the benefits of speed, reliability of data sent etc. I just feel that since we have a whole WIFI chip in there from what you are describing, seems like a missed opportunity of creating a more robust protocol. I do understand this makes it rather simple to implement, so that might be why
@@GaryExplains It wouldn't be permanently on though. What I am suggesting is an implementation that uses this as a form of communication to initiate connections, but use the normal Wi-Fi standard to do the actual data transfers. An example to this is how Samsung implemented a file transfer a bit ago (it might have changed now) where it used Bluetooth for discovery and transferring the appropriate information between the relevant devices and then just did a Wi-Fi direct connection between the devices to handle the rest because Bluetooth is too slow for the task (I mean as in Wi-Fi is obviously faster for that task). Once again, this is fine for like small bits of data you don't need to confirmation for that it indeed arrived. You could technically implement this mechanism but it would probably slow things down dramatically considering the limitations of how much data you can send at a time.
Great overview 🎉 Glad you can use wifi normally and ESPNOW at the same time as long as they are on the same channel. So i can use this Arduino code with the ESP32 + Platform IO as long as im compiling uisng the Arduino compiler vs the ESP Compiler right?
A topic suggestion/request: wifi file transfer. I've been using Windows' shared folder feature to transfer files between PC and Android phone for years, but it always annoyed me how slow it is, about 6-7 MBytes/s. Both WiFi and storage are capable of much, much more, but I haven't encountered software that could saturate even the good old WiFi 4 (n) bandwidth (300 Mbit/s for 2x2), most I saw was about 100 Mbit/s over WiFi 5. WiFi Direct often just doesn't work for no apparent reason between devices that aren't similar enough, even between two Android phones from different brands. Is there any software to transfer files over WiFi at least close to WiFi 5 bandwidth, considering properly capable WiFi modules and storage? Not even speaking of 6/6e/7 speeds or proper file management and streaming like with shared folders. I believe with modern hardware we should be able to move past the days of having to plug a cable to have a decent file transfer, and I think it might be a good QoL improvement for a fair amount of people. Thanks for your work on Gary Explains project!
It isn't that important, but I thought you should have mentioned it at the section at 1:04 where you were talking about the alternatives to a central wifi router.
So, from the programmer's point of view, we essentially get the functionality of UDP communication between two devices with direct connection and hard-coded IP addresses. Isn't "normal" WiFi (with all the usual layers above it) capable of point-to-point communication? Also, we could have put that device featuring the LED in AP mode and connect that way, right? Granted, this protocol is more lightweight, but I fail to see what essentially new it brings.
Yes, obviously, but if you want to connect 3 devices what do you do then? Route everything through one of the microcontrollers? You are just basically adding a router. And what of the power usage of the board that is acting as a router? It will need to be permanently on. Will it be able to handle its own tasks as well as route?
@@GaryExplains OK, so "keep in mind that being lightweight _does_ count"... Again, I know too little about WiFi protocols, but in wired world devices can communicate via IP (and, presumably, UDP atop it) through any kind of shared medium. After all, that's "ether" in the "ethernet", isn't it (and ALOHAnet worked over radio.) Routing is only needed when we cross the boundaries of shared media. Then again, this actually looks like a simpler replacement for IP... Thanks.
Wish ESPNOW was out 12 years ago, then I wouldn't have had to write my own command & control protocol for my UPAS project, or a least, it would have made it easier, will have to encorporate ESPNOW into UPAS, nice easy explaination, thanks for sharing. Oh do you know if you can use ESPNOW with normal WiFi functions ?
@@GaryExplains Well I think that Wi-Fi is defined by the physical layer. The rest of the details you give sound correct to me. I'd say that ESP-Now is using wi-fi but not using TCP/IP. Looking at espressif examples they have espnow under wifi espressif/esp-idf/tree/release/v5.0/examples/wifi/espnow Actually looking at your example at 9:35 you show using a wi-fi mode before initializing esp-now yourself.
Why support an interoperable standard such as WiFi Ad-Hoc mode or WiFi Direct when you can put a huge amount of time and effort into creating your own proprietary crap!
I am a little concerned that you perpetuate the term "WiFi Router" and imply that it is the same thing as an Access Point. It isn't! A Router is a Layer 3 device. It is not necessary for a device to be operating at Layer 3 to connect between WiFi and Ethernet, as you indicate near the start of the video. It's a common mistake for an amateur to make, but you are not an amateur 😉 Now, whilst it is true that many of these devices, particularly those used on the domestic market, combine the functionality of an Access Point and a Router, it is not so common for them to Route between WiFi and Ethernet (instead, they usually have a port to connect to the ISP and route between that an the home network, Ethernet and WiFi combined.) Indeed, if they were to route between these topologies, many home devices would cease to function. (For example, if you have Roku streaming device wired in to your ethernet, and you wish to control it from the phone app, connected wirelessly, this requires both devices to be on she same IP subnet, which therefore means no Router!) A device that merely connects WiFi and Ethernet together is a Layer 2 device, and is more correctly referred to as a Bridge, or if it has multiple Ethernet ports, a Switch. This may seem like a petty gripe, but you are an educational channel and I believe accuracy is important - the devil is in the detail! Otherwise, good video! (As usual.) 😁
I only started using ESP32s last year (I think it was).
I fell in love with them due to their communications abilities.
Connecting to the router is easy and flawless.
HOWEVER, for my main project (Whole House Monitor) I ran some tests using ESP-NOW and discovered
"Broadcast" mode, which suited my project much better than going through the main router.
Now, several boards, just talk to each other directly and without issue.
I like this because I don't have to hard code the MAC addresses of the "senders".
Love it!
Used esp32 on a few projects but never realized this is a thing. Amazing.
If you're serious about implementing ESP-NOW, I recommend using the ESP-MDF framework which adds extra functionality to ESP-NOW (its called Mespnow idk who names these things...), namely retransmission filter, Cyclic Redundancy Check (CRC), and data fragmentation features
ESP-MDF is another thing and Espressif has given it up for at least 2 years.
excellent, excellent, excellent explanation! THIS is the go to video on ESP NOW. Thank you for sharing your knowledge and makeing the video
Glad it was helpful!
Great video, Gary! Thanks for sharing!
You are very welcome! 🤗
When you said if there was a way to do device to device without a router, you missed the fact that you can host a Wi-Fi hotspot on one of the devices (of cause needs to support it, most Wi-Fi chips nowadays do though) which is what i.e cameras do to have a fast wireless transfer of high res photos
Yes, obviously, but if you want to connect 3 devices what do you do then? Route everything through one of the microcontrollers? You are just basically adding adding a router.
@@GaryExplains I mean yeah. Wi-Fi chips are pretty powerful if the ones in phones are a benchmark. I know this because for a long time I used one of my old phones as a Wi-Fi extender (bad Wi-Fi signal, student accommodation) and it was perfectly fine handling several devices. If you wanted to connect 3 devices, we can create a similar mechanism where we pass the relevant information that device X is hosting. Yes you are creating a router behind the scenes, but I don't think it matters in this case since it's not a literal physical router you need to configure, it's handled in the background. That way you can have the benefits of speed, reliability of data sent etc. I just feel that since we have a whole WIFI chip in there from what you are describing, seems like a missed opportunity of creating a more robust protocol. I do understand this makes it rather simple to implement, so that might be why
And the power usage of having one board act permanently as an AP? With it routing everything will it still be able to perform its own tasks?
@@GaryExplains It wouldn't be permanently on though. What I am suggesting is an implementation that uses this as a form of communication to initiate connections, but use the normal Wi-Fi standard to do the actual data transfers. An example to this is how Samsung implemented a file transfer a bit ago (it might have changed now) where it used Bluetooth for discovery and transferring the appropriate information between the relevant devices and then just did a Wi-Fi direct connection between the devices to handle the rest because Bluetooth is too slow for the task (I mean as in Wi-Fi is obviously faster for that task).
Once again, this is fine for like small bits of data you don't need to confirmation for that it indeed arrived. You could technically implement this mechanism but it would probably slow things down dramatically considering the limitations of how much data you can send at a time.
Great overview 🎉
Glad you can use wifi normally and ESPNOW at the same time as long as they are on the same channel.
So i can use this Arduino code with the ESP32 + Platform IO as long as im compiling uisng the Arduino compiler vs the ESP Compiler right?
A topic suggestion/request: wifi file transfer. I've been using Windows' shared folder feature to transfer files between PC and Android phone for years, but it always annoyed me how slow it is, about 6-7 MBytes/s. Both WiFi and storage are capable of much, much more, but I haven't encountered software that could saturate even the good old WiFi 4 (n) bandwidth (300 Mbit/s for 2x2), most I saw was about 100 Mbit/s over WiFi 5. WiFi Direct often just doesn't work for no apparent reason between devices that aren't similar enough, even between two Android phones from different brands. Is there any software to transfer files over WiFi at least close to WiFi 5 bandwidth, considering properly capable WiFi modules and storage? Not even speaking of 6/6e/7 speeds or proper file management and streaming like with shared folders. I believe with modern hardware we should be able to move past the days of having to plug a cable to have a decent file transfer, and I think it might be a good QoL improvement for a fair amount of people. Thanks for your work on Gary Explains project!
very good
Nice video, well done, thank you for sharing it with us :)
You didn't mention WiFi direct
Do you think it was necessary to mention? In what part of the video?
It isn't that important, but I thought you should have mentioned it at the section at 1:04 where you were talking about the alternatives to a central wifi router.
So, from the programmer's point of view, we essentially get the functionality of UDP communication between two devices with direct connection and hard-coded IP addresses. Isn't "normal" WiFi (with all the usual layers above it) capable of point-to-point communication? Also, we could have put that device featuring the LED in AP mode and connect that way, right? Granted, this protocol is more lightweight, but I fail to see what essentially new it brings.
Yes, obviously, but if you want to connect 3 devices what do you do then? Route everything through one of the microcontrollers? You are just basically adding a router. And what of the power usage of the board that is acting as a router? It will need to be permanently on. Will it be able to handle its own tasks as well as route?
@@GaryExplains OK, so "keep in mind that being lightweight _does_ count"...
Again, I know too little about WiFi protocols, but in wired world devices can communicate via IP (and, presumably, UDP atop it) through any kind of shared medium. After all, that's "ether" in the "ethernet", isn't it (and ALOHAnet worked over radio.) Routing is only needed when we cross the boundaries of shared media.
Then again, this actually looks like a simpler replacement for IP...
Thanks.
Great video Mr.Gary! Thank you for your knowledge. I’m a enthusiastic arduino project creator wish to speak with you soon cheers!
Wish ESPNOW was out 12 years ago, then I wouldn't have had to write my own command & control protocol for my UPAS project, or a least, it would have made it easier, will have to encorporate ESPNOW into UPAS, nice easy explaination, thanks for sharing. Oh do you know if you can use ESPNOW with normal WiFi functions ?
Amazing video❤️
I wonder if this will help in using less energy (certainly more than Bluetooth LE, but maybe much less than an ordinary WLAN?)
Why do you do the SSID broadcast instead of ESP-Now broadcast?
I am not aware of an "ESP-NOW broadcast" can you please post a link to that API call.
thank you for your very interesting video.
but (lol) y will probably being less satisfied two months after. when i begin to make the programm....
nicely explained !
Glad you liked it
Kinda sounds like it's still WiFi just not dependent on infrastructure mode
It uses the first two layers of Wi-fi as I said in the video. Action frames are part of 802.11, as I say in the video.
@@GaryExplains Yeah I just think the title is a bit off
But it isn't Wi-Fi pe se and you can use "normal Wi-Fi" alongside and with ESP-NOW.
@@GaryExplains Well I think that Wi-Fi is defined by the physical layer. The rest of the details you give sound correct to me. I'd say that ESP-Now is using wi-fi but not using TCP/IP. Looking at espressif examples they have espnow under wifi
espressif/esp-idf/tree/release/v5.0/examples/wifi/espnow
Actually looking at your example at 9:35 you show using a wi-fi mode before initializing esp-now yourself.
@@GaryExplains Wait, what - can these boards connect to an AP and while connected use ESP-NOW?
Is this a type of mesh network? What is the range?
Not a mesh, unless you code such functionality yourself. Range is just normal WiFi range, it is the same radios.
So god help me. Why can't we just use some of the many IEEE standards?
Why support an interoperable standard such as WiFi Ad-Hoc mode or WiFi Direct when you can put a huge amount of time and effort into creating your own proprietary crap!
@@uzlonewolf Why doing it the easy way, when you can have it complicated, right? :D
I am a little concerned that you perpetuate the term "WiFi Router" and imply that it is the same thing as an Access Point. It isn't!
A Router is a Layer 3 device. It is not necessary for a device to be operating at Layer 3 to connect between WiFi and Ethernet, as you indicate near the start of the video. It's a common mistake for an amateur to make, but you are not an amateur 😉
Now, whilst it is true that many of these devices, particularly those used on the domestic market, combine the functionality of an Access Point and a Router, it is not so common for them to Route between WiFi and Ethernet (instead, they usually have a port to connect to the ISP and route between that an the home network, Ethernet and WiFi combined.) Indeed, if they were to route between these topologies, many home devices would cease to function. (For example, if you have Roku streaming device wired in to your ethernet, and you wish to control it from the phone app, connected wirelessly, this requires both devices to be on she same IP subnet, which therefore means no Router!)
A device that merely connects WiFi and Ethernet together is a Layer 2 device, and is more correctly referred to as a Bridge, or if it has multiple Ethernet ports, a Switch.
This may seem like a petty gripe, but you are an educational channel and I believe accuracy is important - the devil is in the detail!
Otherwise, good video! (As usual.) 😁
I think your reply is actually longer than my video 😜
@@GaryExplains LOL. Not quite, but fair.
Learn to pronounce the letter h''!
Eh? You feeling ok? Try reading www.bbc.com/news/magazine-11642588