lora network
x 0.55 · purpose 0.80 · t 3 wk · scope 0.70
from 2026-06
ESP32-C3 · LoRa · embedded C · solar/battery
I built a small off-grid wireless network for a walking trail, where the usual network infrastructure doesn’t reach. Six ESP32-C3 nodes with SX1262 radios pass multi-hop telemetry and pages along a LoRa mesh: five solar-recharged battery nodes in the field, 1–3 km apart, built for about 36 hours without sun on a roughly three-week service interval, and an always-on gateway at the trailhead. The figures are a simulation of the design, not recordings from the trail.
six points on a trail
A simulated trail mesh: the gateway at the trailhead and 5 field nodes in a line, 1 to 3 km apart. Two wake cycles replay: each field node’s telemetry floods along the line, then the gateway’s page to every node ("hello from the trailhead") floods up the trail. Every node rebroadcasts a new packet once with its ttl one lower (starting at 6) and drops copies it has already seen. Over both cycles: 39 relays, 42 duplicates dropped.
data
| node | role | km from the trailhead | frames sent | relayed | duplicates dropped |
|---|---|---|---|---|---|
| gw | gateway | 0 | 1 | 0 | 2 |
| n1 | field | 1.4 | 10 | 8 | 3 |
| n2 | field | 3.7 | 9 | 7 | 10 |
| n3 | field | 6.5 | 10 | 8 | 11 |
| n4 | field | 8.3 | 10 | 8 | 13 |
| n5 | field | 9.5 | 10 | 8 | 3 |
Six points sit along a thin trail silhouette, spatial without needing a map. A packet advances as a short pulse. There are no routes: every node that hears something new rebroadcasts it once with its ttl one lower, and drops the copies that come back. A page from the gateway floods up the trail the same way. The packet is momentary; the quiet space between events makes the relaying legible.
wake cycle
One simulated 10-minute wake cycle: each field node is awake about 5.4 s (listen, then sends each behind up to 500 ms of jitter and a CAD check) and asleep at least 99.1% of the time; the gateway listens throughout. Over cycles 0 to 11 the phase nudge pulls the field nodes' wake times from 2.8 s apart to 0.3 s.
data
| node | awake per cycle s | asleep % | cycle 7: frames sent | CAD busy | received |
|---|---|---|---|---|---|
| gw | always | 0 | 1 | 0 | 6 |
| n1 | 5.4 | 99.11 | 5 | 0 | 6 |
| n2 | 5.4 | 99.1 | 4 | 1 | 9 |
| n3 | 5.1 | 99.15 | 5 | 3 | 9 |
| n4 | 5.1 | 99.15 | 5 | 2 | 10 |
| n5 | 5.0 | 99.17 | 5 | 0 | 5 |
Every wireless packet has a cost in time and energy. Each field node sleeps for ten minutes, then wakes for a few seconds to sense, listen and send: a row of narrow open windows on a horizontal timeline. Sends wait a random moment and check the channel first, so neighbors waking together don’t talk over each other. The windows only work if neighbors are awake at the same time, so each node nudges its next wake toward any neighbor running ahead, and the mesh drifts into step without a shared clock. The gateway never sleeps.
node health
A simulated day of 144 wake cycles. Each field node reports battery_mv, charge_state (charging, full or idle, from the charger’s status pins), temp_c, humidity_pct, pressure_hpa, last_rssi and wake_count; batteries end the day between 4145 and 4161 mV. Field nodes relayed 2382 packets and dropped 2477 duplicates. The gateway keeps the latest telemetry per node. Nodes take turns every 6 s; arrow keys or a click choose one.
data
| node | battery_mv | charge_state | temp_c | humidity_pct | pressure_hpa | last_rssi | wake_count | heard | relayed | duplicates dropped |
|---|---|---|---|---|---|---|---|---|---|---|
| gw | 659 | 0 | 66 | |||||||
| n1 | 4157 | idle | 19.86 | 79 | 1005 | -92 | 144 | 653 | 455 | 198 |
| n2 | 4153 | idle | 21.06 | 78 | 1002 | -97 | 145 | 1164 | 481 | 683 |
| n3 | 4156 | idle | 20.55 | 77 | 998 | -95 | 147 | 1224 | 495 | 729 |
| n4 | 4145 | idle | 21.63 | 74 | 1000 | -94 | 147 | 1148 | 472 | 676 |
| n5 | 4161 | idle | 21.5 | 73 | 997 | -94 | 144 | 670 | 479 | 191 |
Selecting a node reveals only a few numbers: battery and charge state, temperature, humidity and pressure, the signal of the last packet it heard, and how much of what it heard it relayed or dropped as a duplicate. A thin battery trace and a small packet log say more about the network than a dashboard full of gauges. LoRa is the hardware’s primary long-range link, with solar recharge extending the intervals between physical service. The gateway is the node a person walks up to with a laptop: it keeps the latest telemetry from every node and takes pages over USB serial.