In many real-world IoT scenarios remote farms, off-grid cabins, or disaster zones—internet access is unreliable or completely unavailable. But that doesn’t mean your IoT project has to stop working. Thanks to technologies like ESP-NOW and LoRa, you can still build powerful, wireless ESP32-based systems that don’t rely on Wi-Fi or mobile networks.
In this post, we’ll explore how to build offline ESP32 IoT projects using ESP-NOW and LoRa for peer-to-peer or long-range communication. Whether you’re working on remote environmental monitoring, emergency alert systems, or mesh-based automation, ESP32 IoT Project with ESP-NOW will open new possibilities.
🔧 What You’ll Learn
- What ESP-NOW and LoRa are, and when to use each
- How to set up ESP-NOW communication between ESP32 boards
- How to use LoRa modules with ESP32 for long-range transmission
- Sample projects you can build without internet access
What is ESP-NOW?
ESP-NOW is a wireless communication protocol developed by Espressif that allows smart devices to communicate directly, quickly, and with low power consumption—no router required. It works alongside Wi-Fi and Bluetooth LE, and is compatible with ESP8266, ESP32, ESP32-S, and ESP32-C series SoCs. This protocol is widely used in applications such as smart home devices, remote controls, and sensor networks.
🔹 Key Features:
- Peer-to-peer communication
- No Wi-Fi network required
- Very low power consumption
- Supports broadcasting to multiple nodes
- Data payloads up to 250 bytes
What is LoRa?
LoRa (Long Range) is A low-power, long-range wireless communication technology designed mainly for the Internet of Things (IoT), enabling the transmission of small data packets across extensive distances.
🔸 Key Features:
- Communication over several kilometers
- Low power, battery-friendly
- Suitable for low-bandwidth sensor data
- Requires LoRa modules (like SX1278 or Ra-02) paired with ESP32
🔗 Get the parts to build this project
LoRa operates on unlicensed radio frequencies that are available globally.
The most commonly used ones include:
- 868 MHz for Europe
- 915 MHz for North America
- 433 MHz band for Asia
ESP-NOW vs LoRa: Which One Should You Use?
Feature | ESP-NOW | LoRa |
Range | ~100 meters (urban) | Up to 10 km (open area) |
Data Rate | Higher | Very Low |
Power Usage | Low | Very Low |
Setup Complexity | Easy (built into ESP32) | Medium (needs external module) |
Best Use Case | Local mesh or broadcast | Remote sensing, agriculture, alerts |
Initiators and Responders
A device on an ESP32 IoT Project with ESP-NOW network can work in one of two roles:
Initiator: This is the device that starts the communication. It needs to know the MAC address of the device it’s sending data to.
Responder: This is the device that listens for and receives the data.
In a one-way (half-duplex) setup, one device sends (Initiator), and the other simply receives (Responder).
But in a two-way (full-duplex) setup, both devices take turns sending and receiving—so each one acts as both an Initiator and a Responder.
ESP-NOW technology comes with the following limitations:
- A maximum of 10 encrypted peers is supported in Station mode, and up to 6 in SoftAP or SoftAP + Station mode.
- While multiple unencrypted peers are allowed, the total number of peers—including both encrypted and unencrypted—must remain below 20.
- The payload size is restricted to 250 bytes.
Just keep in mind, LoRa isn’t the best choice for projects that:
Require high data-rate transmission.
Need very frequent transmissions.
Or are in highly populated networks.
ESP-NOW is very versatile and you can have one-way or two-way communication in different Project with ESP-NOW and LoRa setups.
offline ESP32 IoT projects One-Way Communication
In this setup, the Initiator ESP32 sends data to the Responder ESP32 and can determine whether the message was successfully received.
Although this way is simple, the configuration is highly useful for remote control applications.
ESP32 + ESP-NOW: Basic Setup
Here’s a simple example of sending sensor data between two ESP32 boards using ESP-NOW.
📋 Requirements:
- 2x ESP32 boards
- Arduino IDE
ESP32: Getting Board MAC Address
To send data using ESP-NOW, you need to know the MAC address of the ESP32 you want to reach. Think of it like the device’s home address—it tells your board exactly where to deliver the message.
Every ESP32 has its own unique MAC address, and that’s how we identify which board to communicate with.
Sender Code:
#include <esp_now.h> uint8_t receiverAddress[] = {0x24, 0x6F, 0x28, 0xAB, 0xCD, 0xEF}; // Replace with receiver MAC typedef struct struct_message { struct_message myData; void setup() { void loop() { |
Receiver code:
#include <esp_now.h> typedef struct struct_message { void onReceiveData(const uint8_t *mac, const uint8_t *incomingData, int len) { void setup() { void loop() { |
How to upload code and identify MAC Address in ESP32 IoT Project with ESP-NOW:
Once you’ve uploaded the code, open the Serial Monitor with the baud rate set to 115200. Then, press the RST/EN button on your ESP32. You should see the MAC address appear in the output.
Note: Be sure to save your board’s MAC address—you’ll need it later to make sure your data gets sent to the right ESP32 using ESP-NOW.
ESP32 + LoRa: Basic Setup
You’ll need LoRa modules (e.g., Ra-02 SX1278) and the RadioHead or LoRa Arduino library.
📋 Requirements:
- 2x ESP32 boards
- Arduino LoRa library
- 2x SX1278 LoRa modules
- Jumper wires
Sender Code Example:
#include <SPI.h> void setup() { void loop() { |
Receiver Code:
#include <SPI.h> void setup() { void loop() { |
One ESP32 board (acting as a master) sends data to multiple other ESP32 boards (acting as slaves)
It can transmit the same or different commands to each device. This setup is ideal for building a remote control system ESP32 IoT Project with ESP-NOW, where a central ESP32 controls several others positioned throughout a house.
One ESP32 device receives data from multiple other ESP32 devices
This setup is ideal for aggregating data from several sensor nodes into a single board, which can, for example, be configured as a web server to display data from all connected devices.
You can add more boards to this configuration and have something that looks like a network in iot lora project (all ESP32 boards communicate with each other).
Note: The official ESP-NOW documentation doesn’t actually use terms like ‘sender/master’ or ‘receiver/slave’—every ESP32 board can act as either one, depending on the situation. However, to keep things simple and easy to follow, we’ll use the terms ‘sender’ and ‘receiver’ (or ‘master’ and ‘slave’) throughout this guide.
🛒 Shop ESP32 and components here
Final Thoughts
You don’t always need internet to build a reliable and functional IoT system. ESP-NOW and LoRa empower makers and engineers to build resilient, decentralized, and battery-efficient networks.
If your next iot lora project needs to work offline, over long distances, or in emergency conditions, give these technologies a try—you might be surprised how much you can achieve without Wi-Fi.
FAQ:
- Can ESP-NOW and LoRa be used together in the same ESP32 project?
Yes. The ESP32 supports using ESP-NOW and LoRa simultaneously, as they operate on different hardware interfaces—ESP-NOW uses Wi-Fi (2.4 GHz), while LoRa uses a separate radio module (typically via SPI). This allows one ESP32 to act as a local controller via ESP-NOW and a long-range node via LoRa, without needing internet access. - Do I need a Wi-Fi router or internet connection to use ESP-NOW or LoRa?
No. Both ESP-NOW and LoRa work completely offline.
ESP-NOW creates a direct device-to-device communication network (like a mesh or point-to-multipoint), while LoRa uses long-range, low-power radio communication. Neither requires a router, SIM card, or Wi-Fi network in iot lora project. - How far can ESP-NOW and LoRa transmit, and which should I use?
ESP-NOW is best for short-range (up to ~200 meters line-of-sight).
LoRa is ideal for long-range (up to 1–5 km in rural areas, and ~500–800 meters in urban environments).
You can use ESP-NOW for local communication between nearby ESP32 boards and LoRa to bridge longer distances or remote nodes in your offline IoT setup.