Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home IoT & Smart Home

ESP-NOW Tutorial: Wireless Communication Between ESP32 Boards

ESP-NOW Tutorial: Wireless Communication Between ESP32 Boards

March 11, 2026 /Posted byJayesh Jain / 0

ESP-NOW is one of the most underrated features of Espressif’s ESP32 and ESP8266 microcontrollers — a lightweight, connection-free wireless communication protocol that lets two or more ESP devices talk to each other directly, without needing a WiFi router or internet connection. If you have ever wanted to build a wireless sensor network in your home or factory, or create a multi-node weather station, ESP-NOW is the technology you should learn. This tutorial walks you through everything from the basics to a working multi-node example with Arduino code.

Table of Contents

  1. What Is ESP-NOW?
  2. How ESP-NOW Works
  3. Advantages Over WiFi and Bluetooth
  4. Hardware You Need
  5. Tutorial: One-Way Communication (Sender to Receiver)
  6. Tutorial: Bi-Directional Communication
  7. Multi-Node Sensor Network
  8. Improving Range and Reliability
  9. Recommended Products from Zbotic
  10. Frequently Asked Questions
  11. Conclusion

What Is ESP-NOW?

ESP-NOW is a proprietary communication protocol developed by Espressif that operates in the 2.4 GHz ISM band using the 802.11 WiFi radio hardware. Unlike standard WiFi, it does not require an access point, router or internet infrastructure of any kind. Instead, it enables direct device-to-device communication similar to a walkie-talkie — one device transmits, another receives, all in the same short-range radio spectrum.

The protocol was designed for low-power, low-latency use cases where setting up a full WiFi infrastructure is impractical. Each packet is small (up to 250 bytes of payload), transmission latency is as low as 1 millisecond, and multiple peer relationships can be maintained simultaneously (up to 20 peers in unicast and unlimited in broadcast mode).

ESP-NOW works on the ESP8266, ESP32, ESP32-S2, ESP32-S3 and ESP32-C3 — which means you can mix and match these devices in a single network. A master ESP32 can collect data from multiple ESP8266 sensor nodes, for example, which is a very common pattern in Indian smart home and agricultural IoT projects.

How ESP-NOW Works

At the protocol level, ESP-NOW works by registering “peers” identified by their MAC addresses. Once a peer is registered, you can send data packets to that MAC address directly. The receiving device must have a callback function registered to handle incoming data. Here is the flow:

  1. Initialise ESP-NOW using esp_now_init()
  2. Register callbacks for send status (esp_now_register_send_cb()) and receive (esp_now_register_recv_cb())
  3. Register peers by adding their MAC addresses using esp_now_add_peer()
  4. Send data using esp_now_send() — pass the peer’s MAC address and your data buffer
  5. Receive data automatically in the receive callback whenever another device sends to your MAC

The WiFi radio handles acknowledgements at the hardware level, so you do not need to implement your own retry logic for basic reliability. Your send callback tells you whether the transmission was received by the peer.

An important detail: ESP-NOW and WiFi station mode can coexist on the same ESP32. This means a device can simultaneously be connected to a WiFi router for internet access AND communicate with other ESP-NOW peers. However, when WiFi station mode is active, all ESP-NOW devices in the network must operate on the same WiFi channel as the connected router.

Advantages Over WiFi and Bluetooth

Feature ESP-NOW WiFi (MQTT/HTTP) Bluetooth BLE
Requires Router No Yes No
Connection Setup None (connectionless) Association + DHCP Pairing required
Latency ~1–10 ms 50–500 ms+ 10–100 ms
Range (indoor) ~50–200 m ~30–100 m (AP dependent) ~10–40 m
Max Payload 250 bytes Unlimited 20 bytes (MTU, extensible)
Power (active TX) Very short bursts Sustained high Low
Max Peers 20 unicast + broadcast Unlimited (via MQTT) 7 (piconet)
Works Without Internet Yes Local only (MQTT broker) Yes

Hardware You Need

