#223

  Переглядів 34,406

Ralph S Bacon

Ralph S Bacon

День тому

In this IOT world we need a simple way of sending data to a hub. Welcome to ESP-NOW.
JLCPCB Only $2 for PCB Prototype any colour jlcpcb.com/cyt including aluminium.
It was brought to my attention by a viewer that ESP-NOW is a protocol ideally suited to sending out small amounts of data (up to 250 characters) so I just had to experiment.
With an ESP32 receiver and an ESP8266 transmitter I modified the sketches written by @Rui Santos and which worked well. It was obvious that I could use this approach in my unified workshop "smart" heater controller.
Watch the video for further ideas and a working example (that you can get working in about 15 minutes)!
► You can now support me by buying me a coffee!
buymeacoffee.com/ralphbacon
► Modified sketches (Arduino IDE) for the sender and receiver in my GitHub
github.com/RalphBacon/223-ESP...
Click on ANY of the Banggood links below before visiting them to support this UKposts channel!
► ESP8266 modules
ESP-01 simple unit ideal as a sender $4
www.banggood.com/custlink/KDK...
Geekcreit® Wireless NodeMcu Lua CH340G $3.99
www.banggood.com/custlink/GDK...
► ESP32 modules
ESP32 Development Board WiFi+bluetooth Ultra Low Power $7.99
www.banggood.com/custlink/D3v...
► List of all my videos
(Special thanks to Michael Kurt Vogel for compiling this)
bit.ly/UKpostsVideoList-RalphB...
► @Rui Santos' links (thanks Rui, great info!)
Website for the ESP32 randomnerdtutorials.com/esp-n...
Video on this ESP-NOW • ESP-NOW with ESP32 EXP...
► Official Espressif User Guide for ESP-NOW
github.com/RalphBacon/223-ESP...
► Please support this channel by visiting my wonderful sponsors, JLCPCB
PCB boards for just $2 including aluminium! jlcpcb.com/cyt
► If you like this video please give it a thumbs up, share it and if you're not already subscribed please consider doing so and joining me on my Arduinite (and other μControllers) journey
My channel, GitHub and blog are here:
------------------------------------------------------------------
• / ralphbacon
• ralphbacon.blog
• github.com/RalphBacon
• buymeacoffee.com/ralphbacon
------------------------------------------------------------------
► Cast & Crew (in no particular order)
Vocals - Ralph
Camera - Ralph
Editing - Ralph
Key Grip - Ralph
Moral Support - Dougle (Yorkshire Terrier)
Hospitality - Mrs Ralph
Re-recording - Ralph

