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 Protocol: Peer-to-Peer IoT Without a Router

ESP-NOW Protocol: Peer-to-Peer IoT Without a Router

March 11, 2026 /Posted byJayesh Jain / 0

The ESP-NOW protocol tutorial you have been waiting for is here. ESP-NOW is Espressif’s proprietary peer-to-peer wireless communication protocol that lets ESP32 and ESP8266 modules talk to each other directly — no WiFi router, no internet connection, no cloud subscription needed. It operates at the MAC layer of the 802.11 standard, enabling fast, low-latency, low-power data exchange between up to 20 paired devices. For Indian makers building sensor networks, remote controls, or distributed IoT systems, ESP-NOW is one of the most practical tools available.

Table of Contents

  1. What Is ESP-NOW and How Does It Work?
  2. ESP-NOW vs. Traditional WiFi: When to Use Which
  3. Hardware You Need to Get Started
  4. Tutorial: One-Way Data Transmission
  5. Tutorial: Two-Way Communication Between Two ESP32s
  6. Building a Multi-Node Sensor Network
  7. Range, Reliability, and Power Consumption Tips
  8. Frequently Asked Questions

What Is ESP-NOW and How Does It Work?

ESP-NOW was developed by Espressif and first appeared in the ESP8266 SDK. It has since been fully supported on the ESP32, ESP32-S2, ESP32-S3, ESP32-C3, and other variants in the family. At its core, ESP-NOW is a connectionless communication protocol that bypasses the entire TCP/IP WiFi stack.

Instead of the usual WiFi handshake — association, authentication, DHCP, TCP connection — ESP-NOW sends short data frames (up to 250 bytes per packet) directly between devices identified by their MAC addresses. The communication happens at the physical layer, meaning it is extremely fast (latency as low as 1–2 ms) and works even when there is no WiFi infrastructure around.

Key technical characteristics of ESP-NOW:

  • Payload: Up to 250 bytes per message
  • Peers: Up to 20 registered peer devices
  • Encryption: Optional AES-128 CCMP encryption (up to 6 encrypted peers)
  • Range: Up to 480 metres in open air (tested)
  • Latency: Typically 1–5 ms
  • Operating band: 2.4 GHz (channel selectable)
  • Coexistence: Can run simultaneously with WiFi in station or AP mode

ESP-NOW vs. Traditional WiFi: When to Use Which

Criteria ESP-NOW WiFi (TCP/IP)
Requires Router No Yes
Latency 1–5 ms 50–500 ms
Max Payload 250 bytes Unlimited (TCP)
Max Peers 20 Limited by router
Power Consumption Very low Higher
Internet Access No (without bridge) Yes
Encryption AES-128 (optional) WPA2/WPA3
Best For Local sensor networks, remote controls Cloud IoT, web dashboards

Use ESP-NOW when your devices need to communicate locally without internet infrastructure — for example, a set of soil moisture sensors spread across a farm field reporting to a central gateway, or a wireless button controller managing multiple smart lights without depending on your home router being online.

Hardware You Need to Get Started

For this tutorial, you need at least two ESP32 development boards or modules. Any ESP32 variant works — the classic ESP32, ESP32-C3, ESP32-S3, etc. You can even mix and match, since ESP-NOW is compatible across the ESP family.

Ai Thinker NodeMCU-32S-ESP32 Development Board

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

A full-featured ESP32 development board with an IPEX antenna connector for excellent range — buy two to get started with ESP-NOW peer-to-peer communication right away.

View on Zbotic

Ai-Thinker ESP32-C3-12F Wi-Fi +BLE Module

Ai-Thinker ESP32-C3-12F Wi-Fi + BLE Module

The ESP32-C3-12F supports ESP-NOW and is a cost-effective option for building battery-powered sensor nodes in a multi-device ESP-NOW network.

View on Zbotic

You will also want a sensor like a DHT11 or BME280 for the transmitting node, and optionally an OLED display or serial monitor for the receiving node to display data.

Tutorial: One-Way Data Transmission

Let us start with the simplest case: one ESP32 (the sender) transmitting temperature data to another ESP32 (the receiver). Before writing code, you need the MAC address of the receiver board.

Step 1: Get the Receiver’s MAC Address

Upload this simple sketch to the receiver board to print its MAC address:

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

Note the MAC address (e.g., AA:BB:CC:DD:EE:FF).

Step 2: Sender Code

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

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

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

SensorData data;
esp_now_peer_info_t peerInfo;

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

void setup() {
  Serial.begin(115200);
  WiFi.mode(WIFI_STA);
  esp_now_init();
  esp_now_register_send_cb(onSent);
  memcpy(peerInfo.peer_addr, receiverMAC, 6);
  peerInfo.channel = 0;
  peerInfo.encrypt = false;
  esp_now_add_peer(&peerInfo);
}

void loop() {
  data.temperature = 30.5; // Replace with real sensor reading
  data.humidity = 65.0;
  esp_now_send(receiverMAC, (uint8_t *)&data, sizeof(data));
  delay(2000);
}

Step 3: Receiver Code

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

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

SensorData incomingData;

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

void setup() {
  Serial.begin(115200);
  WiFi.mode(WIFI_STA);
  esp_now_init();
  esp_now_register_recv_cb(onReceive);
}

void loop() {}

Tutorial: Two-Way Communication Between Two ESP32s

Two-way ESP-NOW communication is achieved by registering each device as a peer on the other, and having both devices register both send and receive callbacks. This enables acknowledgement-based systems, remote control with feedback, or bidirectional sensor data exchange.