For this tutorial, you need at least two ESP32 development boards. The code examples below use the Arduino ESP32 core and will work on any ESP32-based board including the NodeMCU-32S, ESP32 DevKit, or ESP32-CAM. For the multi-node sensor example, we will also use a DHT11 temperature sensor on the sender node.

Make sure you have the MAC address of each board’s WiFi interface. You can find this by running a simple sketch that calls WiFi.macAddress() before setting up ESP-NOW.

Ai Thinker NodeMCU-32S-ESP32 Development Board

Ai Thinker NodeMCU-32S-ESP32 Development Board – IPEX Version

The ideal board for ESP-NOW experiments — buy two or more of these and you are ready to build a wireless sensor network. The IPEX antenna connector improves range.

View on Zbotic

Tutorial: One-Way Communication (Sender to Receiver)

Let’s start with the simplest ESP-NOW setup: one sender board transmitting data to one receiver board.

Step 1: Find the Receiver’s MAC Address

Upload this sketch to the receiver board and note the MAC address printed in the Serial Monitor:

#include <WiFi.h>
void setup() {
  Serial.begin(115200);
  WiFi.mode(WIFI_STA);
  Serial.print("Receiver MAC: ");
  Serial.println(WiFi.macAddress());
}
void loop() {}

Step 2: Sender Code

Replace the MAC address in the array below with your receiver’s actual MAC address:

#include <esp_now.h>
#include <WiFi.h>

// Replace with receiver's actual MAC address
uint8_t receiverMAC[] = {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF};

typedef struct SensorData {
  float temperature;
  float humidity;
  int   nodeID;
} SensorData;

SensorData myData;
esp_now_peer_info_t peerInfo;

void onSent(const uint8_t *mac, esp_now_send_status_t status) {
  Serial.print("Send status: ");
  Serial.println(status == ESP_NOW_SEND_SUCCESS ? "OK" : "FAIL");
}

void setup() {
  Serial.begin(115200);
  WiFi.mode(WIFI_STA);
  if (esp_now_init() != ESP_OK) { Serial.println("ESP-NOW init failed"); return; }
  esp_now_register_send_cb(onSent);
  memcpy(peerInfo.peer_addr, receiverMAC, 6);
  peerInfo.channel = 0;  // 0 = current channel
  peerInfo.encrypt = false;
  if (esp_now_add_peer(&peerInfo) != ESP_OK) { Serial.println("Add peer failed"); return; }
  Serial.println("ESP-NOW sender ready");
}

void loop() {
  myData.nodeID = 1;
  myData.temperature = 28.5 + random(-20, 20) / 10.0;  // simulate sensor
  myData.humidity    = 65.0 + random(-50, 50) / 10.0;
  esp_now_send(receiverMAC, (uint8_t*)&myData, sizeof(myData));
  delay(2000);
}

Step 3: Receiver Code

#include <esp_now.h>
#include <WiFi.h>

typedef struct SensorData {
  float temperature;
  float humidity;
  int   nodeID;
} SensorData;

SensorData incoming;

void onReceive(const esp_now_recv_info_t *info, const uint8_t *data, int len) {
  memcpy(&incoming, data, sizeof(incoming));
  Serial.printf("Node %d: Temp=%.1f°C  Humidity=%.1f%%n",
                incoming.nodeID, incoming.temperature, incoming.humidity);
}

void setup() {
  Serial.begin(115200);
  WiFi.mode(WIFI_STA);
  if (esp_now_init() != ESP_OK) { Serial.println("ESP-NOW init failed"); return; }
  esp_now_register_recv_cb(onReceive);
  Serial.println("ESP-NOW receiver ready");
}

void loop() {}

Upload the sender code to Board 1 and the receiver code to Board 2. Open the Serial Monitor on Board 2 and you should see temperature and humidity data arriving every 2 seconds — no WiFi router, no internet, no broker needed.

Tutorial: Bi-Directional Communication

For bi-directional communication (both boards send and receive), both devices must register each other as peers, and both must register send and receive callbacks. This is the basis for remote control applications where the controller sends commands and the receiver sends back acknowledgements or sensor readings.

