[Jeija] was playing with some ESP32s and in true hacker fashion, he wondered how far he could pull them apart and still get data flowing. His video answer to that question covers the Friis equation and has a lot of good examples of using the equation, decibels, and even a practical example that covers about 10km. You can see the video below.
Of course, to get that kind of range you need a directional antenna. To avoid violating regulations that control transmit power, he’s using the antenna on the receiving end. That also means he had to hack the ESP32 WiFi stack to make the device listen only on one side. The hack involves putting the device in promiscuous mode and only monitoring the signals being sent. You can find the code involved on GitHub (complete with a rickrolling application).
Of course, antennas are nothing new–look at all the Pringle can antennas we’ve seen in the past. However, the use of a long range receive-only module is interesting and we can see this technique having applications to remote drone video or telemetry and — of course — wardriving. If you don’t have a big boss antenna lying around, you might try some duct tape. If you want a more detailed refresher on decibels, we did that last month.
31 thoughts on “ESP32 WiFi Hits 10km With A Little Help”
rite on, , i have done 1 Km. not quite the antenna you have, but i will make one. cheers, very good video
What’s the useful range without a special antenna? By useful I mean reliable, not necessarily fast. I need to send short asynchronous messages, maybe MQTT. I don’t need fast, I need it to work well.
Whenever I want no messing range, I lock stuff on one of the low speed b modes.
Or he could get a ham license and go wild on 2390-2450mhz where he would have tx privilege even with higher tx power. The license is easy and opens up plenty of opportunities for experimentation (legally even). I know I’ve had fun with mine so far. It even caused me to be a bit “old school” and pickup a HF radio. Now I just need to finish setting it all up with the PC and building another antenna for the 2m/70cm radio I just picked up (partially for playing with satellites).
As a ham myself (US Extra, Swiss HB9), I can see how using the amateur bands may be problematic: one would need to periodically identify the transmitter and ensure that no encrypted communications take place. Hardly insurmountable obstacles, but still a bit of a pain compared to just using a bigger antenna for the receiver and using (mostly) standard WiFi.
That said, HF stuff is fun. I’m not so keen on voice modes, but digital modes like JT65, JT9, and WSPR are both amazing and near-magical. I made a contact from central Switzerland to Tierra Del Fuego in southern Argentina using 10W and a random-wire antenna tied to a rock and tossed out of my apartment window using JT9. Incredible.
I’d presume you could do that by setting the SSID to your callsign and turning off everything apart from maybe mac address authentication.
What about public key signing? The content of messages sent would still be in the clear and anyone can verify if the message is authentic by using the public key. But a hacker, without access to the private key, would not be able to generate fake messages that pass the test.
Shakespereian encryption. Encrypt your true message and convert it into ascii format, take one of his plays, use sonnets to represent individual ascii characters, convert asciis to sonnets, transmit the various sonnets, receiver reverses the process. Sonnet to ascii to decrypted file. To any listener it’s just poetry. Slower though. Maybe just use stanzas.
Signing is allowed as it doesn’t conceal the message.
So many ways of identifying himself SSID or even just burning it into the video stream
If you want to this right, you also need to modify the timing, otherwise the transmitter will time out waiting for the ACK packets.
Here in Australia, you’re allowed 4W ERP (36dBm) before you need a license. In this case a 24dBi antenna is in use, here you could safely transmit at ~15.8mW (12dBm) before you exceeded that limit assuming no-loss feedline.
How many km would that get you?
Nowhere if there’s a hill in the way. I’d have to look up the specifications on the ESP32 module in use to see what transmit power those things do.
The actual km is less relevant than the mean distance between castles in Australia.
I used to help in a West Australian wireless freenet and we were regularly achieving up to 10 to 15km links using regular 30dBm transmitters and 24dBi antennas at each end. With clear line of sight and low noise floor our record was about 18 to 20km.
And most Coax cables actually have very high losses at 2.4Ghz. So make sure you compensate for that if it’s more than a metre or so.
That actually helps in this case… means the output will still be within the legal limit.
The way around this of course is to have the pre-amp/power-amp right at the base of the antenna, then the loss will be minimal.
I wonder if anyone had problems because he used high-gain antenna with his WiFi module. My former ISP used USB WiFi modems with custom antennas to achieve line of sight range of 3-5km. They had no problems even if they exceeded ERP limits. They were closed when police discovered they were a money laundering firm belonging to local mafia…
I know of a bunch of people doing long range WiFi (in the time of 11Mbit max., mid to end 1990ies) commercially as some sort of ISP up to several 10s of km, I think up to 70km. They used satellite dishes (mounted upside down) and some of them were on a big observation tower (also used for other radio services). Of course they had some modules “for high gain antenna operation” (with reduced transmit power), but preferred to use the normal ones as they were cheaper (and had more power :-) ). They did not really close but lost their business case when normal broadband access got cheaper and cheaper.
I’ve gotten 60mW XBee modules to work over 2km, I’m pretty sure that was more the protocol than the radios though.
Need to test more…
A combination of both… XBee works at a lower bit rate, so more energy per bit.
Not a suprise. get a set of 10 foot dishes and mount the devices at the focal point and get even higher gain. BUT you have to keep objects out of the Fresnel zone to get the full gain.
The distance isnt that much, although only having a decent gain antenna on RX makes it much harder.
I used to work in the region and it was more interesting to see the area… The grub at the Neuffen is good ;-)
No comments about the Ubuntu backpack?
What about this Minecraft clone Jeija contributed to by creating mesecons (redstone-like stuff with in-game microcontrollers)?
I’m a bit confused because the USA FCC limits are 1 Watt for the power and 6dB for the antenna. Here a 24dB antenna is used on either end, producing 16 times the distance of two legal antennas. If this system were done legally in the US the distance would be closer to about 10/16 km which is like about 0.385 km! Or am I missing something?
Receive antenna can be as much gain as you want, only transmit antenna is limited.
As a follow up to my previous comment, -6dB antenna gain is half the distance, right? so 24dB – 3*6dB = 6dB, so it’s 1/8 the distance per antenna, or 1/64 the total distance with USA legal antennas? 10/64 km is about 156 meters. Is that closer to the right answer? It’s been a loooong time since college telecom class! :)
I think he’s better off using an nrf24L01 PA for this since he’s doing one way comms anyway. I’ve been doing some experiments with long range modules too.
What about LoRa? Lower data rate, longer range, available hardware. Hmmm…
Please be kind and respectful to help make the comments section excellent. (Comment Policy)