The key pattern is:

  1. Both devices call WiFi.mode(WIFI_STA) and esp_now_init()
  2. Each device registers the other’s MAC as a peer using esp_now_add_peer()
  3. Each device registers both esp_now_register_send_cb() and esp_now_register_recv_cb()
  4. On receiving data, a device can immediately send back a response using esp_now_send()

A practical use case for two-way ESP-NOW: a handheld remote control (sender) sends a command to a robot (receiver). The robot executes the command and sends back its battery level and status to the remote’s display — all without any router in the loop.

Building a Multi-Node Sensor Network

One of the most powerful applications of ESP-NOW is a star topology sensor network where multiple sensor nodes all report to a single gateway. The gateway can optionally be connected to WiFi to forward data to a cloud service like ThingSpeak or Home Assistant.

DHT20 SIP Packaged Temperature and Humidity Sensor

DHT20 SIP Packaged Temperature and Humidity Sensor

The DHT20 offers improved accuracy over DHT11 and uses I2C interface — perfect for multi-node ESP-NOW sensor arrays where each node monitors temperature and humidity.

View on Zbotic

Architecture for a 5-node weather monitoring network:

  • 5 sensor nodes: Each has a BME280 (temperature, humidity, pressure) and runs on battery via an 18650 shield. Each node wakes from deep sleep, reads the sensor, sends data via ESP-NOW to the gateway, then goes back to sleep.
  • 1 gateway node: Always on, connected to home WiFi. Receives data from all 5 sensor nodes via ESP-NOW callbacks and posts to an MQTT broker or HTTP API.

The gateway uses a broadcast address (FF:FF:FF:FF:FF:FF) as its peer so it can receive from any ESP-NOW sender, while each sensor node has the gateway’s MAC hard-coded as its peer. This is the classic star pattern and scales to 20 nodes before hitting the ESP-NOW peer limit.

GY-BME280-3.3 Precision Altimeter Atmospheric Pressure Sensor Module

GY-BME280-3.3 Precision Altimeter Atmospheric Pressure Sensor Module

The BME280 measures temperature, humidity, and barometric pressure in one compact I2C module — ideal for each sensor node in your ESP-NOW weather monitoring network.

View on Zbotic

Range, Reliability, and Power Consumption Tips

ESP-NOW’s range depends heavily on the antenna used and the environment. Here are practical tips for maximising your network reliability:

Improving Range

  • Use modules with external antenna connectors (like the ESP32-C3-12F) and add a 2.4 GHz antenna for greater range
  • Use the esp_wifi_set_max_tx_power() function to set maximum transmit power: esp_wifi_set_max_tx_power(84) sets it to 21 dBm
  • Keep sensor nodes elevated and away from metal objects and concrete walls
  • In tested open-field conditions, ESP-NOW with a PCB trace antenna reaches 100–200m reliably; with an external antenna, 400–480m is achievable

Channel Alignment

If your gateway is also connected to WiFi as a station, ESP-NOW must use the same channel as the WiFi AP. When the gateway connects to your router on channel 6, all ESP-NOW communication must also happen on channel 6. Make sure all sensor nodes set peerInfo.channel = 0 (which means use the current channel) rather than hard-coding a different channel number.

Power Saving on Sensor Nodes

For battery-powered nodes, combine ESP-NOW with deep sleep. The typical duty cycle is: wake → enable WiFi → register peer → send one packet → check delivery callback → enter deep sleep. This entire sequence takes about 300–500 ms, consuming roughly 100–150 mA during that window. On a 2000 mAh 18650 cell, sending data every 5 minutes gives over 6 months of battery life.

Frequently Asked Questions

Can ESP-NOW and WiFi work at the same time on ESP32?

Yes, but with a constraint. When the ESP32 is connected to a WiFi router as a station, ESP-NOW must operate on the same channel as the router. You can send ESP-NOW packets while the WiFi connection is active, which is useful for gateway nodes that both relay ESP-NOW sensor data and push it to the internet over WiFi.

Is ESP-NOW secure?

ESP-NOW supports AES-128 CCMP encryption, but only for up to 6 peers simultaneously. For encrypted communication, both sender and receiver must share a 16-byte key set via peerInfo.encrypt = true and the LMK (Local Master Key). For non-critical sensor data on a private property, unencrypted ESP-NOW is typically acceptable.

What is the maximum number of nodes in an ESP-NOW network?

Each ESP32 can register up to 20 peers. In a star topology, your gateway can receive from up to 20 sensor nodes. In a mesh-like topology with forwarding, you can technically reach more nodes, but ESP-NOW does not have built-in mesh routing — you would need to implement that logic yourself, or use ESP-MESH instead.

Does ESP-NOW work between ESP32 and ESP8266?

Yes, ESP-NOW is cross-compatible between ESP32 and ESP8266 devices, as long as they are on the same 2.4 GHz channel. This means you can use cheaper ESP8266 modules as sensor nodes and an ESP32 as the gateway without any issues.

How do I handle packet loss in ESP-NOW?

ESP-NOW provides a delivery callback with a success or failure status. For critical data, implement an acknowledgement + retry loop: if the send callback returns failure, re-queue the packet and retry after a short delay. For non-critical sensor data (like temperature readings), packet loss of 1–2% is usually acceptable and can simply be ignored.

Start Building Your Wireless Sensor Network Today

Get ESP32 boards, sensors, and accessories for your ESP-NOW projects from Zbotic — fast delivery across India, quality products, and competitive prices.

Shop IoT Components at Zbotic

Tags: ESP-NOW, ESP32, esp8266, peer to peer IoT, wireless sensor
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
IoT Smoke and Gas Alert System...
blog iot smoke and gas alert system mq2 esp32 whatsapp 595312
blog fix raspberry pi boot issues sd card power and common errors 595314
Fix Raspberry Pi Boot Issues: ...

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