The key insight is that a board can simultaneously be a sender and a receiver in ESP-NOW. You simply add both callbacks and both peer registrations in setup(), and the protocol handles the rest. In bidirectional mode, each board has the other’s MAC address registered as a peer, and both call esp_now_send() to transmit and have an active onReceive callback for incoming messages.

Multi-Node Sensor Network

A common pattern for Indian IoT projects is a “star” topology where one master ESP32 (connected to WiFi and optionally an MQTT broker) collects data from multiple sensor nodes. Each sensor node wakes from deep sleep, reads its sensor, transmits data via ESP-NOW to the master, and immediately goes back to deep sleep. The master stays always-on and forwards received data to the cloud.

This architecture is extremely power-efficient for the sensor nodes. An ESP32 in deep sleep draws only ~10 µA. If it wakes every 5 minutes, reads a sensor and transmits ~50 bytes of data via ESP-NOW (which takes under 50 ms of active radio time), the average current consumption over the full cycle can be under 100 µA — meaning a 2000 mAh 18650 battery can last over 2 years on a sensor node.

The master node simply receives from any registered peer (or broadcasts in promiscuous receive mode) and routes the data to MQTT or an HTTP API. In the receive callback, you can use the sender’s MAC address to identify which node the data came from.

DHT20 SIP Packaged Temperature and Humidity Sensor

DHT20 SIP Packaged Temperature and Humidity Sensor

An I2C temperature and humidity sensor with excellent accuracy — ideal for ESP-NOW sensor nodes that need to minimise wake time and power consumption.

View on Zbotic

4 x 18650 Lithium Battery Shield for ESP32

4 x 18650 Lithium Battery Shield V8/V9 for ESP32 with On-Off Button

Power your always-on ESP-NOW master node or multiple sensor nodes with this quad-cell battery shield — ideal for extended deployments without mains power.

View on Zbotic

Improving Range and Reliability

  • Use IPEX antenna modules: The PCB antenna on standard WROOM modules has limited range (~50 m open field). Modules with an IPEX connector (like the NodeMCU-32S IPEX version) allow you to attach an external dipole antenna for 2–3x range improvement.
  • Fix WiFi channel: If some nodes use WiFi station mode and others use ESP-NOW only, all devices must operate on the same channel. Check the channel your router uses and configure pure-ESP-NOW devices accordingly.
  • Long Range (LR) mode: ESP32 (not ESP8266 or C3) supports a proprietary Long Range WiFi mode that extends ESP-NOW range to ~1 km in open field at the cost of reduced throughput. Enable with esp_wifi_set_protocol(WIFI_IF_STA, WIFI_PROTOCOL_LR).
  • Power supply stability: Unreliable power (weak batteries, long thin wires) causes random radio resets that manifest as missed transmissions. Use quality 18650 cells or a filtered 3.3V regulator.
  • Retransmission logic: ESP-NOW provides hardware-level acknowledgement, but your application should implement retries for critical data. On send failure callback, queue the data and retry after a short delay.
GY-BME280-3.3 Precision Altimeter Atmospheric Pressure Sensor Module

GY-BME280-3.3 Precision Altimeter Atmospheric Pressure Sensor Module

A BME280 module providing temperature, humidity and pressure readings over I2C. An excellent multi-parameter sensor for ESP-NOW weather station nodes.

View on Zbotic

Frequently Asked Questions

Does ESP-NOW work without a WiFi network or router?

Yes, that is its primary advantage. ESP-NOW is completely independent of any WiFi infrastructure. Devices communicate directly using their MAC addresses. You do not need a router, an internet connection, or any cloud service. This makes it ideal for offline sensor networks in rural India where internet connectivity may be unreliable or absent.

Can ESP-NOW work alongside WiFi on the same ESP32?

