Adaptive LoRaWAN Network Optimization
Table of Contents
Introduction: The Challenge of Reliable LoRaWAN Networks
Long-range IoT networks, especially those using LoRaWAN, offer significant advantages for low-power, wide-area communication. However, real-world deployments introduce unpredictable factors that simulations often fail to capture. Signal attenuation due to obstacles, interference from other RF sources, and environmental changes can significantly affect transmission reliability.
Our goal was to develop a self-optimizing LoRaWAN network that dynamically adjusts its topology and routing to maintain stable communication. Initially, we designed an FPGA-based gateway and sensor nodes that would select optimal transmission parameters based on distance-based clustering. But when we took the system beyond controlled conditions and tested it in a real-world city-wide deployment, we realized that our assumptions were flawed.
What worked in simulations failed in the real world—signal quality fluctuated unpredictably, routing paths that were expected to be stable became unreliable, and manually adjusting the network was impractical. This project evolved from a traditional network optimization problem into a machine learning-driven adaptation challenge, where the network itself learned from its environment and continuously optimized routing strategies.
Building the Initial System
The foundation of this project was a LoRaWAN network architecture consisting of embedded sensor nodes and an FPGA-based gateway. Each sensor node was designed using STM32 and ESP32 microcontrollers, communicating with the gateway using LoRa modules (Waveshare SX1268). The FPGA gateway was responsible for managing communication, dynamically adjusting spreading factors (SF) for efficiency, and relaying data to a cloud-based dashboard for analysis.
To ensure reproducibility and rapid iteration, we also built a single-node prototype using a Raspberry Pi, allowing us to test configurations in a controlled environment before full-scale deployment.
Our initial approach assumed that geographic distance was the main factor affecting communication reliability. We calculated expected path loss using standard propagation models, then grouped nodes into clusters based on these distances. The plan was simple:
- Nodes within a cluster would communicate directly.
- Inter-cluster communication would be relayed through the strongest RSSI link.
- If no strong relay existed, messages would be multi-hopped through intermediate nodes.
The next step was deploying the system across the city to validate this approach.
Node | Location | Latitude (DMS) | Longitude (DMS) |
---|---|---|---|
A | Bürgerpark | 52°15'39"N | 10°31'15"E |
B | Schlossplatz | 52°15'49"N | 10°31'52"E |
C | Hauptbahnhof Braunschweig | 52°15'01"N | 10°32'17"E |
D | Heidbergpark | 52°14'12"N | 10°32'45"E |
E | Westpark | 52°16'10"N | 10°29'12"E |
F | Botanischer Garten | 52°16'25"N | 10°31'48"E |
G | Rathausplatz | 52°15'36"N | 10°31'33"E |
H | Wendenring (TU Braunschweig) | 52°16'05"N | 10°32'12"E |
I | Südsee | 52°13'55"N | 10°31'22"E |
J | Ölper See | 52°17'12"N | 10°29'35"E |
Field Deployment: When Reality Didn’t Match Simulations
We selected ten locations across Braunschweig, Germany, ensuring a mix of urban, suburban, and open areas to test how different environments affected LoRaWAN communication. The locations were carefully planned based on expected coverage areas and pre-calculated distances.
Each team member was assigned a node and deployed it at a designated location, where we recorded real-world RSSI values, packet loss, and transmission success rates over multiple hours. Our expectation was that nodes would form stable clusters as planned, allowing efficient message relaying across the network.
From | To | Transmit Power (dBm) | Packet Size (Bytes) | Simulated RSSI (dBm) |
---|---|---|---|---|
A | B | 22 | 32 | -85 |
A | B | 17 | 32 | -90 |
A | B | 13 | 32 | -95 |
A | B | 22 | 128 | -88 |
A | B | 17 | 128 | -92 |
C | D | 22 | 32 | -80 |
C | D | 17 | 32 | -85 |
C | D | 13 | 32 | -91 |
C | D | 22 | 240 | -83 |
C | D | 17 | 240 | -89 |
E | F | 22 | 32 | -78 |
E | F | 17 | 32 | -84 |
E | F | 13 | 32 | -90 |
E | F | 22 | 240 | -80 |
E | F | 17 | 240 | -86 |
G | H | 22 | 32 | -79 |
G | H | 17 | 32 | -85 |
G | H | 13 | 32 | -91 |
G | H | 22 | 240 | -82 |
G | H | 17 | 240 | -88 |
However, we quickly discovered that distance alone was not a reliable predictor of network performance. Some nodes that were physically close had weak connections, while others that were far apart maintained surprisingly stable links.
The biggest challenges were:
- Signal fluctuations due to interference, environmental obstacles, and urban reflections.
- Short-term inconsistencies in RSSI that made routing decisions unstable.
- Multi-hop relays failing intermittently, breaking our planned data paths.
It became clear that a static, distance-based clustering model would not work. Instead of manually reconfiguring the network, we needed a system that could adapt dynamically to real-world conditions.
Revising the Approach: From Distance-Based Clustering to Machine Learning
Our first attempt at solving these inconsistencies was to introduce a revised clustering method based on real-world RSSI data instead of just geographic distance. Using collected signal strength measurements, we applied unsupervised learning techniques like K-Means clustering to reclassify nodes into more realistic, connectivity-based groups.
From | To | Best Relay Node | Transmit Power (dBm) | Packet Size (Bytes) | Worst-Case RSSI (dBm) |
---|---|---|---|---|---|
A | B | Direct | 22 | 32 | -85 |
A | C | B | 22 | 32 | -90 |
A | D | C | 22 | 32 | -92 |
A | E | B | 22 | 128 | -95 |
B | D | C | 22 | 32 | -89 |
B | E | Direct | 22 | 32 | -86 |
B | F | E | 22 | 128 | -91 |
C | E | B | 22 | 240 | -93 |
C | G | Direct | 22 | 32 | -84 |
D | F | E | 22 | 128 | -90 |
D | H | G | 22 | 240 | -88 |
E | H | G | 22 | 128 | -86 |
F | I | H | 22 | 240 | -92 |
G | J | H | 22 | 240 | -91 |
H | J | Direct | 22 | 32 | -85 |
I | J | H | 22 | 128 | -88 |
While this approach improved routing stability, it still had limitations. Signal conditions fluctuated over time, meaning that even an RSSI-based clustering approach could become outdated as conditions changed. To address this, we explored methods to continuously adjust the network structure using real-time data.
The solution was a hybrid approach, incorporating:
- Short-term adjustments using network load and signal interference analysis. Instead of reacting instantly to every signal fluctuation, we used time-series forecasting models to detect persistent trends and smooth out short-term noise.
- Long-term adaptation using reinforcement learning techniques. We framed the routing problem as a multi-armed bandit problem, balancing the need for fast adaptation to changes while avoiding unnecessary reconfiguration due to temporary fluctuations.
Using these ML-based optimizations, the network became self-correcting, continuously refining its routing strategy based on real-world performance rather than static rules.
Final Results and Lessons Learned
After integrating machine learning, we re-ran field tests, now allowing the network to dynamically update its topology in real time. Instead of predefined clusters, nodes formed flexible, self-adjusting clusters based on live network conditions.
The final network design demonstrated:
- A significant reduction in packet loss, as multi-hop paths were adjusted dynamically based on real-time performance.
- Improved transmission success rates, as the system learned to ignore short-term fluctuations while still adapting to persistent changes.
- A robust routing algorithm that balanced fast reaction to network conditions with long-term stability to avoid unnecessary reconfiguration.
This transition from static planning to adaptive learning highlighted the limitations of traditional network modeling and the power of machine learning in real-world optimization.
Broader Implications and Future Work
This project reinforced a critical engineering lesson: real-world conditions rarely match idealized models. While path loss equations and distance-based clustering provided a good starting point, they failed to capture the complex interactions of interference, environmental changes, and network load.
By incorporating machine learning techniques, we transformed a manually optimized network into a self-optimizing system, capable of dynamically adjusting to changing conditions without human intervention.
Looking forward, this approach could be further expanded by:
- Integrating edge AI to allow nodes to make independent routing decisions rather than relying on a centralized optimization system.
- Testing reinforcement learning algorithms beyond multi-armed bandits, such as deep Q-learning, to refine routing policies even further.
- Exploring adaptive power control strategies, where nodes adjust their transmission power dynamically to optimize for both energy efficiency and network stability.
This experience demonstrated that engineering is not just about designing systems that work in theory, but about creating systems that can evolve and adapt in practice.
Conclusion
This project began as a traditional LoRaWAN network optimization problem, but real-world challenges forced us to rethink our approach. What started as a distance-based clustering model evolved into a machine learning-driven adaptive system, capable of dynamically adjusting its routing paths based on live network conditions.
By combining network analysis, machine learning, and real-world testing, we developed a self-optimizing LoRaWAN network that performs reliably even in unpredictable environments.
From | To | Initial Route | Initial RSSI (dBm) | Optimized Route | Optimized RSSI (dBm) | Improvement (%) |
---|---|---|---|---|---|---|
A | B | Direct | -92 | Direct | -85 | 7.6% |
A | C | B | -97 | B | -90 | 7.2% |
A | D | C | -100 | C | -92 | 8.0% |
A | E | B | -105 | B | -95 | 9.5% |
B | D | C | -95 | C | -89 | 6.3% |
B | E | Direct | -92 | Direct | -86 | 6.5% |
B | F | E | -100 | E | -91 | 9.0% |
C | E | B | -110 | B | -93 | 15.5% |
C | G | Direct | -90 | Direct | -84 | 6.7% |
D | F | E | -99 | E | -90 | 9.1% |
D | H | G | -96 | G | -88 | 8.3% |
E | H | G | -94 | G | -86 | 8.5% |
F | I | H | -100 | H | -92 | 8.0% |
G | J | H | -98 | H | -91 | 7.1% |
H | J | Direct | -91 | Direct | -85 | 6.6% |
I | J | H | -95 | H | -88 | 7.4% |
This transition from theory to practical, ML-based optimization highlights the importance of a multi-disciplinary approach—combining embedded systems, networking, and machine learning to solve complex problems. Instead of manually adjusting routing configurations, we built a system that learns and adapts on its own.
The next step is to explore how this approach can be expanded to larger IoT deployments, ensuring scalable, real-world adaptive networks for the future.