LighthouseReckoning
LighthouseReckoning is a lightweight LoRa mesh networking library for Arduino-compatible microcontrollers, currently tested on ESP32 and RP2040 with SX126x LoRa radios.
What is LighthouseReckoning?
The goal is simple:
Sensor → Relay → Relay → Home
One node acts as the Home node. Other nodes automatically determine a path toward it.
A node does not need to know the entire network topology. Instead, nodes exchange information about their distance to Home and select a suitable neighboring node as their next hop.
For example:
Sensor
|
v
Sensor → Relay → Relay → Home
^
|
Sensor
This allows nodes to communicate over multiple hops without manually configuring routes.
How does routing work?
Each node keeps track of information about its neighbors and their distance to Home.
For example:
| Node | Distance |
|---|---|
| Home | 0 hops |
| Relay A | 1 hop |
| Relay B | 2 hops |
| Sensor C | 3 hops |
Sensor C can therefore forward its data toward Relay B, which forwards it toward Home.
When the network changes, nodes can update their routing information and select a different path.
Hop-by-hop reliability
LighthouseReckoning uses hop-by-hop confirmation instead of requiring one end-to-end acknowledgment.
Sensor C → Relay A → Relay B → Home
Sensor C only needs confirmation that Relay A received its packet. Relay A then handles the next hop independently.
This allows each node to deal with retries locally instead of requiring Home to maintain the state of every route in the network.
Using the library
A basic node can be initialized with:
#include <RadioLib.h>
#include <LighthouseReckoning.h>
LighthouseReckoning lhr;
void setup() {
// Initialize your LoRa radio here
lhr.beginAsNode(&radio, 0xA1B2C3D4);
}
void loop() {
lhr.update();
uint8_t payload[] = {0x01, 0x02, 0x03};
// Send application data when needed
lhr.sendData(payload, sizeof(payload));
}
The Home node uses beginAsHome() and can receive application data through the library's callback mechanism.
The library is designed to be non-blocking, so update() can be called continuously from the main loop.
Features
- Automatic multi-hop routing
- Home-based distance-vector routing
- Hop-by-hop confirmations
- Local packet retries
- Duplicate detection
- TTL protection
- Non-blocking operation
- Optional duty-cycle limiting
- ESP32 and RP2040 support
- SX126x radio support through RadioLib
Supported hardware
LighthouseReckoning is currently tested with:
- ESP32
- RP2040
- SX126x LoRa radios (SX1262)
The library uses RadioLib as its radio abstraction layer.
What's next?
The current version focuses on getting the routing and reliability layer solid. Future development includes additional protocol features, security improvements and further hardware testing.
Try it
The complete source code, protocol documentation, examples and field-test data are available on GitHub:
👉 LighthouseReckoning on GitHub
If you're working with LoRa, embedded networking, ESP32, RP2040 or distributed sensor networks — feedback and ideas are welcome.
Top comments (1)
Great to finally share LighthouseReckoning publicly. I built it to make multi-hop LoRa networking on Arduino-compatible hardware simple, lightweight, and reliable.
The project is currently tested with ESP32 and RP2040 + SX126x radios, with automatic routing, hop-by-hop confirmations, retries, and no internet connection required.
I'd really appreciate feedback, especially from people working with LoRa, embedded systems, mesh networking, or distributed sensor networks.
GitHub: github.com/TidalImpact/LighthouseR...