Yes. An ESP32 can simultaneously maintain a WiFi station connection (for internet access) and communicate via ESP-NOW with other devices. The constraint is that all ESP-NOW peers must operate on the same WiFi channel as the router. If the WiFi channel changes (some routers do this automatically), ESP-NOW communication will break until all nodes are updated to the new channel.

Is ESP-NOW secure? Can someone sniff my data?

ESP-NOW supports AES-128 CCM encryption for peer-to-peer communication. Broadcast messages cannot be encrypted. To enable encryption, set peerInfo.encrypt = true and provide a 16-byte PMK (Primary Master Key) and LMK (Local Master Key). Without encryption, anyone with a 2.4 GHz packet sniffer can read your ESP-NOW payload — so for sensitive data like security systems, always enable encryption.

How many ESP32 nodes can I have in one ESP-NOW network?

A single ESP32 can maintain up to 20 encrypted peers (unicast). If you use unencrypted communication, the limit is effectively much higher — devices can receive from any sender by using the promiscuous receive callback. For large networks (20+ nodes), a star topology with a central gateway that routes data to a cloud broker over WiFi is the recommended architecture.

Does ESP-NOW work between ESP32 and ESP8266?

Yes. ESP-NOW is compatible across the ESP32, ESP8266, ESP32-S3, ESP32-C3 and other Espressif chips. You can have an ESP32 master collecting data from cheaper ESP8266 nodes, which is a cost-effective strategy for large sensor deployments where the gateway needs the extra processing power and the nodes just need to read a sensor and transmit.

Conclusion

ESP-NOW is a powerful, underutilised tool in every ESP32 maker’s toolkit. It enables wireless communication with millisecond latency, no router dependency, and extremely low power consumption for battery-operated nodes. Whether you are building a multi-room temperature monitoring system for an Indian home, a field sensor network for an agricultural application, or a wireless remote control for a robot — ESP-NOW is often the best choice when simplicity, speed and offline operation matter.

The learning curve is gentle: if you can write basic Arduino code for the ESP32, you can have a working ESP-NOW link running in under an hour with the examples in this tutorial. Start with a simple one-way sender/receiver pair and work your way up to a multi-node star network as your confidence grows.

Get all the ESP32 boards, modules and sensors you need for your ESP-NOW projects from Zbotic’s IoT collection — fast shipping across India, competitive prices and genuine products from Ai Thinker, Waveshare and Espressif.

Tags: ESP-NOW, ESP32 Tutorial, ESP32 wireless, esp8266, peer to peer IoT
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
ESP32 DAC Tutorial: Generate A...
blog esp32 dac tutorial generate analog signals and audio output 595615
blog iot device provisioning zero touch setup for production 595624
IoT Device Provisioning: Zero ...

Related posts

Svg%3E
Read more

IoT Home Insurance Sensor Kit: Leak, Smoke, and Motion

April 1, 2026 0
Table of Contents IoT and Home Insurance Water Leak Detection Smoke and Fire Detection Motion and Intrusion Sensing Building the... Continue reading
Svg%3E
Read more

IoT Pet Tracker: GPS Collar with Geofencing Alerts

April 1, 2026 0
Table of Contents Introduction and Overview Hardware Components Required GPS Module Integration with ESP32 Cloud Platform Setup Real-Time Tracking Dashboard... Continue reading
Svg%3E
Read more

IoT Aquaponics Controller: Fish and Plant Automation

April 1, 2026 0
Table of Contents The Water Monitoring Challenge in India Sensor Technologies for Water Building the Sensor Node Data Transmission and... Continue reading
Svg%3E
Read more

IoT Composting Monitor: Temperature and Moisture Tracking

April 1, 2026 0
Table of Contents Why Temperature Monitoring Matters Sensor Selection Guide Hardware Assembly and Wiring Firmware Development Cloud Data Logging Alert... Continue reading
Svg%3E
Read more

IoT Beehive Monitor: Weight, Temperature, and Humidity

April 1, 2026 0
Table of Contents Why Monitor Beehives Weight Measurement System Temperature and Humidity Sensing Building the Monitor Data Analysis for Bee... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now