← How-Tos
electronics Jul 3, 2026 ◑ 2 views ◯ 2 min read

ESP-NOW Mesh: Wireless Sensor Networks Without WiFi

esp32esp nowmesh networkwireless sensors

What ESP-NOW Actually Is

A connectionless, low-latency wireless protocol built into ESP32/ESP8266 that operates independent of your WiFi network entirely — no router, no SSID, no IP addresses. Devices talk peer-to-peer directly via MAC address. This makes it genuinely well-suited for sensor networks where you want simplicity and low power over internet connectivity at the individual sensor node level.

Why Not Just Use WiFi Directly

Basic Sender (Sensor Node)

#include <esp_now.h> #include <WiFi.h> uint8_t receiverMAC[] = {0xAA, 0xBB, 0xCC, 0x11, 0x22, 0x33}; // target device's MAC typedef struct { float temperature; float humidity; } SensorData; void setup() { WiFi.mode(WIFI_STA); esp_now_init(); esp_now_peer_info_t peer = {}; memcpy(peer.peer_addr, receiverMAC, 6); peer.channel = 0; esp_now_add_peer(&peer); } void loop() { SensorData data = { readTemp(), readHumidity() }; esp_now_send(receiverMAC, (uint8_t*)&data, sizeof(data)); esp_deep_sleep_start(); // send and sleep — see deep sleep guide }

Basic Receiver (Hub Node)

void onDataReceived(const uint8_t* mac, const uint8_t* data, int len) { SensorData* sensorData = (SensorData*)data; Serial.printf("Temp: %.1f Humidity: %.1f\n", sensorData->temperature, sensorData->humidity); // forward to MQTT/Home Assistant here } void setup() { WiFi.mode(WIFI_STA); esp_now_init(); esp_now_register_recv_cb(onDataReceived); }

Finding a Board's MAC Address

Serial.println(WiFi.macAddress());

Run this once on each board to get the address you need for peer configuration on the other end — write these down as you build out a multi-node network, since you're hardcoding peer addresses rather than using discovery.

Building an Actual Mesh (Multi-Hop)

ESP-NOW itself is peer-to-peer, not automatically meshing — for genuine multi-hop coverage (sensor A can't reach the hub directly, but can reach relay node B which forwards to the hub), you build this yourself: a relay node runs both a receiver callback (from sensors) and a sender routine (forwarding to the next hop), effectively acting as a simple store-and-forward bridge. Libraries like painlessMesh handle this networking complexity for you if you don't want to build custom relay logic — worth using once you're past a simple single-hop sensor-to-hub setup.

Bridging ESP-NOW to Your Real Network

The hub node (receiving ESP-NOW data) typically also runs normal WiFi simultaneously, forwarding received sensor data on to MQTT/Home Assistant over your actual network — ESP32 can genuinely run ESP-NOW and standard WiFi concurrently on the same radio, making this bridge pattern straightforward.