View All Posts
read
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi

Learn about the real-world range of ESP-Now devices, with experiments showing a range of up to 500 meters using long-range mode in outdoor settings. Discover the trade-off between range and bandwidth and analyze the data collected during walk tests.

Related Content
Transcript

[0:00] It’s finally here - after months of teasing - I’ve actually finished a video on the range of ESP-Now
[0:06] We’ve got some really interesting results.
[0:09] But first, I’d like to thank PCBWay for sponsoring the channel. PCBWay offer PCB Production,

[0:15] CNC and 3D Printing, PCB Assembly and much much more. They are great to deal with and

[0:21] offer excellent quality, service and value for money. Check out the link in the description.
[0:28] So, what is the real-world range of ESP-Now?

[0:32] This question came up a lot in response to the walky-talky project.
[0:36] You’d think this would be a simple question to answer,

[0:38] but I think it’s actually pretty complicated.
[0:41] There are 3 things that we need to define before we can start:
[0:45] What are the test conditions?
[0:47] What equipment should we use?
[0:49] And, what does it even mean to be in range?
[0:52] Once we’ve answered these questions
[0:54] We then need to work out how we’re actually going to do the testing.
[0:58] Let’s break the questions down into a bit more detail and try and answer them
[1:02] What are the test conditions?
[1:04] Is it indoor going through multiple walls?
[1:07] Or, is it outdoor?
[1:09] Do we have a direct line of sight
[1:10] or are there trees and other things in the way?
[1:13] I’ve decided to do an outdoor test
[1:16] I’m not sure there’s too much value in trying to do an indoor test.
[1:19] Everyone’s house is different.
[1:20] I could say “I’ve got coverage in the kitchen, bathroom and bedroom”
[1:24] but that doesn’t really mean anything to anyone else.
[1:27] Everyone has a different shaped house and everyone has different walls and construction.
[1:33] We look out on a very convenient bit of open space
[1:36] and have a handy balcony to place the base station on.
[1:38] So an outdoor test is going to be quite straightforward to perform.
[1:42] We’ll have some trees in the way and a couple of fences.
[1:45] But that will be a good test of the “real world” range…
[1:50] On to the next question
[1:51] What equipment should we use?
[1:53] Just looking around my desk I can see at least 5 different ESP32 devices
[1:58] and if I looked through my boxes I’d probably get 10-20 different ones
[2:02] including some of my own custom boards…
[2:05] Do we want to use an external antenna in our tests?
[2:08] Or do we want to build some crazy antenna amplifier using pringle cans?
[2:12] Or should we just stick to a standard PCB antenna?
[2:16] I’ve chosen what’s convenient for me.
[2:18] For the mobile station, I’m using a TTGO display

[2:22] this makes it easy for me to check that everything is functioning correctly while I’m doing the test.
[2:27] For the base station, I’m using a TinyPico - this isn’t driven by any particular reason,

[2:33] it was just conveniently on my desk when I was testing the code.
[2:37] Neither of these devices supports an external antenna
[2:40] and I think that using the built-in antennas is a more realistic real-world test.
[2:45] I’m going to be powering both of these devices with USB power banks.
[2:49] Finally, our last question
[2:51] What does it even mean to be in range?
[2:54] I’m going to answer this question with another question:
[2:58] What is an acceptable packet loss for your project?
[3:01] Do you need completely reliable communication?
[3:04] Or are you happy with a lot of packets being lost and retransmitted?
[3:08] Are you with the range if you transmit 100 packets and one of them gets through?
[3:13] Or do you need 100% of my packets to get through?
[3:17] In this experiment, I’m going to try and generate the data needed

[3:20] to give you an idea of what you can expect at different distances.
[3:25] So, onto the last part
[3:27] how am I going to do it?
[3:30] Most of these questions came from the walky-talky project
[3:32] which was streaming audio data at around 64 packets per second.
[3:37] I’m going to recreate this but in a more controlled way.
[3:40] I’m going to create base station that will broadcast packets 64 times a second.

[3:45] I’ll then track how many of these packets the mobile station receives.

