Skip to content

Aarushhiii/lorawan-network-simulator

Repository files navigation

📡 LoRaWAN Network Simulator

A Python-based simulator for LoRaWAN networks that models the effects of Spreading Factor (SF) on packet success rate, signal strength, battery life, and packet collisions.


📸 Output

Simulation Results


🔍 What It Simulates

  • Packet Success Rate — how reliably packets reach the gateway at each SF
  • Collision Rate — packets lost due to simultaneous transmissions on the same SF
  • RSSI vs Sensitivity — signal strength compared to minimum decode threshold
  • Time on Air — how long each transmission takes (affects battery)
  • Battery Life Estimate — estimated days on a 2000 mAh battery

🛠️ Tech Stack

Python Matplotlib NumPy


⚙️ Installation

git clone https://github.com/Aarushhiii/lorawan-network-simulator.git
cd lorawan-network-simulator
pip install -r requirements.txt

▶️ How to Run

Default simulation (20 nodes, 50 packets, 5km radius):

python lorawan_simulator.py

Interactive What-If mode — customize nodes, packets, and radius:

Run What-If mode? (y/n): y
Number of sensor nodes [default 20]: 50
Packets per node      [default 50]: 100
Network radius (m)    [default 5000]: 3000

📊 Spreading Factor Summary

SF Range Battery Life Time on Air Best For
SF7 Short Longest 56.6 ms Dense urban areas
SF8 Medium Long 103.4 ms Suburban
SF9 Medium Moderate 185.3 ms Mixed areas
SF10 Long Moderate 370.7 ms Rural
SF11 Longer Short 741.4 ms Remote areas
SF12 Longest Shortest 1482.8 ms Max range needed

📁 Project Structure

lorawan-network-simulator/
│
├── lorawan_simulator.py      # Main simulation script
├── requirements.txt          # Dependencies
├── README.md                 # This file
├── LICENSE                   # MIT License
└── assets/
    └── lorawan_simulation_results.png  # Output chart

🌱 Future Improvements

  • Add multi-gateway support

  • Simulate ADR (Adaptive Data Rate) (https://learn.semtech.com/mod/book/view.php?id=174)

  • Add real-world dataset comparison (https://zenodo.org/records/4121430#.YjMRoX_MJhE)

  • Export results to CSV : Done ✅

  • GitHub README Integration Tips • Render formulae with GitHub-supported LaTeX fencing: wrap equations in $$ ... $$ blocks in README.md • Embed lorawan_simulation_results.png at the top of the README so reviewers see results without running code • Use a Mermaid.js block to render the network topology diagram inline in the browser Add a Results section with a table linking each plot to its interpretation — reviewers rarely run notebooks


👩‍💻 Author

Aarushi Jain LinkedIn · GitHub


📄 License

MIT License — see LICENSE for details.

About

LoRaWAN network simulator modelling spreading factor effects on packet success, RSSI, collisions, and battery life — in Python

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages