A LoRaWAN nodes' simulator to simulate a LoRaWAN Network.
LWN Simulator is a LoRaWAN nodes' simulator equipped with web interface. It allows to comunicate with a real infrastructure LoRaWAN or ad-hoc infrastructure, such as Chirpstack.
The project consists of three main components: devices, forwarder and gateways.
- Based specification LoRaWAN v1.0.3;
- Supports all LoRaWAN Regional Parameters v1.0.3.
- Implements class A,C and partially even the B class;
- Implements ADR Algorithm;
- Sends periodically a frame that including some configurable payload;
- Supports MAC Command;
- Implements FPending procedure;
- It is possibile to interact with it in real-time;
It receives the frames from devices, creates a RXPK object including them within and forwards to gateways.
There are two types of gateway:
- A virtual gateway that communicates with a real gateway bridge (if it exists);
- A real gateway to which datagrams UDP are forwarded.
- If you don't have a real infrastructure, you can download ChirpStack open-source LoRaWAN® Network Server, or a similar software, to prove it;
Tip
A ChirpStack instance can be easily started using Docker. You can find the instructions here.
You can download from releases section the pre-compiled binary file.
The simulator is written in Go, so you must have installed Go on your machine.
- You must install Go. Version >= 1.21
Note
Windows users should install GnuMake for Windows to use the makefile. If you use winget, you can install it with the following command:
winget install GnuWin32.Make
Firstly, you must clone this repository:
git clone https://github.com/UniCT-ARSLab/LWN-Simulator.git
After the download, you must enter in main directory:
cd LWN-Simulator
You must install all dependencies to build the simulator:
make install-dep
Now you can launch the build of the simulator:
make build
The binary file will be created in the bin
directory.
To run the simulator, you can:
- Run from the built binary file:
./bin/lwnsimulator // for Linux
./bin/lwnsimulator.exe // for Windows
make run-release // if you use makefile
- Run from the source code:
make run
The simulator depends on a configuration file (config.json
) which specifies some configurations for the simulator:
{
"address": "0.0.0.0",
"port": 8000,
"metricsPort": 8001,
"configDirname": "lwnsimulator",
"autoStart": false,
"verbose": false
}
address
: the address where the simulator will listen for incoming connections;port
: the port where the simulator will listen for incoming connections;metricsPort
: the port where the simulator will listen for incoming connections for metrics (Prometheus);configDirname
: the directory where the simulator will store the configuration files;autoStart
: if true, the simulator will start automatically the simulation;verbose
: if true, the simulator will print more logs.
More coming soon...