If you’ve ever worked with the ESP32 or ESP8266, you probably know they’re absolute powerhouses for DIY IoT projects. But did you know they can talk to each other without Wi-Fi or Bluetooth? That’s where ESP-NOW comes in—and it’s honestly one of the coolest features I’ve come across.
ESP-NOW is a fast, low-power, and connectionless communication protocol developed by Espressif. It’s perfect for scenarios where you want ESP boards to exchange small bits of data directly—think sensor networks, remote controls, or smart home devices that just need to “say something” and move on.
In this guide, I’ll walk you through everything I’ve learned about ESP-NOW, from how it works, to setting it up, to writing your own sender/receiver code. If you’re building a project where power efficiency and low-latency comms are critical, you’re going to love what ESP-NOW can do.
Let’s dive in!
2. What is ESP-NOW?
ESP-NOW is a wireless communication protocol developed by Espressif, and it’s available on both ESP32 and ESP8266 boards. Unlike traditional Wi-Fi or Bluetooth connections, ESP-NOW is connectionless—which means devices can send data to each other without the time-consuming process of pairing or joining a network.
At its core, ESP-NOW uses MAC addresses to send data directly from one ESP device to another. Each device has a unique MAC address, and once you’ve registered the destination address as a “peer,” you can send messages in a blink.
One of the things I really like about ESP-NOW is how lightweight it is. There’s no need to maintain a full Wi-Fi connection just to push a few bytes of sensor data. That makes it perfect for low-power projects, especially when you’re working with batteries and want your device to sleep most of the time.
To give you a quick idea:
- It supports one-to-one, one-to-many, and even many-to-many communication setups.
- You can send data packets of up to 250 bytes.
- It even supports encryption if you need to secure your data.
Think of it as walkie-talkie-style comms for your ESP boards—quick, simple, and super efficient.
3. Key Features of ESP-NOW
Once I started using ESP-NOW, I was genuinely impressed by how capable it is—especially for such a lightweight protocol. Here are the main features that make it a fantastic option for ESP-based communication:
Connectionless Communication
This is one of the big wins. ESP-NOW doesn’t require a Wi-Fi router or network. Devices just need each other’s MAC addresses to talk. It’s like handing someone a walkie-talkie and instantly starting a conversation—no “joining the network” ceremony needed.
Low Latency
The data transmission is nearly instant. We’re talking under 10 milliseconds in most cases. For applications like motion detection, instant button presses, or real-time sensor updates, this is gold.
Low Power Consumption
Because you skip all the connection overhead (like DHCP, DNS, etc.), your ESP device can stay in deep sleep most of the time. Wake up, send a message, go back to sleep. Perfect for battery-powered projects.
Optional Encryption
ESP-NOW supports AES-128 encryption, so your data isn’t just flying around unprotected. You can choose whether you want to encrypt the communication with each peer. It’s great to have the option, especially if you’re sending sensitive data (like door sensor states or user inputs).
Supports Many Peers
You can communicate with up to 20 peers (unencrypted) or 10 peers (encrypted) from a single ESP device. That gives you plenty of flexibility for sensor networks or distributed smart systems.
Can Work Alongside Wi-Fi
This one surprised me. On ESP32, you can use ESP-NOW and Wi-Fi at the same time. So, one device can collect data via ESP-NOW from a bunch of other ESPs, then upload it to the internet over Wi-Fi. That’s perfect for a gateway setup.
Overall, ESP-NOW gives you a lot of power in a tiny, efficient package. It’s like a minimalist’s dream come true for IoT communication.
ESP-NOW Architecture
Understanding how ESP-NOW works under the hood really helped me plan better for my own projects—especially when dealing with multiple devices. The good news? It’s actually pretty simple once you break it down.
Device Roles: Sender, Receiver, or Both
In an ESP-NOW network, any ESP device can be a sender, receiver, or both. There’s no strict master/slave setup like in some other protocols.
You can have:
- One ESP32 sending data to another
- One device sending data to multiple receivers
- Several ESPs all sending data to a central node (common for gateways)
It’s all based on peer-to-peer communication.
MAC Addresses are the Key
Every ESP board has a unique MAC address, and ESP-NOW uses these to route messages.
Before one device can send data to another, it needs to register the peer using its MAC address. You can think of this like adding a contact in your phone before you can send them a message.
ESP-NOW also lets you set whether that peer requires encryption and define the communication channel if needed.
Data Flow
Here’s the basic flow of how things work:
- Sender initializes ESP-NOW and adds the peer’s MAC.
- Sender builds the data packet (up to 250 bytes).
- Sender transmits it using
esp_now_send()
. - Receiver listens and reacts via a callback function.
It’s efficient and low-overhead, which makes it a great fit for real-time or battery-sensitive applications.
Bi-Directional Support
Even though the setup might sound one-way at first, ESP-NOW is fully capable of two-way communication. Both devices just need to register each other as peers. This opens the door to handshaking, acknowledgments, or control commands.
Custom Channels (Advanced)
By default, ESP-NOW uses the same Wi-Fi channel your board is currently on. But if you want more control (say, to avoid interference or segment your network), you can manually set the communication channel.
This can get a bit tricky if you’re combining ESP-NOW with Wi-Fi, since they need to operate on the same channel to coexist. But it’s doable, and I’ve used it in setups where my gateway is collecting ESP-NOW data and uploading it via MQTT over Wi-Fi.
So in a nutshell: you define peers, send packets, and listen via callbacks. It’s like building your own lightweight, private communication network—without needing routers or complicated setups
Probably the Best Books to Learn ESP32
If you’re serious about diving deeper into the world of ESP32 and building more advanced projects, a good book can make all the difference. Here are a few well-rated resources that are worth checking out:
- Programming the ESP32 – A comprehensive hands-on guide
- Internet of Things Projects with ESP32 – Real-world applications using sensors and cloud services
- MicroPython with ESP32 and ESP8266 – For those who prefer Python over Arduino
Whether you’re just getting started or looking to level up your skills, these books are packed with practical examples and clear explanations. Definitely worth having on your workbench.
5. ESP-NOW vs Wi-Fi vs Bluetooth
When I first discovered ESP-NOW, I wasn’t sure how it stacked up against the “usual suspects” like Wi-Fi and Bluetooth. But after testing it in a few real-world projects, I started to see where each one shines.
Here’s a quick comparison to help you decide when ESP-NOW might be the right tool for the job:
Feature | ESP-NOW | Wi-Fi | Bluetooth |
---|---|---|---|
Power Usage | ✅ Very Low | ❌ High | ✅ Medium |
Latency | ✅ Very Low | ❌ Higher | ✅ Low |
Requires Router? | ❌ No | ✅ Yes (usually) | ❌ No |
Range | ✅ Medium (up to ~100m) | ✅ Medium (depends on setup) | ❌ Short (~10m) |
Max Data Rate | ❌ Low (~250 bytes per packet) | ✅ High (MBs per sec) | ✅ Medium |
Network Complexity | ✅ Simple (MAC-based) | ❌ Complex (IP, DHCP) | ✅ Moderate |
Encryption | ✅ Optional AES-128 | ✅ WPA2+ | ✅ Built-in |
Internet Access | ❌ Not directly | ✅ Yes | ❌ No |
Multi-Device Support | ✅ Yes (up to 20 peers) | ✅ Yes (via router) | ✅ Limited |
So, When Should You Use ESP-NOW?
Choose ESP-NOW if:
- You want fast and efficient communication between ESP devices.
- You’re building a battery-powered sensor or controller.
- You don’t want to deal with Wi-Fi connections or routers.
- Your devices are all in local range (like inside a home or garden).
Stick with Wi-Fi if:
- You need to send data to the cloud or internet.
- Your project requires large amounts of data.
Use Bluetooth if:
- You’re dealing with mobile phones or need compatibility with common consumer devices.
- You want close-range communication with low complexity.
ESP-NOW fills a nice gap between Wi-Fi and Bluetooth—it’s more direct and energy-efficient than Wi-Fi, but with longer range and better throughput than standard Bluetooth.
6. Getting Started with ESP-NOW
Alright, time to get our hands dirty. If you’re itching to try ESP-NOW on your own hardware, the setup is pretty straightforward—and you’ll be sending wireless messages in no time.
What You’ll Need
To follow along, you’ll need at least two ESP boards. I personally tested with:
- ESP32 DevKit v1 – works great
- ESP8266 NodeMCU – also supported (though with some limitations)
You can even mix ESP32 and ESP8266 boards in the same ESP-NOW network, which is pretty cool.
Setting Up the Arduino IDE
If you haven’t already set up the Arduino IDE for ESP32 or ESP8266, here’s a quick refresher:
For ESP32:
- Open the Arduino IDE.
- Go to File > Preferences.
- In the “Additional Board Manager URLs” field, add this:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
- Go to Tools > Board > Board Manager, search for “ESP32,” and install it.
For ESP8266:
Use this URL instead:
http://arduino.esp8266.com/stable/package_esp8266com_index.json
Then install the ESP8266 platform from the Board Manager.
Install Required Libraries
The good news? ESP-NOW is built-in to the ESP32 and ESP8266 Arduino cores. You don’t need to install any special libraries—just include <esp_now.h>
and you’re good to go.
But if you’re using the ESP-IDF, there’s a different setup, which I’ll cover in a future post. For now, we’re sticking with the Arduino IDE for simplicity.
Double Check Your Boards
Make sure both your boards are:
- Properly connected to your PC via USB
- Showing up in Tools > Port
- Flashable from the Arduino IDE
Once that’s done, we’re ready to start writing code—and that’s exactly what we’ll cover next.
7. Step-by-Step Code Example
When I first tested ESP-NOW, I started with the simplest case: send a message from one ESP32 to another, then watch it appear in the Serial Monitor. It’s a great way to confirm everything’s working before building more complex logic.
#include <esp_now.h>
#include <WiFi.h>
// Replace with the receiver's MAC address
uint8_t receiverMac[] = {0x24, 0x6F, 0x28, 0xAA, 0xBB, 0xCC};
typedef struct message {
int value;
} message;
message outgoingData;
void OnDataSent(const uint8_t *mac_addr, esp_now_send_status_t status) {
Serial.print("Delivery status: ");
Serial.println(status == ESP_NOW_SEND_SUCCESS ? "Success" : "Fail");
}
void setup() {
Serial.begin(115200);
WiFi.mode(WIFI_STA); // Set to station mode
WiFi.disconnect(); // Just in case
if (esp_now_init() != ESP_OK) {
Serial.println("ESP-NOW init failed!");
return;
}
esp_now_register_send_cb(OnDataSent);
esp_now_peer_info_t peerInfo = {};
memcpy(peerInfo.peer_addr, receiverMac, 6);
peerInfo.channel = 0;
peerInfo.encrypt = false;
if (esp_now_add_peer(&peerInfo) != ESP_OK) {
Serial.println("Failed to add peer");
return;
}
outgoingData.value = 42; // Example data
}
void loop() {
esp_now_send(receiverMac, (uint8_t *)&outgoingData, sizeof(outgoingData));
delay(2000); // Send every 2 seconds
}
Receiver Code (ESP32 #2)
#include <esp_now.h>
#include <WiFi.h>
typedef struct message {
int value;
} message;
message incomingData;
void OnDataRecv(const uint8_t *mac, const uint8_t *incomingDataBytes, int len) {
memcpy(&incomingData, incomingDataBytes, sizeof(incomingData));
Serial.print("Received value: ");
Serial.println(incomingData.value);
}
void setup() {
Serial.begin(115200);
WiFi.mode(WIFI_STA);
WiFi.disconnect();
if (esp_now_init() != ESP_OK) {
Serial.println("ESP-NOW init failed!");
return;
}
esp_now_register_recv_cb(OnDataRecv);
}
void loop() {
// Nothing needed here — data comes via callback
}
What’s Happening
- Sender setup:
- Initializes ESP-NOW.
- Registers the receiver as a peer.
- Sends a simple
int
value every 2 seconds.
- Receiver setup:
- Listens for any incoming messages.
- When data arrives, a callback is triggered and prints it to Serial.
You can easily modify the message
struct to send other types of data—floats, booleans, or even small strings (within the 250-byte limit).
Tips:
- Make sure the MAC address in the sender matches the actual MAC of your receiver. You can print it with:
Serial.println(WiFi.macAddress());
- If you see a “failed to add peer” error, try resetting both boards and double-check the MAC format.
8. Common Use Cases for ESP-NOW
After playing with ESP-NOW on a few test benches, I realized how versatile it actually is. It’s especially handy for projects where simplicity, speed, and power efficiency matter more than internet access or high data throughput.
Here are some real-world scenarios where ESP-NOW feels right at home:
Sensor Networks
One of the most obvious and practical uses is wireless sensor networks. Imagine a bunch of ESP32s scattered around your house or garden, each collecting data—temperature, humidity, soil moisture, motion detection—and sending it to a central node via ESP-NOW.
Since ESP-NOW is fast and low-power, these sensors can wake up, send their readings, and go right back to sleep. Perfect for battery-operated setups.
Remote Controls and Buttons
Need to build a wireless remote to control lights, relays, or other devices? ESP-NOW is perfect for that. You can avoid the pairing complexity of Bluetooth or the overhead of Wi-Fi. Just press a button, and the signal is instantly sent to a receiver.
I built a simple ESP32 button that controls multiple devices in my workshop—zero lag and no Wi-Fi required.
Home Automation Systems
If you’re building a smart home on a local network, ESP-NOW lets you create a private mesh-like system where ESP boards talk to each other directly. Light sensors trigger blinds, door sensors ping your main controller, motion sensors send alerts—all without needing the cloud.
Pair it with a central node that uploads data to the internet (via Wi-Fi), and you’ve got a hybrid local+cloud setup.
Device-to-Device Communication
Need two ESPs to sync states or mirror behavior? ESP-NOW is great for keeping devices in sync. For example:
- Two LED strips lighting up in sync
- A motor controller that responds to input from another ESP
- One device acting as a heartbeat monitor for another
It’s just really handy when you want ESPs to stay in touch without adding Wi-Fi overhead.
Battery-Powered Projects
This one’s huge. Since ESP-NOW eliminates the need to connect to Wi-Fi, you save significant power. ESP devices can spend most of their time sleeping, then briefly wake up just long enough to send or receive data.
I once ran a motion sensor node using ESP-NOW on a single 18650 battery for several months. That would’ve been much harder using a standard Wi-Fi connection.
These are just a few ideas to get you started. Once you see how easy and flexible ESP-NOW is, it opens up a ton of possibilities—especially in environments where traditional network infrastructure isn’t practical or needed.
9. Tips, Limitations & Troubleshooting
While ESP-NOW is powerful and surprisingly easy to work with, it does have a few quirks and limitations that are worth knowing. I learned some of these the hard way, so hopefully this section saves you a few hours of head-scratching.
Packet Size Limit
ESP-NOW messages are capped at 250 bytes per packet. If you try to send more than that, the data will be truncated or fail to send.
Tip: If you need to transmit more data, break it up into smaller chunks manually or consider combining ESP-NOW with another protocol like MQTT over Wi-Fi for larger payloads.
Limited Number of Peers
- You can add up to 20 unencrypted peers
- Or up to 10 encrypted peers
If you’re building a large network, keep this in mind when designing your topology. You can always rotate peers dynamically in code if needed, but that adds some complexity.
Channel Considerations
ESP-NOW operates on the same channel as Wi-Fi. If you’re using ESP-NOW with Wi-Fi, both must use the same channel, or communication won’t work.
Tip: Lock your Wi-Fi access point to a specific channel (e.g., channel 6), and manually set that channel when initializing ESP-NOW.
Encryption Quirks
Encryption works great—but it only supports AES-128 and requires a shared key between peers. You’ll also need to stick to the 10-peer limit when encryption is enabled.
Also, encryption must be set up before sending any data. You can’t toggle it dynamically without reinitializing.
No Acknowledgments by Default
ESP-NOW sends messages, but unless you build in a reply system, there’s no built-in acknowledgment that it was received.
Tip: If reliability is important (e.g., for a door lock or alarm), have the receiver send back a “got it” message, and retry from the sender if nothing comes back.
Needs Stable Power for Wi-Fi Radios
Sometimes you’ll get weird behavior—like failed transmissions or ESPs rebooting—if your board isn’t getting enough power. This especially applies to ESP32 boards with Wi-Fi or ESP-NOW active.
Tip: Power your board from a solid 5V USB source or a well-regulated battery pack, not just from a flaky USB port.
Common Issues & Fixes
Problem | Likely Cause | Solution |
---|---|---|
ESP_ERR_ESPNOW_NOT_INIT | ESP-NOW wasn’t initialized | Check esp_now_init() in setup |
Messages not arriving | Wrong MAC address or peer not registered | Double-check MACs and peer registration |
Random resets | Power issues | Try a different USB cable or power source |
Only working once | Peer not registered again after deep sleep | Re-add peer after wake-up in code |
The more you work with ESP-NOW, the more comfortable you’ll get with its quirks. And honestly, once you get past the initial learning curve, it becomes one of the most useful tools in your ESP toolbox.
10. Conclusion
ESP-NOW might not get as much attention as Wi-Fi or Bluetooth, but once you understand what it offers, it becomes an incredibly valuable tool in your IoT toolbox. It’s fast, efficient, and reliable—especially for projects where low power and real-time communication matter.
Whether you’re building a sensor network, a remote control system, or a simple device-to-device link, ESP-NOW gives you the ability to skip the network overhead and focus on what really matters: fast, local communication between devices.
In this guide, we covered:
- What ESP-NOW is and how it works
- Key features and why it’s different from Wi-Fi and Bluetooth
- How to set it up with ESP32 and ESP8266
- A full sender/receiver example using the Arduino IDE
- Real-world use cases and common pitfalls
That said, ESP-NOW isn’t the only way to make ESP devices talk to each other.
If you’re exploring different communication methods, you might also enjoy these two alternative approaches:
- How Two ESP8266 Boards Can Talk to Each Other – covers standard Wi-Fi-based communication techniques.
- Using Blynk Bridge: Another Way to Communicate Between Two ESP8266 – for those building cloud-connected projects using the Blynk platform.
Each method has its own strengths depending on your project needs—whether you’re working locally, remotely, or somewhere in between.
If you found this guide helpful, stay tuned for more on ESP-NOW + Wi-Fi hybrid setups and other ESP32/ESP8266 tutorials right here on tinkeriot.com.
Happy building—and as always, keep tinkering!
2 thoughts on “ESP-NOW: The Ultimate Guide to Fast, Low-Power Communication with ESP32 & ESP8266”