Documentation
How to Work with LoRaMesher
From PlatformIO setup to multi-hop mesh gateway — everything you need to get started.
Getting Started
Up and Running in 30 Minutes
Five steps from zero to a working mesh network on ESP32.
Install PlatformIO
Install the PlatformIO IDE extension for VS Code or use the CLI.
# Install PlatformIO CLI
pip install platformio
# Or install VS Code extension:
# Extensions → search "PlatformIO IDE"Add LoRaMesher to Your Project
Add the library to your platformio.ini dependencies.
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_deps =
https://github.com/LoRaMesher/LoRaMesher.gitInitialize the Radio
Get the singleton instance and call begin() in your setup().
#include <LoraMesher.h>
LoraMesher& radio = LoraMesher::getInstance();
void setup() {
Serial.begin(115200);
radio.begin(); // Uses default SPI pins
radio.start();
Serial.printf("Node: %X\n", radio.getLocalAddress());
}Send a Packet
Create and send a typed packet to any node address.
// Send a float to the gateway (address 0x01)
float temperature = 24.5f;
radio.createPacketAndSend(0x01, &temperature, sizeof(float));Receive Packets
Register a callback that fires when a packet arrives at your node.
void onReceive(AppPacket<uint8_t>* pkt) {
float* temp = reinterpret_cast<float*>(pkt->payload);
Serial.printf("Temp from 0x%X: %.1f°C\n", pkt->src, *temp);
LoraMesher::deletePacket(pkt);
}
void setup() {
Serial.begin(115200);
radio.begin();
radio.setReceiveCallback(onReceive);
radio.start();
}Architecture
How the Mesh Works
Three-layer design: field sensors communicate through a self-healing mesh to reach a gateway connected to your cloud.
Sensors & Field Devices
ESP32 + SX1276 nodes
Mesh Network
Self-healing multi-hop LoRa
Gateway → Cloud
WiFi/Ethernet bridge to backend
Technology Comparison
| Technology | Range | Power | Native Mesh | Cost | Mobile Nodes |
|---|---|---|---|---|---|
| WiFi | ~100m | High | Low | ||
| Bluetooth | ~30m | Medium | Low | ||
| LoRaWAN | 2–15km | Very Low | Medium | ||
| LoRa Mesh (LoRaMesher) | 2–10km | Very Low | Very Low | ||
| Zigbee | ~100m | Low | Medium | ||
| Cellular (LTE-M) | Unlimited | High | High |
Hardware
Supported Hardware
LoRaMesher runs on any ESP32 board with a LoRa radio via RadioLib.
ESP32 + SX1276 Module
~€8–15Maximum flexibility with separate microcontroller and LoRa module. Ideal for custom PCB designs.
ESP32 + SX1276 · Full GPIO access, custom antenna design possible
TTGO LoRa32
~€12–20All-in-one development board with integrated OLED display. Great for prototyping.
ESP32 + SX1276/SX1278 · 128×64 OLED, Li-Po battery connector
Heltec WiFi LoRa 32
~€15–25Compact board with display, WiFi, BLE, and LoRa. Popular for gateway nodes.
ESP32 + SX1276 · USB-C, 0.96" OLED, compact form factor
Generic RadioLib Compatible
VariesLoRaMesher uses RadioLib under the hood — any supported board works.
Any RadioLib board · SX1262, SX1278, RFM95, and more
Code Examples
Common Patterns
Four real-world examples to get you building fast.
#include <LoraMesher.h>
LoraMesher& radio = LoraMesher::getInstance();
void setup() {
Serial.begin(115200);
// Initialize with default SPI pins
radio.begin();
radio.start();
Serial.println("LoRaMesher node started!");
Serial.printf("Node address: %X\n", radio.getLocalAddress());
}
void loop() {
// The mesh runs autonomously in the background
// Routes are discovered and maintained automatically
delay(1000);
}Open Source on GitHub
Read the source, open issues, contribute improvements, or star the repo to follow development.