RAK831 GATEWAY SETUP WITH RASPBERRY PI

ABOUT THIS STORY

Introduction

Lately, I have been working with LoRAWAN and I don’t have Lora gateway around. As you might be knowing LoRAWAN network requires a gateway to push data to the internet. As Lora is not an IP based protocol the gateway helps it in doing so. Basically, multiple LoRAWAN nodes transmit data to the gateway and the gateway transfers the concentrated data to server backend. Server backend which resides in the cloud contains a network server which helps in managing the network and the application server which is responsible for the data and UI. For that, I have used The Thing Network Server.

There are a lot of gateways available as a commercial product and also DIY products and I went with the RAK831 module by RAK Wireless. The module is cheap and works with Raspberry Pi as well so quite handy in terms of DIY. So this project is going to be how to configure and use the gateway with the Raspberry Pi.

Preparing the Pi

The first thing we need to do is assemble the Raspberry Pi and the gateway if it is not already assembled. It is pretty much straightforward, but you can check the video for that.

After that, we need to prepare the SD card by flashing the Raspbian Lite. You can download the latest version of the OS from here. For flashing the OS you can use Etcher. After OS get flashed to the SD card (I have used 4 GB one) don’t forget to create a file named SSH (without any extension) to the SD card, which will enable SSH connection to the Pi.

After booting the Pi with the SD card and having an SSH connection, next is to install the required packages for the gateway,

First, we need to update the pi, followed by installation of git. After that SPI has to be enabled from raspi-config.

It will prompt for remote configuration setup or local. You can select anyone but if you are going for the remote you need to push config file to github.com/ttn-zh/gateway-remote-config repository. You can do so by adding your config file to the repository and making a pull request, and it might take up to 24 hours for them to approve. You need to copy the EUI from here which will be used while registering the gateway with TTN.

After that just fill up the details as prompted.

Now the gateway has to be registered to TTN and for that get into TTN Console. If you don’t have an account you will be

prompted to create one. Click on Gateways and select add a new gateway.You will be prompted to fill in some details so fill it up. The important thing is to fill the Gateway ID (Paste the copied device EUI)and select the legacy packet forwarder.