Use ChirpStack as LoRa ServerΒΆ
Please refer to the official website for more information. https://www.chirpstack.io/guides/docker-compose/
Install
docker.Clone the repo
https://github.com/brocaar/chirpstack-docker.git.docker-compose up.Open a browser, visit the default application server
https://localhost:8080.Login with default username and password, both are
admin.Setup a network-server. The default is
chirpstack-network-server:8000.Create
Service-profiles.Create
Device-profiles.Register a gateway, and fill in a Gateway EUI.
Create an application, select a service profile.
Click the application name, and create a device belongs to the application. * Fill in a Device EUI, * Choose a device profile, * Optional: uncheck the frame-counter validation for convenient test.
After click the CREATE DEVICE button,
NwkKeyandAppKeyneed to be filled (For LoRaWAN 1.0.2, onlyAppKeyis needed), then the configuration of ChirpStack server is completed.Now, we can use lora-motes-emulator to issue join request in OTAA mode. (This part is also shown in README.rst) * Prepare the config files.
# For LoRaWAN 1.0.2, copy the template file
config/device102.yml.tplasconfig/device.yml, for LoRaWAN 1.1, copy the template fileconfig/device.yml.tplasconfig/device.yml. # Modify thedevice.ymlfile and fill in the information according to the register information at step 8. # Copy theconfig/config.yml.tplasconfig/config.yml, fill in the IP and port information of ChirpStack server (Default port number is 1700).Start the
pipenvenvironment bypipenv shell.Send a PULL_DATA to ChirpStack server by
python main.py pull.Send a join request message to ChirpStack server by
python main.py join.If the join accept message is decoded successfully, we can check the device information by
python main.py info.An Uplink message can be sent by
python main.py app -m YOUR_MESSAGE, which can also combine with MAC command by option-f MAC_COMMAND_ID.
Key Points: * The Uplink data rate index and the Channel index is required to calculate the MIC field (B1 message) in version 1.1.