КОМЕНТАРІ: 206
@PIRATES3D
@PIRATES3D 2 роки тому
Rui Santos is from Portugal 😁 my country 😁 I used his tutorials in the past, it's very well explained. Great video 👍 best regards.
@RalphBacon
@RalphBacon 2 роки тому
Tudo bem, Fernando! Ironically, it was a holiday in Portugal several years ago (when I could speak Portugues) that started my entire UKposts venture off!
@canhobby6286
@canhobby6286 2 роки тому
Hi, Ralph - so glad to see you "discovered" ESP-NOW - as you mentioned it is a very useful and versatile light weight protocol. I believe it has been in the examples included with the ESP32 and ESP8266 board packages for quite some time now. I have used it in a project for a remote control for a fleet of smart cars based on 32s and 8266s. It is very adaptable - I use 1 transmitter to send to the various cars with a button on the remote control selecting which MAC to send to. In most of my ESP-NOW projects I use the AP mode of WiFi and assign each receiver (slave) a hard-coded MAC of my own choosing (note you need to assign odd addresses only). The ESPs allow you to have 1 MAC for STA mode and another for AP mode. This eliminates any hassles trying to get the MAC address and doing the auto discovery included in the example sketches. Things get to be a little more fun when combining MQTT and OTA with ESP-NOW.. I found I had to do a normal WiFi setup in STA mode and then init MQTT followed by OTA using this single WiFi init. Then I did an init of ESP-NOW using AP mode ( removing the WiFi.disconnect(); ). The examples in the boards package showed me how to make an array of the esp_now_peer_info_t slave variable. It is important to note that the transmitter and receiver need to be on the same WiFi channel - preferably a channel not being used by other applications such as MQTT. Here in Canada I use ch 1 for ESP-NOW. Amen to your comments on the IDE 2.0. It's handling of the Serial Ports in not real graceful. So for I have not seen any support for OTA uploads which is my favourite way to upload (eliminates Serial Port hassles). I actually contributed to the Arduino 2.0 project - they have their own ideas of what they want to do. Your idea of using an ESP-01 as a temperature sender sounds nice but left me scratching my head - I think the ESP-01 doesn't bring out the A0 pin. I took you recommendation re JLB PCB and did a couple of boards... (including a programmer for the ESP-01 and another for the LGT8F328P ( as well as ATmel ) based boards. Quite nice - they supported me quite well.. I installed a local router on my Linux system and was very impressed with the speed. Just recently I wanted to do some more boards and found that the integration with LCSC seems to be suffering... something about LCSC's move to a new facility which seems not to have been resolved yet. Anyway, Ralph - keep up the good work and Stay Healthy.
@RalphBacon
@RalphBacon 2 роки тому
Yes, I certainly hope to using ESP-NOW for (at least) one sensor in my workshop. If it goes OK, then might expand on that. Oh, regarding the ESP01, I won't be using the A0 pin; if I use, for example, the DS18B20 temperature sensor, that's just a digital, one-wire interface. Glad you had fun with your PCB design. I still get a thrill but the devil's always in the detail. A rushed board is a scrapped board. Don't ask.
@hariseldon2577
@hariseldon2577 2 роки тому
As I am aging gracefully, my hearing is declining so I can no longer hear the front doorbell. So, I placed an 8266 connected to a radar unit to register someone entering my drive and send a broadcast ESP-Now message to another unit in the house on my desk. This is connected to a relay that switches a piece of LED Christmas lights to flash on and off. Never miss a delivery now. Cheap and simple. I am currently playing with a third unit, an ESP-Cam module to hear the broadcast signal and trigger it to take a picture of the drive. I can also add as many esp8266 units around my 'estate', i.e. the back garden, to act as a 'perimeter defence' against cats and squirrels that are eating my strawberries...bstards!
@jyvben1520
@jyvben1520 2 роки тому
need watergun ... and AI to detect squirrels ... might detect cat/dog also as ....
@RalphBacon
@RalphBacon 2 роки тому
Sounds like a great project, Hari. Although the cats and squirrels do need their food too. Hang on, do cats _really_ eat strawberries?
@hariseldon2577
@hariseldon2577 2 роки тому
@@RalphBacon The cats just sh1t in my seedbeds....
@rfdave3980
@rfdave3980 2 роки тому
Ralph , excellent video. Can't wait to get started. Thanks to Rui Santos and you of course.
@RalphBacon
@RalphBacon 2 роки тому
Have fun! I've just included another ESP-NOW sensor into my system to record the attic (loft) temperature. Worked like a dream and was very quick to do.
@alanmusicman3385
@alanmusicman3385 Рік тому
ESP_Now is magic! I wanted to put a beacon transmitter in each of our family's cars so that, during darkness hours, the outside lights would automatically come on for 3 minutes when one of the cars arrives home. There are no street lights where we live and lots of trees which - when we have windy weather - annoyingly spuriously trigger PIR lights all the time. I was going to use Bluetooth and had a working beacon and receiver code set using the ArduinoBLE library - but then I found out about ESP-NOW and it seemed so much simpler than the multi-layer bluetooth approach with its connections and services and so on - much more suitable for my application. It worked first time and every time and connects just as fast (or perhaps even faster) than Bluetooth - and using a pair of ESP-32 WROOM boards the range is very good, the message stream from the car is received almost immediately the car is within 100 feet of the house. I did want to use an ESP-01 (8266 and tiny) for the car end of this, but I could not find a way to get ESP-Now working on 8266 using Arduino IDE (which seems a common experience) so eventually gave up and used ESP32 both ends. Very impressed with the speed reliability and range that this protocol offers.
@RalphBacon
@RalphBacon Рік тому
Your story is music to my ears, Alan (see what I did there?) Yes, ESP-NOW is almost magic. As you know, I have a few ESP32s connected to my Workshop Heater Controller (that has morphed into a web hub) from the attic (8m away) and outdoors (2m). All work very well indeed, very good range. Your application seems great!
@keldsor
@keldsor Місяць тому
Great video - I think that's exactly what I need for a new "add-on" to my existing "PIR and wired 🤨" burgler alarm - I'm NOT for wiring any more !
@RalphBacon
@RalphBacon Місяць тому
Yes, should work fine for that.
@200sxgrazor
@200sxgrazor 2 роки тому
Hi Ralph, great video, welcome to Club ESP-Now :) One of the major benefits I have experienced in using ESP-Now is the super fast boot and connect times. I have a bunch of ESP8266 based temp/humid sensor around my house that I was powering from 5v mains USB adapters. I tried using batteries but over standard wifi the quickest I could get them to connect to Wifi and send their data was about 7 seconds. This gave me a battery life of about a month at most when powering the device from a CR123A battery, even with deep sleep. By using the ESP-Now protocol my devices wake from deepsleep every 5 mins and send their data in less than 0.25 second. So far my sensors have now been running on a CR123A battery for nearly 10 months.
@RalphBacon
@RalphBacon 2 роки тому
Yes, I agree it does boot very quickly when just using ESP-Now. In fact, I've noticed that an ESP32 can receive an ESP-NOW message even before the startup( ) code has run!
@zyghom
@zyghom Рік тому
when on WiFi you can make ESP to wake up and connect to AP within around 300ms or less. You just need to tweak 3 things: 1- fixed wifi channel on both: AP and ESP 2- fixed IP on ESP 3- tune the wifi routine - all examples from internet show: "if not connected, delay for 1s" - I say: "delay for 20ms" - check it, it works. additionally: in case you want to use wifimanager these things are almost not "tweakable" but wifimanager brings other value added "thingis" ;-)
@zyghom
@zyghom Рік тому
@@RalphBacon my recent ESPnow project: hum/temp/light sensors + battery gauge, wake up, measure, send over ESPnow to the gateway, go to sleep - overall time around 150-400ms depending which sensors you use, ESPnow only takes ... 4ms including sending confirmation received from the gateway - amazing I would say. Also a plus: ESPnow apparently takes less current during sending than WiFi. Sleep current: 4.5uA
@Chriva
@Chriva 2 роки тому
Welcome back, Mr. Bacon. Your videos are always the highlight of the day :)
@RalphBacon
@RalphBacon 2 роки тому
You are most kind Christian!
@dafydds
@dafydds 2 роки тому
I was about to embark on creating my own BLE and WiFi unified comms package/function to do exactly this... Turns out I don't need to now as this solves all my problems, this is great, thanks 👍
@RalphBacon
@RalphBacon 2 роки тому
Glad I could help! There's nothing new under the sun, Dav.
@wilfredosandovaldelgado3690
@wilfredosandovaldelgado3690 2 роки тому
Supporting others... It's great.
@RalphBacon
@RalphBacon 2 роки тому
My pleasure Wilfredo!
@jonathanr4242
@jonathanr4242 2 роки тому
Excellent. I really learned a lot from these videos. They are very interesting and very entertaining. Who needs Netflix? I tried the esp-now and it waited for the while loop to finish on the receiver before running the on_receive_call_back. I had to put my receiver routines in a sperate task to get the esp-now to be responsive without any delay.
@RalphBacon
@RalphBacon 2 роки тому
I'm surprised about the "delay" you mentioned. I reduced the Serial Monitor baud rate to 300bps just so I could see it all happening in sequence otherwise it was all over in a flash. Pretty much instantaneous. I suppose it might depend on what else is running in the main loop.
@jonathanr4242
@jonathanr4242 2 роки тому
@@RalphBacon I had the esp32 running a motor driver, with a while (time/distance) loop, and wanted to implement a wireless "stop" button. I had to put the code to run the motor driver in a separate task (which I learned about from watching your UKposts channel) and let it check a global variable which I changed when I pushed the "stop" button. Otherwise it would wait for the while loop to finish before receiving.
@RalphBacon
@RalphBacon 2 роки тому
Good job putting that (blocking) code into a separate task.
@geralltgriffiths7772
@geralltgriffiths7772 2 роки тому
Thanks, as ever, for providing more food for thought! I now realise that MQTT messaging would be overkill for scenarios where this is more suitable. I highly recommend the BME280, but it does have an Achilles' heel -- the humidity sensor in it isn't suitable for "non-condensing" (i.e. outdoor) environments. It'll fail into a mode where it says the humidity is permanently 100%. Temperature and pressure readings from it seem to be unaffected. Knowing this might just give a few more considerations for how / where to install the sensor. I also endorse Rui Santos' site. Lots of good stuff there. Always a good starting-point for "how do I...?" situations. Looking forward to your next video, of course!
@RalphBacon
@RalphBacon 2 роки тому
Useful tip about the BME280, Gerallt, thanks! Luckily for me, if I use it, it will inside my workshop so it should be fine. But I will remember not to use outside.
@sermadreda399
@sermadreda399 2 роки тому
Great video thank you for sharing
@RalphBacon
@RalphBacon 2 роки тому
Thanks for watching!
@MUHAMMADYAWARIFRAHEEM
@MUHAMMADYAWARIFRAHEEM 2 роки тому
Very informative video Sir
@RalphBacon
@RalphBacon 2 роки тому
Thank you, nice to see your here again Muhammad.
@fredfreund2096
@fredfreund2096 2 роки тому
Thank you for this great video! I see a big advantage in protecting my wifi and in case of credential change of wifi AP! Sensor data converted to mqtt is my aim!
@RalphBacon
@RalphBacon 2 роки тому
Glad it was helpful!
@mr.bianchirider8126
@mr.bianchirider8126 2 роки тому
I've been trying to send data between two of my ESP8266's using an API bridge. What a mess ! Thanks to Rui and you I'm going to drop that like a bad transmission and try this method !
@RalphBacon
@RalphBacon 2 роки тому
Have fun! It's very easy to do and works like a charm.
@wayne8113
@wayne8113 2 роки тому
Thanks Ralph
@RalphBacon
@RalphBacon 2 роки тому
You're very welcome, Wayne!
@paulstubbs7678
@paulstubbs7678 2 роки тому
Most interesting, now to integrate this to one's WiFi - I await your next instalment
@RalphBacon
@RalphBacon 2 роки тому
That will come, Paul, as I have to do just that!
@vonries
@vonries 2 роки тому
Hi Ralph, I hope you're doing fine and keeping healthy. Keep up the good work TTYL.
@RalphBacon
@RalphBacon 2 роки тому
Thanks, Steven, I'm fine and healthy although I did have to put the central heating on yesterday (nearly the end of August) which is unheard of in the UK normally. I bet the weather is darned sight better in the Sunshine State!
@Mr31Vince
@Mr31Vince 2 роки тому
Im using ESP NOW for my diy christmas lights by having a master ESP32 running the main lights sequence and controlling 3 other ESP32s with ESP NOW comms to trigger remote sub sequences that are in time with the main sequence on the master. Works great!
@RalphBacon
@RalphBacon 2 роки тому
Sounds great, too, Vince. I've now got two ESP32s communicating with my Smart Workshop Heater 'hub' and with WIFI connected too so I can use my phone to read web pages (mainly the temperature and OTA screen). ESP-NOW is an excellent tool.
@jstro-hobbytech
@jstro-hobbytech 2 роки тому
More like Xmas 2120 Ralph. Haha. Great video brother.
@RalphBacon
@RalphBacon 2 роки тому
Glad you liked it Joey. Oh, and Merry Xmas!
@gazzacroy
@gazzacroy 2 роки тому
hi fella.wow that was a really good video :) i love the way you explain things was you ever a teacher???? im so pleased you took the time to have a look at this, i was blown away when i first got something working. is just so much quicker and you will see the battery last a tad longer oh and p.s. i found the range much better too. top stuff your a star.. see you soon :)
@RalphBacon
@RalphBacon 2 роки тому
I was never a teacher (in a school) but I did some (adult colleague) training for others throughout my working life so maybe that has helped me here too. Thanks for your kind words; as I mentioned in another comment, it was your nudge that made me investigate this - thank you.
@Hasitier
@Hasitier 2 роки тому
Very interesting Ralph. Could also be used if no accesspoint is nearby (in the field or so)
@RalphBacon
@RalphBacon 2 роки тому
In some ways, better than an access point as no SSID or password is required. Ideal for sensors.
@hopje01
@hopje01 2 роки тому
Great video. And also more secure I think, because it is not connected to the main wifi network. Outdoor 250m@300baud is a great distance!
@RalphBacon
@RalphBacon 2 роки тому
Indeed. But you can encrypt the comms (I didn't show this as I'm not worried about sending a temperature value across the airwaves; perhaps I should be more concerned as the MAC address must be in the payload somewhere).
@hopje01
@hopje01 2 роки тому
The benefit, I think, is that the main wifi network cannot be accessed when the esp32 is hacked.
@neilcameron4680
@neilcameron4680 2 роки тому
ESP-MESH is another useful communication protocol that does not require access to the WiFi router. In practice, both ESP-NOW and ESP-MESH had a range of 250m between stations.
@jyvben1520
@jyvben1520 2 роки тому
big range, very useful ...
@RalphBacon
@RalphBacon 2 роки тому
Something else for me to look at, Neil? Right, OK!
@narendraarya8761
@narendraarya8761 2 роки тому
Very good one, just a suggestion, you can use touch pin feature of the ESP32 to make project more interesting and touch control features in it. Again many thanks for your inspiring video, I learned lot you are hero.
@RalphBacon
@RalphBacon 2 роки тому
Thanks for the tip! I've used touch controls on my Arduino projects before but never on an ESP32. I shall have to test that out.
@veedonfleece3694
@veedonfleece3694 2 роки тому
Thanks for this! I wonder if the ESP-Now is completely independent of the Bluetooth? ..or e.g. is the PA shared, so that the BT would have to be suspended, if only for a short time?
@RalphBacon
@RalphBacon 2 роки тому
I never tested the interaction between Wi-Fi and Bluetooth in this scenario. I'd be surprised if Espressif designed it so that BT was affected in any way but empirical tests are the only way to prove that.
@digihz_data
@digihz_data 2 роки тому
Hi Ralph. I was intrigued by this feature (ESP-NOW), so i started to test around a little bit with using more than 1 struct, and it seams to work with sending and receiving more than just 1 struct. Sometimes you do not want to send or recieve everything in 1 struct. I will post my code for 2 ESP8266 (sender and reciever based on your tx and rx code) soon if it seams to work reliably.
@RalphBacon
@RalphBacon 2 роки тому
Thanks for sharing!
@melchiorrabie899
@melchiorrabie899 Рік тому
@@RalphBacon Hi Ralph, Im ok with electronics but absolutely terrible with programming. I have a project that is very much the same as what you have shown in your video BUT needs the code changed to accommodate voltage sensing by the "Transmitter" or Initiator to use the correct terms and sending that state to a "Receiver". The "Receiver" would need to trigger a relay. Do you take on this type of work for a fee? I could provide a schematic of what I want to achieve.
@andymouse
@andymouse 2 роки тому
Hi Ralph, I have used the BME sensors in a couple projects now and they are great I think the BMP version is cheaper but dosent have humidity, may be wrong way round !.....cheers.
@RalphBacon
@RalphBacon 2 роки тому
Yes, I read something like that too. As it happens I might utilise the humidity setting in a "future-future project" as it is important that my workshop does not have too much water vapour in it (during winter). I might even have to install an extractor (or just open a window... brrr).
@hoggif
@hoggif 2 роки тому
I think the receiver should have a state that is known unless it gets no temperature data. It could use a local sensor as a fallback or it could assume temperature is high enough or use some fixed (low) heat or whatever. Failing remote sensor should be assumed to happen and some reasonable working condition should result. I think esp-now is a great idea for this kind of stuff because it does not depend on wifi working or not. Thanks for another good video that can give a lot of ideas for other people too. I think esp-now should work along the wifi too. (never used it though). That could be usefull for example if you want OTA updates but sensor data not relying on wifi.
@RalphBacon
@RalphBacon 2 роки тому
Yes, the ESP-NOW _does_ work with Wi-Fi, thank goodness! My project is safe! And I do have a fall-back temperature sensor inside my heater controller for the reasons you state. Can never be too careful!
@webslinger2011
@webslinger2011 2 роки тому
Hope you're doin well. Definitely a nice alternative to the nrf wifi network. Stolen/Borrowed some codes myself to get my picamera to detect motion and send me alert pics.
@RalphBacon
@RalphBacon 2 роки тому
Sounds great! And it's definitely "borrowed" as it's all Open Source, right?
@webslinger2011
@webslinger2011 2 роки тому
@@RalphBacon The main python code I used was provided by (a 10 part python tutorial @_@) Alexander Baran Harper. Some other bits from Corey Shafer on how to use email with python and file management.
@arniep740
@arniep740 2 роки тому
What is the distance range over which these boards will communicate? Thanks for another interesting video!
@RalphBacon
@RalphBacon 2 роки тому
Real World experiments by Rui and others state that in Open Air it's about 250m (depends on the aerial, I guess) but in the home it will be less. Not a concern for my indoor 3m (max) range required!
@daque1960
@daque1960 2 роки тому
I am eager try JLCPCB because besides being cheaper per PCB their most economical shipping is far cheaper than my current supplier but I’m waiting on the world wide parts shortage to get better and let them do most of the smt assembly for me. My choice of microcontroller isn’t in stock at the moment. Thanks for all the videos! I have some 5 year old esp32’s still sealed in the bag. I was wondering (asking everyone ) will flashing the firmware fix that old security issue I read about a couple years back?
@RalphBacon
@RalphBacon 2 роки тому
If your "old" ESP32s are Rev 0 (you will see that message when you flash them) then they are buggy and should not be used for standard Wi-Fi projects. They might be OK for ESP-NOW, no telling. Rev 1 (and higher) is OK. Good luck with your (eventual) JLCPCB order, they make great boards.
@Bob_Burton
@Bob_Burton 2 роки тому
Note the subtle difference in the names of the ESP-NOW libraries used by the ESP32 and ESP8266
@RalphBacon
@RalphBacon 2 роки тому
Until you mentioned it, I hadn't even noticed. I just used the relevant board description and it "just worked". But good that you noticed the underscore in one version but not in the other. Eagle Eyes award of the week goes to you!
@pintokitkat
@pintokitkat 2 роки тому
Being English, I read from left to right, so it seemed odd that you'd put the receiver screen on the left ie before the transmitter. A silly thing to bug me, but it did. And then I noticed you swapped them at the end. You're trying to scramble my brain, aren't you?
@jyvben1520
@jyvben1520 2 роки тому
yup, had the same, when file copying/moving, left/source to right/destination
@RalphBacon
@RalphBacon 2 роки тому
My brain works strangely sometimes. More often, though, it's just random placement of windows that determines what you get to see! I shall take on board what you say though, Andy, and try to get sender on the left and the receiver on the right in future. Left to right. Got it.
@DavidHoegen
@DavidHoegen 2 роки тому
ESP-NOW is cool. I even tested it with other devices [ outlet, light switch not made by me] and it responded. It doesn't have a good range < 30 feet / 9 meters. Maybe I can have all my devices check-in on each other?
@RalphBacon
@RalphBacon 2 роки тому
Sounds interesting that other devices responded. I guess you extracted the MAC address of each device you were interrogating?
@DavidHoegen
@DavidHoegen 2 роки тому
@@RalphBacon I look at my router and found ESP-XXXX. and used the MAC. I was surprised it worked.
@jyvben1520
@jyvben1520 2 роки тому
so the receiver can have a list of mac addresses (more than 1) that it can connect to ? which is needed if using more than 1 sensor (bme280)
@RalphBacon
@RalphBacon 2 роки тому
The receiver doesn't know about _any_ MAC addresses, Jyv; it's the _transmitter_ that has to know the receiver's MAC address and each transmitter can send its data to the same receiver (that's what I intend to do).
@i8BBQ4Lunch
@i8BBQ4Lunch 4 місяці тому
I like your explanations. I'm new to ESP8266 and ESP-NOW and I have an issue. Starting with the Rui Santos receiver code, I: - Added an unsigned long variable to save the value of millis() in the Callback Function. - Added an if statement to evaluate (millis() - lastReceivedMillis
@RalphBacon
@RalphBacon 4 місяці тому
The GPIO controlling the built-in LED can vary from board to board so you might be (inadvertently) using a pin that also uses (or is impacted by) Wi-Fi, for example. A simple check would be to use a totally free, unused GPIO pin for the LED indicator (at least temporarily) to test out your code. Use an approx 150-ohm resistor (the GPIO pin is only 3v3 remember) and wire the anode to the pin and the other end of the resistor to GND. At least this way you can be sure your code is wrong 😆 and not the hardware!
@awuk3468
@awuk3468 2 роки тому
Does the ESP-Now only work as master / slave or can it act as a transceiver too? It would be good to know the range indoors and outdoors with ESP-Now. Can you secure ESP-Now with a wifi type WPA protocol?
@RalphBacon
@RalphBacon 2 роки тому
Whilst the implementation described by Rui indicates that the usual configuration is many slaves to one master (eg multiple temp/humidity sensors sending data to a hub) I'm _guessing_ that different code could be used to send stuff back to the sender... but as I don't need to do that I'll leave it to others to confirm.
@WILDMACK
@WILDMACK 2 роки тому
Hello Mr. Bacon, is it possible to use the ESP8266 to send tv remote control codes from one 8266 to one in another room? What I'm trying to do is replicate the pulses from the TV remote control from one room to control the cable box in the other room. I know you can use the 8266 to control TV's but is there a way to do it from different rooms? Thanks you so much for all the information you provide, I have learned so much from watching your channel.
@RalphBacon
@RalphBacon 2 роки тому
If you let the ESP8266 in one room _receive_ the TV remote signals, it can then send the required function (eg 1= vol up, 2=vol down etc) to another ESP8266 in another room using ESP-NOW, and _that_ ESP8266 then outputs the correct IR codes to the TV. Sound sensible?
@WILDMACK
@WILDMACK 2 роки тому
@@RalphBacon Thank you. I’m new to all this, but I think your saying assign a number to all the functions and that numbers gets sent to the other 8266 and then sends out the TV code. Sounds like that will work, I’ll give it a try. Thanks…
@lint2023
@lint2023 2 роки тому
Exciting. Just to understand: ESP NOW is just code and doesn't need specific ESP's to work. Right?
@RalphBacon
@RalphBacon 2 роки тому
Apparently so. It's just a (software) protocol that all ESP's (even ESP8266s) respond to and can understand. Exciting indeed!
@gregwmanning
@gregwmanning 2 роки тому
They are called Transmitter and Receiver but both devices transmit and receive. It is interesting that only the "receiver" mac address is required. Maybe some sort of broadcast acknowledgement by the receiver? Thanks for the tutorial.
@RalphBacon
@RalphBacon 2 роки тому
The receiver certainly auto-acknowledges the sender's transmission, as the video shows; whether we can actually send back actual data to the sender I don't know.
@reelrebellion7486
@reelrebellion7486 2 роки тому
a low overhead wifi based protocol. nice. loads of questions, like "how many stations?", etc. I wonder what happens if you put the mac address of, oh say, your router or other wifi device, on the receiver, the transmit a dummy packet. Do you get a response? could be used for a sort of presence detection like has been done with bluetooth beacons, but active checking not just, I haven't heard from this in a while so I'll assume it is gone". "Hey! Ralph, the wifi garden gnome has gone missing".
@RalphBacon
@RalphBacon 2 роки тому
Interesting questions that I will leave others to answer as I have enough to do just getting my Smart Heater Controller off the ground! Now, hang on, _where is_ my garden gnome?
@BendeVette
@BendeVette 2 роки тому
The real fun starts when you use ESP-Now to build a mesh network so you can send messages to a master through a different paths when a path is not available for a moment. Through a broadcast, you can tell everybody your MAC address. It will be received by everyone which is listening and in reach.
@jyvben1520
@jyvben1520 2 роки тому
nice to know, does that make it unsafe ? anyone can send their mac address and then send fake sensor data, would be very difficult i suppose (to know what the system expects)
@RalphBacon
@RalphBacon 2 роки тому
The transmission can be encrypted but whether that includes the MAC address I don't know.
@BendeVette
@BendeVette 2 роки тому
@@RalphBacon There seems to be a ESP-MESH too, also provided by espressif (there is also a Arduino library). It has to be save, else nobody would use it.
@mouaadhyaichi842
@mouaadhyaichi842 2 роки тому
Hi sir , how i do program ESP-NOW in one way between three nodemcu esp 8266 , master send message to Slave 1 then slave 1 send message to Slave 2
@RalphBacon
@RalphBacon 2 роки тому
Each ESP32 can 'listen' for ESP-NOW messages to just send the message to the corresponding slave's MAC address. It, in turn, will forward it onto the next slave using a different MAC address.
@mail87523
@mail87523 2 роки тому
If I may suggest that a heartbeat be implemented for safety reason. For example the receiver must receive a message insaide a time interval and if not receive a message safe turn off the heater.
@RalphBacon
@RalphBacon 2 роки тому
Even better, I have a fall-back temperature sensor inside my heater control unit that will be used in the absence of a regular update. But a very good point, we don't want thermal runaway in my workshop!
@whatwhatdidtheysay...lyric2373
@whatwhatdidtheysay...lyric2373 2 роки тому
Can this be used between MIXED MCU ... from ESP8266 to ESP32 and vice versa?
@RalphBacon
@RalphBacon 2 роки тому
Indeed you can, I thought I'd demoed this in the video? Perhaps I dreamed it. But it does work.
@whatwhatdidtheysay...lyric2373
@whatwhatdidtheysay...lyric2373 2 роки тому
@@RalphBacon HAHAHA Sorry Ralph. I will watch it again. Thanks for the response!
@MandoRick1978
@MandoRick1978 Рік тому
Great info, cheers. You tried the DS18B20 probe?
@RalphBacon
@RalphBacon Рік тому
Yes I have, my workshop and attic both have DS18b20 sensors wired to an ESP32 and using ESP-NOW to send the values back to my Workshop Heater Controller. I use the simple DS18B20 library from Rob Tillaart that only allows ONE sensor per pin: github.com/RobTillaart/DS18B20_RT because it uses less memory. Normally, you are able to put umpteen DS18B20 sensors on a single pin because each DS18B20 has a unique ID and you can query each one independently. I didn't need that so used the simple library instead.
@yogeshitaliya473
@yogeshitaliya473 2 роки тому
😍😍😍
@RalphBacon
@RalphBacon 2 роки тому
Hey, Yogesh, nice to see you here!
@jijeshkorothpoyil2697
@jijeshkorothpoyil2697 5 місяців тому
1.Do espnow work on AI Thinker esp boards or only on espressif ? 2. Is there any difference in range of espnow with Case 1 : esp32 +esp32 Case 2: esp8266 +esp8266 Case 3: esp32 and esp8266
@RalphBacon
@RalphBacon 5 місяців тому
ESP-NOW is a proprietary comms layer, implemented by Espressif as part of their framework. So _any_ ESP32 using that framework will also be able to use ESP-NOW. The ESP8266 also allows this and here's a great article that show you exactly how to do it: bit.ly/espnow-esp8266
@qzorn4440
@qzorn4440 2 роки тому
gee whiz... i just get started on the esp-32 and now esp-now...??? while working with opencv/AI stuff... there has to be more than just setting up pcb... thanks for the great info...:)
@RalphBacon
@RalphBacon 2 роки тому
Glad you liked it and made you appreciate the power of the ESP32!
@AllanYolticGSolis
@AllanYolticGSolis Рік тому
Ok, anyway. I am looking for a way to send data to my computer from a ESP32 wireles, how do I do that? I see that both receiver and transmitter are connected to a computer, I guess that I need to connect the ESP32 to a battery so I can power it, but I am not sure how to get all of that done.
@RalphBacon
@RalphBacon Рік тому
Your questions are quite fundamental, Allan. If you don't have much experience you need to start smaller and work up to your desired project level. There are many, many videos on this channel to help you in your quest. Good luck!
@AllanYolticGSolis
@AllanYolticGSolis Рік тому
@@RalphBacon as I searched videos about it, those didn't appear that's why I am asking here, but I found other videos which answer to my doubts. I am in a hurry to get it done
@jhunphilipsalar2641
@jhunphilipsalar2641 2 місяці тому
I have a same issues for setting up a simple wireless water level sensor for the reciever is not giving the value input? How can i fix this?
@RalphBacon
@RalphBacon 2 місяці тому
You will have to describe the "same issue" so I can understand your problem better. If you mean you are transmitting a value using ESP-NOW but the receiver is printing something else, then chances are that your data type is not correct. Create a struct to hold the data (even if it's just a single integer) and use the same struct definition in the receiver too.
@user-ir2fu4cx6p
@user-ir2fu4cx6p Рік тому
11:23 I guess they are using one of ESP32 multiple timer to create that loop, it will save CPU loop time and dedicated resources to other tasks.
@RalphBacon
@RalphBacon Рік тому
That would be my assumption as well.
@Harry-li1fx
@Harry-li1fx Рік тому
Can I send accelerometer data values using espnow
@RalphBacon
@RalphBacon Рік тому
Yes, you can but you do not want to flood the receiver (it runs code on each packet received).
@russellchung1794
@russellchung1794 Рік тому
I am wondering if anyone has tried ESP NOW and ESP Rainmaker on the same ESP32 ? Could not find any info regarding that
@RalphBacon
@RalphBacon Рік тому
Well, I'm using ESP-NOW and general Wi-Fi on the same device without issues. Given that ESP Rainmaker is an AIoT cloud implementation for which you'll need connectivity, I would hope (and expect) it to work. But we'll never know unless someone (hey, you busy, Russell?) tries it out!
@JamesWattMusic
@JamesWattMusic 7 місяців тому
Hi do you have example of ESP-NOW and WiFI. I cant get the examples I have found to work. I have ESP-Now data receiving, then I add the WiFi.begin() to the receiver board, and the data stops showing up. I comment it out, and data comes back. all on channel 6 I checked. Cant get the data to show up in wifi, only serial monitor... @@RalphBacon
@gazzacroy
@gazzacroy 2 роки тому
i tryed making a simple pager system with this and seems to be getting there.. i got 1 sender unit going and a few receivers doted about :)
@RalphBacon
@RalphBacon 2 роки тому
Sounds great. As the instigator of this project, thanks to your comment, I thank you! I wonder why I never heard of it before?
@gazzacroy
@gazzacroy 2 роки тому
@@RalphBacon yer i only just stumbled across in the data sheet. i think they need to advertises it more , it an amazing protocol as you righty said the only draw back i can see is the 200ish bytes it can send but again this isnt a big deal just buffer it i guess. your a star :)
@georgefriday4872
@georgefriday4872 2 роки тому
Really liked this one. Could you do another please and show Arduino cloud ? I've started looking at the Arduino cloud and it looks interesting.
@RalphBacon
@RalphBacon 2 роки тому
Hmm, I'll add it to the list!
@PetRatty
@PetRatty 2 роки тому
Bit late to the party! Next try OTA via ESP-Now via ESP-Mesh for a device 2 miles away
@RalphBacon
@RalphBacon 2 роки тому
Is this a challenge, Steven? I've got to get OTA working first (using PlatformIO) then I might consider what you suggest. Might. 🤷‍♂️
@MPElectronique
@MPElectronique 2 роки тому
Whats the max distance between the esp's ?
@RalphBacon
@RalphBacon 2 роки тому
In open air about 250m; indoors... well, far less I assume but must be about the same as you would get with standard Wi-Fi.
@YigalBZ
@YigalBZ Рік тому
Thanks for the video. Questions: 1) What if the master device has no knowledge of how many slave deices are out there when waking up? Is there a away to send "who is alive" and get the MAC addresses of all alive slaves? This can prevent the need to hard code the MAC addresses. 2) is there a way to communicate from Windows/Linux to ESP-NOW device?
@RalphBacon
@RalphBacon Рік тому
You can't do what you suggest because you are doing it backwards. The master cannot sleep. The slaves (sensors) can, of course. But the master must remain awake to get the data at any time. ESP-NOW won't take unsolicited data from just any old ESP32. The MAC address ensures that the slave is an authorised one as it knows the MAC address of the _master_ (not the slave). I don't know of any way to communicate from Windows/Linux to ESP32 via ESP-NOW as it is an Espressif protocol - but you can just use normal Wi-Fi for that.
@YigalBZ
@YigalBZ Рік тому
@@RalphBacon I am not sure I agree. yet this is not what I meant. Let's say the whole system is waking up at the same time. Yet another slave was added since last time. Does it mean the master needs to be reprogramed?? With the new slaves' MAC address? this can be done at the lab, but not at the field. I think there is a way in which the master sends a message to "who ever is out there", and get responses. Then the master will send a specific message to each slave and get the specific answer so the master now can operate the slaves by their role.
@sciencearoundus
@sciencearoundus 2 роки тому
Is it possible to use a single esp as slave and gate way?
@RalphBacon
@RalphBacon 2 роки тому
I'm not totally clear on your meaning here; do you mean as an ESP-NOW initiator (or responder) AND using standard Wi-Fi too? At the same time?
@sciencearoundus
@sciencearoundus 2 роки тому
@@RalphBacon Like is it possible to use esp now and wifi at the same time. Suppose we are getting the data from another esp module to a central module, can that same module can both receive and transmit the data to the cloud
@RalphBacon
@RalphBacon 2 роки тому
Yes you can. That is exactly what my Smart Heater Controller does. It receives three ESP-NOW signals from various sensors but is also connected to my Wi-Fi for me to interrogate it via a web page (and it also talks to a SonOff Basic switch too). Cool, huh?
@sciencearoundus
@sciencearoundus 2 роки тому
@@RalphBacon yeah thats so cool can you make video on that. Many videos out there are using 2 esp's for gate way system. Actually I am working on a wsn. If you could make a video it helps me a lot. if not can you share few resources. Thank you.
@dunk_law
@dunk_law 2 роки тому
@@RalphBacon I have spent a week on this. First I secure (PMK & LMK) linked two 8266's. I tried to connect the receiver to my WIFI network to pass data as MQTT - NO GO! Then I replaced the Receiver with an ESP32, still with a secure link - STILL NO GO! yet. When I turn on WIFI_AP_STA I receive no ESPNOW packets. I have gleaned that all devices need to run on the same channel & that lower channel numbers did seem to work more reliably for one person. I am really struggling with this. Looks like MrDIY coped out and linked two modules together, one to receive ESPNOW and the other for wifi MQTT.
@josephdaniel7890
@josephdaniel7890 2 роки тому
Hi sir please post more videos
@RalphBacon
@RalphBacon 2 роки тому
Will upload soon!
@rajeshpanigrahi9654
@rajeshpanigrahi9654 Рік тому
Can you give me the code for ESP8266 transmitter ?
@RalphBacon
@RalphBacon Рік тому
I'm not using ESP8266 at all for ESP-NOW, always an ESP32.
@alanmusicman3385
@alanmusicman3385 Рік тому
The claim that esp_now works on ESP32 and 8266 seems unsubstantiated. The Internet seems full of people asking how to get it working on 8266 when programming from Arduino IDE and not really getting any useful answers. In the end I gave up and used ESp32 at both ends - they are really very cheap dev boards now so not a big deal - but I still have the nagging feeling that that is what Expressif intended I should do cos the 8266 claim is not one they want to meet now; Or is that way too cynical? :-)
@JamesWattMusic
@JamesWattMusic 7 місяців тому
I can get the data sending from ESP-01s (ESP8266), to a ESP32. Programming ESP-01s to do that is kinda a pain. But it works. My problem is I cant get the data from ESP32 into a WiFi page. When I try to do ESP NOW + WiFI on my ESP32(receiver board) the data isnt received any more. @@alanmusicman3385
@tenminutetokyo2643
@tenminutetokyo2643 2 роки тому
DOOD!
@RalphBacon
@RalphBacon 2 роки тому
Cool!
@thenextproblem8001
@thenextproblem8001 2 роки тому
No Arduino time please 🥺. Can't wait to talk both network
@RalphBacon
@RalphBacon 2 роки тому
Hmm, I couldn't agree more.
@NomenNescio99
@NomenNescio99 2 роки тому
Why did my comment about esp now got removed?
@colinpamplin9976
@colinpamplin9976 2 роки тому
Mine did too, strange
@RalphBacon
@RalphBacon 2 роки тому
@Niklas Paulsson Nothing to do with me, honest! In fact I got notified of your original comment, and here it is: I've had quite a bit of issues of getting esp8266 and esp32 to talk to each others when using the esp-idf for esp32 and ESP8266_RTOS_SDK for the esp8266s and not the arduino api/sdk. In my case It seemed to boil down to wifi settings and it was definitely non trivial to debug and get it working. As long as I stuck to only esp32s and esp-idf it all worked roger-yankee-doodle-dandy. The small price increase in price for an esp32 instead of an esp8266 when setting up my esp-now based iot network now control of my home wasn't worth my time - so now I stick to esp32s exclusively and I'm happy. As alwyas, it's a work in progress, but I've got IR-diode senders, buttons, relays, sensors and range extending repeaters working together with a gw that can connect to the internet and hopefully soon will act as a mqtt gateway. If anyone is interested, see github and the username np422, all repositories named esp-now-something ...
@RalphBacon
@RalphBacon 2 роки тому
@Colin Pamplin Sorry, Colin, I can't find any reference to your comment, it's not awaiting moderation or anything. UKposts technology failing us, by the looks of it.
@NomenNescio99
@NomenNescio99 2 роки тому
​@@RalphBacon It is most likely youtube's ai-algorithms that are getting overly aggressive these days when it comes to censorship. Nevermind, just keep it up, esp-now is a useful and interesting topic!
@colinpamplin9976
@colinpamplin9976 2 роки тому
@@RalphBacon I don't know whats going on with YT as I've now posted 3 times. Each time I see my comment appear then refreshing the page and it disappears. Most odd
@dave-in-nj9393
@dave-in-nj9393 2 роки тому
what is scary is the idea that the manufacture put in a communication that is below our awareness or our control.
@RalphBacon
@RalphBacon 2 роки тому
True. I never realised that an ESP32 would auto-acknowledge a random ESP-NOW packet (which has the correct MAC address). Denial of service, anyone?
@fillempie1501
@fillempie1501 2 роки тому
hmmmm how about spoofing?
@RalphBacon
@RalphBacon 2 роки тому
The connections can be _encrypted_ so I'm hoping that no-one could eavesdrop on the data (or MAC address).
@fillempie1501
@fillempie1501 2 роки тому
@@RalphBacon Connection is encrypted, but before that as far as I can see is there no authentication. Every ESP32 connects to another. A pain in de ... for security folks :)
@kozlovskyi
@kozlovskyi 2 роки тому
Arduino is not user friendly. Free rtos is!
@RalphBacon
@RalphBacon 2 роки тому
I suspect (although I could be wrong) that the millions of Arduino users out there happily making stuff would disagree with you! 😂
@zyghom
@zyghom Рік тому
completely opposite: rtos is powerful but arduino is friendly ;-)
@MandoRick1978
@MandoRick1978 Рік тому
Trolling like a champ.
@luisdelgado1517
@luisdelgado1517 2 роки тому
someone, can you help me, with the library or document.h like esp_now.h? I don't find it
@RalphBacon
@RalphBacon 2 роки тому
They are part of the ESP32/ESP8266 framework. See Rui Santos' description here: randomnerdtutorials.com/esp-now-esp32-arduino-ide/
@luisdelgado1517
@luisdelgado1517 2 роки тому
@@RalphBacon thanks Ralph S Bacon for your helping
ESPNOW for beginners! #ESP32 #ESP8266
35:09
Programming Electronics Academy
Переглядів 118 тис.
Why Did I Pick Wi-Fi over ESPNow?
4:53
MrDIY
Переглядів 16 тис.
Піхотинці - про потребу у людях
00:57
Суспільне Новини
Переглядів 833 тис.
Voloshyn - ЗУСИЛЛЯ (прем'єра треку 2024)
06:17
VOLOSHYN
Переглядів 612 тис.
Анита просто на химии, поэтому такая сильная
00:21
Женя Лизогуб SHORTS
Переглядів 2,8 млн
#224 🛑 STOP using Serial.print in your Arduino code! THIS is better.
26:39
ESP-Now Range Test: Real-World Results for ESP32 Devices!
8:01
atomic14
Переглядів 102 тис.
451 Which Processor can kill the ESP32?
11:24
Andreas Spiess
Переглядів 332 тис.
Extracting Firmware from Embedded Devices (SPI NOR Flash) ⚡
18:41
Flashback Team
Переглядів 491 тис.
#43 ESP8266 Range Test with and without External Antenna
5:05
Andreas Spiess
Переглядів 291 тис.
Anyone Can Send Data to Anyone | ESPNOW Many To Many Communication
9:07
The Hub 3 - an ESPNow to Wi-Fi / MQTT gateway
6:45
MrDIY
Переглядів 14 тис.
Рекламная уловка Apple 😏
0:59
Яблык
Переглядів 737 тис.
Он Отказался от БЕСПЛАТНОЙ видеокарты
0:40
ЖЕЛЕЗНЫЙ КОРОЛЬ
Переглядів 733 тис.
Радиоприемник из фольги, стаканчика и светодиода с батарейкой?
1:00
M4 iPad Pro Impressions: Well This is Awkward
12:51
Marques Brownlee
Переглядів 4,6 млн