on
2020-11-25
12:34 AM
- edited on
2024-06-18
02:59 AM
by
Laurids_PETERSE
The usual free offer for a LoRaWAN server usually consists of only one network with up to 10 devices per registration. So the purpose of this tutorial is to show, that the Network server of the LoRaWAN network can be quite simple and running on a local PC.
For this tutorial I’ve selected this open-source server: https://gotthardp.github.io/lorawan-server
It acts as Network server only, so in comparison to Loriot or TTN, an Application server is needed to fully handle the frames.
The usual Application server is the Cayenne myDevices, but to show a real simple application, it is possible to communicate with the Nwk server using MQTT connection to a Node Red server.
1 End Node - STM32WL
2 Packet forwarder - STM32F7 Nucleo + RisingHF module
For the Nwk server only two things are needed. For the server itself to run, support of Erlang is needed. Then the server is just a zip package in case of binary format – or it is possible to compile from sources. In this tutorial I’m using 0.6.7 release of the Nwk server and Esl-Erlang OTP 23 on Windows x64.
https://github.com/gotthardp/lorawan-server/blob/master/doc/Installation.md#user-content-using-the-binary-release-on-windows
https://www.erlang-solutions.com/resources/download.html
Now that the server is successfully installed, it is possible to add Lora devices and networks. The configuration of the server itself can be kept as is, in default values. For LoRaWAN functionality with the node a network must be created. Resp. several straightforward steps must be taken:
First, to get the necessary information – GW MAC, we need to plug in the GW/packet forwarder and point it to our server. The F7 GW in this tutorial has AT command interface available via the ST-Link virtual COM port. To connect to it, simply plug in the micro usb cable to the blue extension board to power the GW and another micro usb cable to the ST-Link side. By default, the driver should be automatically installed, and the device should be able to connect. The connection parameters are 115200bps, 8bits, 1 stop bit, no parity. It is possible to use any com port terminal, in this tutorial it is Termite.
After powering the GW, or toggling the black Reset button, something like this should appear:
The GW can be anywhere in your local network, what is important, that the GW has an assigned IP address and that the LoraWAN server IP is pointing to the PC hosting the server. In this tutorial, I use direct wire connection to a laptop, so a static network must be defined in the Internet setting in Windows. Therefore, the steps 1-2 are not needed if the GW is connected to a router with DHCP IP assignment.
To add a network, Region depends on the country, in this case EU 863-870MHz, NetID can be 000000 for private network, Max Data Rate should be SF7 for EU. The rest can be left at default/suggested values. Just to note, not every parameter is required, but when one is missing, sometimes the popup window to inform the user does not appear.
Last step on the network server side is to define a group for devices which will be added. To do that, again a few steps is needed:
This is a joined device, but the information necessary to be filled is visible as well. Only the Node field is not necessary to fill out, as it is generated automatically by the network.
For the application server part, please continue to the second part of this tutorial here:
How to create a LoRaWAN server on local PC(2/2) - Application server
cmd window running "lorawan-server.bat" closes automatically when I start the "http://localhost:8080/admin" on chrome.
Please let me know the method to avoid it.
Thank you.
Hi Harish,
@Filip SCHWANK can help you with your question.
Hi Harish,
make sure that you have the Erlang OTP - preferably the v23 as described in the tutorial.
When you open the chrome tab, does the login appear or it crashes immediately?
Best regards,
Filip
Hi Filip Schwank,
Thanks for the reply.
I have reinstalled Erlang OTP V23 for windows and tried, but the same error persists.
Error on chrome:
This site can’t be reached
localhost refused to connect.
Login does not appear on the chrome tab.
Hi,
I installed the lorawan-server software succesfully, I'm using OTP V24.
But when I entered my gateway it is not possible to enter the Status info (not connected)
Maybe it has something to do with the Semtech-mote.
I'm using the TTIG gateway for connecting to thethings.network.
Please provide me with the needed info. I hope it's possible to connect to the TTIG GW.
Thanks!
Rob