achildrenmile.github.io

View on GitHub

LoRa Wan Gateway and The Things Stack

2021-03-13 #Blog | #LoRaWan | #LoRaWanGateway

In the post “Lora MQTT Gateway” it was shown how to create a LoRa application scenario using 2 TTGO’s as gateway and sender and consume messages using #MQTT. As LoRa offers a lot of possibilities and once you dig in deeper, you’ll come to TheThingsStack network and this offers a lot of ideas and possibilities. The Things Stack project is community driven and a great way to make the #LoRaWan technology public available. So, the decision was made to place a public #LoRaWanGateway in Nötsch im Gailtal.

What is LoRaWan?

According to the LoRa Alliance: “LoRaWAN® network architecture is deployed in a star-of-stars topology in which gateways relay messages between end-devices and a central network server. The gateways are connected to the network server via standard IP connections and act as a transparent bridge, simply converting RF packets to IP packets and vice versa. The wireless communication takes advantage of the Long Range characteristics of the LoRaÒ physical layer, allowing a single-hop link between the end-device and one or many gateways. All modes are capable of bi-directional communication, and there is support for multicast addressing groups to make efficient use of spectrum during tasks such as Firmware Over-The-Air (FOTA) upgrades or other mass distribution messages.”

You can find more information here.

What hardware is used

The hardware rollout

The LoRaWan router is powered using Power-over-Ethernet (POE). The first step was to configure the network. As the LoRa gateway will be available for public use, I seperate port on the Layer-3 switch using port isolation was used to connect this router. Furthermore, a new VLAN network was created and POE passive activated. After the configuration the “hard” part started.

Lora Wan Antenna

Lora Wan Router

Gateway configuration

The configuration the gateway is described in the official documentation of TTS or if you prefer videos I can highly recommend the videos from Alex(AEQWeb)[german].

MikroTIK

Once the router is powered on, you can connect to the network interface and configure this accordingly.

The Thing Stack (TTS)

The configuration can be done using TTS Console. Here you have to add the gateway information and do the neccessary configuration.

Test the communication with a #LoRaWAN client

The client code can be found here.

Side note: This will give you a rough overview about the software steps. In case you have not yet programmed in Arduino Studio and no experience there are several tutorials out there like e.g. randomnerdtutorial.

After uploading the client will connect to LoRa and start sending messages. The status should look somewhat like this:

Information how the device casing was created can be found at Instagram.

Lora Wan Client

And you should retrieve the information in your router and in the TTS console:

Lora Wan Router Log

Lora Wan TTS console

Gateway is public available

The gateway is now up-running and available for public use. Subesequently, range tests will follow. Wish you a lot of fun and learning using #LoRaWan!