The IoT LoRa Gateway can be setup with a few different methods. In this tutorial we will show you how to set it up using our SD Card Image & LoRaWAN Provider The Things Network.
Our guide uses the pre-built SD Card image which has all of the software already installed and ready for use on it.
Reminder: Make sure the antenna is connected before turning the Raspberry Pi on
- Raspberry Pi & Gateway Hat Already Assembled
- SD Card – At least 8GB Class 10
- SD Card Reader
- Power Supply
- Ethernet Cable – If using a wired internet connection
Step 1 – Download our SD Card image
Begin by downloading the SD Card image from our Google Drive. Do this by going to http://pisupp.ly/iotsd, clicking on the zip file and confirming the download.
The version of the SD Card image may change over time with all previous verisons avialble in the archive folder. However the one in the main folder should be used.
After it has downloaded you do not need to extract the file.
Step 2 – Image the SD Card
Next we need to write the SD card, before we can do this we need to first download a tool to write the data to the SD Card. For this we recommend balenaEtcher (Previously Resin) as it’s compatible with most Operating Systems and is easy to use.
Download Etcher from https://www.balena.io/etcher & install it on your computer and then run it.
Next select the SD Card image by clicking Select Image, and navigating to where the zip file downloaded on your computer (Usually in your downloads folder).
Then select the SD Card you wish to have the image written to, this is usually the only one that shows up if you only have one SD card plugged in.
And then click flash! The software will now write the data to the SD Card and present you with this screen when completed.
If you have it where it says validation error then the image may not have been written correctly. Try removing the SD Card, plugging it back into your computer and repeating the process. If this then still fails you may have a faulty SD Card. The process can take 5-10 minutes depending on the speed of the SD Card, writer and computer.
Once completed you should get this screen.
Step 3 – Adding the gateway to the TTN Console
In this tutorial we are using The Things Network as our LoRaWAN Provider, The Things Network is a worldwide network where community members can setup gateways and use the network for their LoRa nodes.
The nodes transmit and can be picked up by any gateway that is setup with The Things Network and forwarded to your IOT Application.
Begin by going to https://console.thethingsnetwork.org/ and creating an account if not already signed up and then login.
You should be presented with a page like this.
Now click gateways and then on the top right of the gateway box click register gateway.
On this window you need to fill out the following fields:
Gateway ID: This has to be a unique ID, this can be anything you like but has to be unique.
Description: This can be anything you like for you to have a description of a gateway.
Frequency Plan: This is the frequency of the gateway and should match your gateway. As we’re in Europe I’ve selected the Europe 868Mhz Plan.
Router: This is the closest server to your location, as we’re in Europe I’ve selected Europe but you might find there is a router closer to you.
Note, At the moment we recommend that you use one of the TTN managed servers (Begin with ttn-router) for best results Some people have reported issues with the Australian Meshed Server & UK Digital Catapult server.
Location: The location of the gateway is handy to put in, while not required it may be useful in the future and for signal coverage mapping.
Antenna Placement: If the gateway and antenna is indoors then select indoors, if the antenna is mounted externally select outdoors.
All of these settings can be modified later except for the gateway ID
Next we want to modify a few settings.
Click on the settings tab and you should be able to see the settings we configured and then on the information tab to the left.
Then in brand type in Multi-channel Raspberry Pi gateway, it should auto complete.
And for model select Raspberry Pi with Pi Supply Gateway HAT.
Finally click update gateway and return to the main screen. The overview should look similar to this.
Step 4 – Plug it all in!
Now we’re ready for assembly, start by putting the RAK833 module into the Gateway HAT and then push the Gateway HAT onto the Raspberry Pi’s GPIO Headers.
Next place the heat sink on top over the silver part of the RAK833 Module, and finally make sure you have plugged an antenna into the gateway.
Put the SD Card into the Raspberry Pi and connect it to Ethernet (if not using wireless) and finally connect a power adapter.
You should see the Red light turn on on your Raspberry Pi and the Green LED Blink.
If your Red light doesn’t turn on or blinks intermittently then try a different power supply. If the Green LED Doesn’t blink at all repeat Step 2.
Wait for around 1-2 Minutes for the first time you boot your gateway while the initialization of Raspbian is completed.
Step 5 – Gateway Configuration
Finally we need to configure our gateway. To begin you will need to connect to your gateway from a computer on the same network.
Open a web browser, we have tested this in Google Chrome.
If you are on Mac OS or Linux you should be able to connect to your gateway by visitinghttp://iotloragateway.local , on Windows you will have to find the IP Address of your gateway. This can usually be done by looking at your router’s list of devices on the network and looking for the device with iotloragateway.
This is the home page for our IoT LoRa Gateway Mangement software. We want to configure our gateway so we visit the Change Configuration Page.
You will need to login, this is currently the same as the linux user’s username and password which is pi and raspberry.
On this page you will need to type in your email address in the first box. The gateway ID in the second box and copy and paste the Gateway Key from the TTN Console into the TTN Gateway Key Box.
You can see this side by side completed.
Now Click Update Configuration
To get the gateway to start we now need to go to the system controls tab at the top and click the restart button.
Once you click this button you will see a progress bar go across the screen and by the end the blue light should now be showing on the LoRa module and you will be re-directed to the homepage.
You should now be able to see your gateway’s ID, how many packet’s it has received and other handy information!
You can also use the Things Network Console to view packets live as they are received by your gateway. However for this to work a node must be transmitting LoRa Packets nearby!