Rui Santos is from Portugal 😁 my country 😁 I used his tutorials in the past, it's very well explained. Great video 👍 best regards.
@RalphBacon3 жыл бұрын
Tudo bem, Fernando! Ironically, it was a holiday in Portugal several years ago (when I could speak Portugues) that started my entire KZbin venture off!
@canhobby62862 жыл бұрын
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.
@RalphBacon2 жыл бұрын
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.
@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 Жыл бұрын
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!
@dafydds3 жыл бұрын
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 👍
@RalphBacon3 жыл бұрын
Glad I could help! There's nothing new under the sun, Dav.
@200sxgrazor2 жыл бұрын
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.
@RalphBacon2 жыл бұрын
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!
@zyghom2 жыл бұрын
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" ;-)
@zyghom2 жыл бұрын
@@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
@geralltgriffiths77723 жыл бұрын
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!
@RalphBacon3 жыл бұрын
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.
@hariseldon25773 жыл бұрын
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!
@jyvben15203 жыл бұрын
need watergun ... and AI to detect squirrels ... might detect cat/dog also as ....
@RalphBacon3 жыл бұрын
Sounds like a great project, Hari. Although the cats and squirrels do need their food too. Hang on, do cats _really_ eat strawberries?
@hariseldon25773 жыл бұрын
@@RalphBacon The cats just sh1t in my seedbeds....
@neilcameron46803 жыл бұрын
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.
@jyvben15203 жыл бұрын
big range, very useful ...
@RalphBacon3 жыл бұрын
Something else for me to look at, Neil? Right, OK!
@keldsor4 ай бұрын
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 !
@RalphBacon4 ай бұрын
Yes, should work fine for that.
@jonathanr42423 жыл бұрын
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.
@RalphBacon3 жыл бұрын
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.
@jonathanr42423 жыл бұрын
@@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 KZbin 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.
@RalphBacon3 жыл бұрын
Good job putting that (blocking) code into a separate task.
@Bob_Burton3 жыл бұрын
Note the subtle difference in the names of the ESP-NOW libraries used by the ESP32 and ESP8266
@RalphBacon3 жыл бұрын
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!
@mr.bianchirider81263 жыл бұрын
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 !
@RalphBacon3 жыл бұрын
Have fun! It's very easy to do and works like a charm.
@Chriva3 жыл бұрын
Welcome back, Mr. Bacon. Your videos are always the highlight of the day :)
@RalphBacon3 жыл бұрын
You are most kind Christian!
@rfdave39802 жыл бұрын
Ralph , excellent video. Can't wait to get started. Thanks to Rui Santos and you of course.
@RalphBacon2 жыл бұрын
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.
@Mr31Vince2 жыл бұрын
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!
@RalphBacon2 жыл бұрын
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.
@wilfredosandovaldelgado36902 жыл бұрын
Supporting others... It's great.
@RalphBacon2 жыл бұрын
My pleasure Wilfredo!
@hoggif3 жыл бұрын
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.
@RalphBacon3 жыл бұрын
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!
@vonries3 жыл бұрын
Hi Ralph, I hope you're doing fine and keeping healthy. Keep up the good work TTYL.
@RalphBacon3 жыл бұрын
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!
@hopje013 жыл бұрын
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!
@RalphBacon3 жыл бұрын
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).
@hopje013 жыл бұрын
The benefit, I think, is that the main wifi network cannot be accessed when the esp32 is hacked.
@BendeVette3 жыл бұрын
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.
@jyvben15203 жыл бұрын
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)
@RalphBacon3 жыл бұрын
The transmission can be encrypted but whether that includes the MAC address I don't know.
@BendeVette3 жыл бұрын
@@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.
@narendraarya87613 жыл бұрын
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.
@RalphBacon3 жыл бұрын
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.
@paulstubbs76782 жыл бұрын
Most interesting, now to integrate this to one's WiFi - I await your next instalment
@RalphBacon2 жыл бұрын
That will come, Paul, as I have to do just that!
@fredfreund20962 жыл бұрын
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!
@RalphBacon2 жыл бұрын
Glad it was helpful!
@mail875233 жыл бұрын
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.
@RalphBacon3 жыл бұрын
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!
@webslinger20113 жыл бұрын
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.
@RalphBacon3 жыл бұрын
Sounds great! And it's definitely "borrowed" as it's all Open Source, right?
@webslinger20113 жыл бұрын
@@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.
@DavidHoegen3 жыл бұрын
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?
@RalphBacon3 жыл бұрын
Sounds interesting that other devices responded. I guess you extracted the MAC address of each device you were interrogating?
@DavidHoegen2 жыл бұрын
@@RalphBacon I look at my router and found ESP-XXXX. and used the MAC. I was surprised it worked.
@digihz_data2 жыл бұрын
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.
@RalphBacon2 жыл бұрын
Thanks for sharing!
@melchiorrabie8992 жыл бұрын
@@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.
@daque19603 жыл бұрын
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?
@RalphBacon3 жыл бұрын
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.
@pintokitkat3 жыл бұрын
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?
@jyvben15203 жыл бұрын
yup, had the same, when file copying/moving, left/source to right/destination
@RalphBacon3 жыл бұрын
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.
@Hasitier3 жыл бұрын
Very interesting Ralph. Could also be used if no accesspoint is nearby (in the field or so)
@RalphBacon3 жыл бұрын
In some ways, better than an access point as no SSID or password is required. Ideal for sensors.
@andymouse3 жыл бұрын
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.
@RalphBacon3 жыл бұрын
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).
@gazzacroy3 жыл бұрын
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 :)
@RalphBacon3 жыл бұрын
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.
@gregwmanning3 жыл бұрын
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.
@RalphBacon3 жыл бұрын
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.
@sermadreda3993 жыл бұрын
Great video thank you for sharing
@RalphBacon3 жыл бұрын
Thanks for watching!
@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 Жыл бұрын
That would be my assumption as well.
@jstro-hobbytech3 жыл бұрын
More like Xmas 2120 Ralph. Haha. Great video brother.
@RalphBacon3 жыл бұрын
Glad you liked it Joey. Oh, and Merry Xmas!
@MUHAMMADYAWARIFRAHEEM3 жыл бұрын
Very informative video Sir
@RalphBacon3 жыл бұрын
Thank you, nice to see your here again Muhammad.
@wayne81133 жыл бұрын
Thanks Ralph
@RalphBacon3 жыл бұрын
You're very welcome, Wayne!
@PetRatty3 жыл бұрын
Bit late to the party! Next try OTA via ESP-Now via ESP-Mesh for a device 2 miles away
@RalphBacon3 жыл бұрын
Is this a challenge, Steven? I've got to get OTA working first (using PlatformIO) then I might consider what you suggest. Might. 🤷♂️
@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 Жыл бұрын
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!
@JamesWattMusic10 ай бұрын
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
@rodneytapit56362 ай бұрын
Thanks for good informative video Ralph. Is it possible to use ESP-NOW to send voice from a I2S microphone to a second ESP32?
@RalphBacon2 ай бұрын
No, not really. ESP-NOW is limited to a 256-byte data packet, not a continuous stream. That said, you might be able to send enough packets per second to transmit audio that is clear.
@reelrebellion74863 жыл бұрын
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".
@RalphBacon3 жыл бұрын
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?
@i8BBQ4Lunch8 ай бұрын
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
@RalphBacon8 ай бұрын
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!
@arniep7403 жыл бұрын
What is the distance range over which these boards will communicate? Thanks for another interesting video!
@RalphBacon3 жыл бұрын
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!
@qzorn44402 жыл бұрын
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...:)
@RalphBacon2 жыл бұрын
Glad you liked it and made you appreciate the power of the ESP32!
@lint20233 жыл бұрын
Exciting. Just to understand: ESP NOW is just code and doesn't need specific ESP's to work. Right?
@RalphBacon3 жыл бұрын
Apparently so. It's just a (software) protocol that all ESP's (even ESP8266s) respond to and can understand. Exciting indeed!
@jhunphilipsalar26415 ай бұрын
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?
@RalphBacon5 ай бұрын
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.
@kevingpearce2 ай бұрын
A great video as always Ralph. I've got a couple of unused ESP2-VROOM modules that I'd like to press into service, so I have downloaded your sketches for the ESP32 Tx and Rx. The Tx sketch compiled and uploaded to my board fine. But the Rx sketch will not successfully compile, and throws up the following error: Compilation error: invalid conversion from 'void (*)(const uint8_t*, const uint8_t*, int)' {aka 'void (*)(const unsigned char*, const unsigned char*, int)'} to 'esp_now_recv_cb_t' {aka 'void (*)(const esp_now_recv_info*, const unsigned char*, int)'} [-fpermissive] Why, and what does it all mean ?
@RalphBacon2 ай бұрын
Is that from my sketch or have you modified it? It seems to be complaining that the receive data structure is not what it is expecting. Email me the sketch if you still have issues and I can have a look much more easily than trying to do it here! (Email address is in my about page on the channel, only visible on a PC, not a phone).
@RalphBacon2 ай бұрын
OK, got your email and understand that downgrading the ESP framework (eg from 3.0.0 to 2.0.14) solved it for you. This is an ongoing problem with the new Espressif Arduino framework using the newer IDF (Espressif framework) APIs. OLD ESP-NOW callback function: void OnDataRecv(const uint8_t *mac, const uint8_t *incomingData, int len) {... your code...} NEW ESP-NOW (Framework 3.0) callback function: void onDataRecv(const esp_now_recv_info_t *info, const uint8_t *incomingData, int len) {... your code...} If you used to access the (old) first parameter of the sender's MAC address, you can get that now from the 'info' parameter pointer thus: info->src_addr although you will have to convert the octets into printable bytes as we always have had to.
@tabmaryland23332 ай бұрын
@@RalphBacon Thank you both!!! I just started working with ESP-NOW and I was very frustrated with this invalid conversion error. Have a great day!
@veedonfleece36943 жыл бұрын
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?
@RalphBacon3 жыл бұрын
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.
@jyvben15203 жыл бұрын
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)
@RalphBacon3 жыл бұрын
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).
@awuk34683 жыл бұрын
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?
@RalphBacon3 жыл бұрын
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.
@mouaadhyaichi8422 жыл бұрын
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
@RalphBacon2 жыл бұрын
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.
@jijeshkorothpoyil26979 ай бұрын
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
@RalphBacon9 ай бұрын
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
@georgefriday48723 жыл бұрын
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.
@RalphBacon3 жыл бұрын
Hmm, I'll add it to the list!
@gazzacroy3 жыл бұрын
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 :)
@RalphBacon3 жыл бұрын
Sounds great. As the instigator of this project, thanks to your comment, I thank you! I wonder why I never heard of it before?
@gazzacroy3 жыл бұрын
@@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 :)
@WILDMACK2 жыл бұрын
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.
@RalphBacon2 жыл бұрын
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?
@WILDMACK2 жыл бұрын
@@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…
@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 Жыл бұрын
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 Жыл бұрын
@@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
@YigalBZ2 жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@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.
@whatwhatdidtheysay...lyric23732 жыл бұрын
Can this be used between MIXED MCU ... from ESP8266 to ESP32 and vice versa?
@RalphBacon2 жыл бұрын
Indeed you can, I thought I'd demoed this in the video? Perhaps I dreamed it. But it does work.
@whatwhatdidtheysay...lyric23732 жыл бұрын
@@RalphBacon HAHAHA Sorry Ralph. I will watch it again. Thanks for the response!
@Harry-li1fx Жыл бұрын
Can I send accelerometer data values using espnow
@RalphBacon Жыл бұрын
Yes, you can but you do not want to flood the receiver (it runs code on each packet received).
@josephdaniel78903 жыл бұрын
Hi sir please post more videos
@RalphBacon3 жыл бұрын
Will upload soon!
@yogeshitaliya4733 жыл бұрын
😍😍😍
@RalphBacon3 жыл бұрын
Hey, Yogesh, nice to see you here!
@thenextproblem80013 жыл бұрын
No Arduino time please 🥺. Can't wait to talk both network
@RalphBacon3 жыл бұрын
Hmm, I couldn't agree more.
@MandoRick1978 Жыл бұрын
Great info, cheers. You tried the DS18B20 probe?
@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.
@MPElectronique3 жыл бұрын
Whats the max distance between the esp's ?
@RalphBacon3 жыл бұрын
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.
@sciencearoundus2 жыл бұрын
Is it possible to use a single esp as slave and gate way?
@RalphBacon2 жыл бұрын
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?
@sciencearoundus2 жыл бұрын
@@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
@RalphBacon2 жыл бұрын
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?
@sciencearoundus2 жыл бұрын
@@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_law2 жыл бұрын
@@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.
@rajeshpanigrahi9654 Жыл бұрын
Can you give me the code for ESP8266 transmitter ?
@RalphBacon Жыл бұрын
I'm not using ESP8266 at all for ESP-NOW, always an ESP32.
@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? :-)
@JamesWattMusic10 ай бұрын
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
@dave-in-nj93933 жыл бұрын
what is scary is the idea that the manufacture put in a communication that is below our awareness or our control.
@RalphBacon3 жыл бұрын
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?
@NomenNescio993 жыл бұрын
Why did my comment about esp now got removed?
@colinpamplin99763 жыл бұрын
Mine did too, strange
@RalphBacon3 жыл бұрын
@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 ...
@RalphBacon3 жыл бұрын
@Colin Pamplin Sorry, Colin, I can't find any reference to your comment, it's not awaiting moderation or anything. KZbin technology failing us, by the looks of it.
@NomenNescio993 жыл бұрын
@@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!
@colinpamplin99763 жыл бұрын
@@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
@tenminutetokyo26433 жыл бұрын
DOOD!
@RalphBacon3 жыл бұрын
Cool!
@fillempie15013 жыл бұрын
hmmmm how about spoofing?
@RalphBacon3 жыл бұрын
The connections can be _encrypted_ so I'm hoping that no-one could eavesdrop on the data (or MAC address).
@fillempie15013 жыл бұрын
@@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 :)
@kozlovskyi2 жыл бұрын
Arduino is not user friendly. Free rtos is!
@RalphBacon2 жыл бұрын
I suspect (although I could be wrong) that the millions of Arduino users out there happily making stuff would disagree with you! 😂
@zyghom2 жыл бұрын
completely opposite: rtos is powerful but arduino is friendly ;-)
@MandoRick1978 Жыл бұрын
Trolling like a champ.
@luisdelgado15172 жыл бұрын
someone, can you help me, with the library or document.h like esp_now.h? I don't find it
@RalphBacon2 жыл бұрын
They are part of the ESP32/ESP8266 framework. See Rui Santos' description here: randomnerdtutorials.com/esp-now-esp32-arduino-ide/
@luisdelgado15172 жыл бұрын
@@RalphBacon thanks Ralph S Bacon for your helping