[3:49] From this, we can work out how many packets have been lost.
[3:53] I’ll be using the broadcast mode of ESP-Now
[3:56] so the base station will just be sending packets out without any acknowledgements or retransmissions.
[4:02] For the mobile station, I’ve equipped it with a GPS and an SD Card for logging the data.

[4:07] I’ve got videos on how to hook up both of these to an ESP32 on the channel.
[4:12] We’ll record the location along with the packet loss every second
[4:16] and then process this data to work out the distance from the base station
[4:22] For the base station things are lot a simpler - we just need the ESP32 board
[4:28] and a USB power bank so that it can be put on the balcony.
[4:31] With all this in place we can move onto the actual testing.
[4:35] I’ve gone out for a walk over the past couple of mornings
[4:38] with the mobile station in my backpack and collected a bunch of data.
[4:42] This is real-world data sometimes I am walking towards the base station,

[4:45] sometimes away or walking past
[4:48] I’ve tried to get a few different angles to give the mobile station the best possible chance to pick up packets.
[4:54] With the data collected and analysed, we get some interesting results.
[4:59] We can get some packets through up to around 320 meters away
[5:03] this is a pretty amazing result.
[5:05] I’m not saying very many packets will get through
[5:08] but under ideal conditions you will get some data transmitted.
[5:12] 320 meters seems to be the cut-off point between getting some data through

[5:16] and receiving no packets.
[5:18] Beyond that point, we no longer detect any data.
[5:22] We can look at the data in more detail
[5:25] I’ve plotted the distributions of packet loss over a set of distances.
[5:29] 0-50 meters you are very likely to get 100% of your packets delivered
[5:34] but if you are unlucky or behind a tree you may lose 40 to 60 percent of your data.
[5:40] 50 to 100 meters we’ve still got reasonable coverage
[5:44] but you are less likely to get 100% packets received
[5:48] and you’re more likely to get around 30% packet loss.
[5:51] As we increase the distance it’s more and more likely that we’ll get 100% packet loss and no data will be received
[5:58] until we finally reach the point where all packets are lost and you won’t receive any data.
[6:05] Now there is something interesting that requires a bit further investigation
[6:10] there’s a couple of cryptic lines of code in the esp-idf examples.
[6:15] Using WIFI_PROTOCOL_LR will switch the ESP device into long-range mode.
[6:21] However, this does come at the cost of bandwidth.
[6:26] I’ve turned this option on in both the base station and the mobile station
[6:30] and done another walk tests to see if it makes any difference.
[6:34] Amazingly, we can now receive packets up to 500m away from the basestation!
[6:39] Given that there are trees and all sorts of things getting in the way this is a fantastic result.
[6:44] However, we are trading off range for bandwidth.

[6:47] I’ve set up a simple experiment on my desk to test out what the bandwidth is.
[6:52] I’ve set things up so that I’m transmitting packets as quickly as possible.
[6:56] As soon as a packet is sent, I send another one.
[6:59] On the receiving side, I’m logging how many packets come in per second.
[7:04] With standard ESP-Now setup
[7:06] I get a throughput of around 320 packets per second which works out at about 0.6Mbits/s.
[7:13] With long-range mode enabled I get a throughput of around 95 packets per second

[7:18] which works out at about 0.2Mbits/s.
[7:22] So we get about a third of the throughput when we’re running in long range mode
[7:25] So there’s definitely a trade off in switching over to this mode.
[7:31] That’s it for this video
[7:33] it looks like you can achieve over 500m range with ESP-Now
[7:37] which I find absolutely amazing.
[7:38] With good antennas and line of sight without any obstructions,
[7:42] I think you could extend this even more.
[7:45] Anyway, I hope you found it interesting,

[7:47] if you did then please hit the subscribe button. There are more videos in the pipeline.
[7:51] Thanks for watching and I’ll see you in the next video!


HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
Blog Logo

Chris Greening

> Image

atomic14

A collection of slightly mad projects, instructive/educational videos, and generally interesting stuff. Building projects around the Arduino and ESP32 platforms - we'll be exploring AI, Computer Vision, Audio, 3D Printing - it may get a bit eclectic...

View All Posts