DIY The Things Network LoRa Gateway using iC880A-spi and a Raspberry Pi

DIY Internet of Things for everyone

DIY The Things Network LoRa Gateway using iC880A-spi and a Raspberry Pi

Introduction

In this post i am going to make a The Things Network LoRa-WAN gateway using an Raspberry Pi 3b+ connected to an IC880a-spi lora concentrator board.

Parts required

-Raspberry Pi 3b+ (Everything newer then a Raspberry pi 2 should work)

-IMST iC880A-SPI LoRa Concentrator board

-Antenna and connector cable

-Jumper wires

-PCB Backplane (optional)

-3D Printed case (optional)

Wiring

In order to get the Raspberry Pi to communicate to the LoRa concentrator we first got to connect it to the Raspberry Pi. There are two ways of doing this. U can do this with some simple jumper wires. but you can also connect them directly using an pcb backplane. Down below i explain which pins need to connect to each other. Make sure to look at the reference images to assure u done it right.
Do not power it on after you are done. First you got to connect the antenna. Powering on the gateway without an antenna may result in permanent damage to the LoRa Concentrator. There are two antenna ports on the board. Down below is an image that shows which port u need to use.

Raspberry Pi PinIC880a-SPI PinInfo
2215V
622GND
1916MOSI
2115MISO
2213Reset
2314CLK
2417NSS
Raspberry Pi 3B+ Pinout
iC880-spi Pinout
Antenna Connection reference
Optional PCB Backplane
Cable reference

Preparing the Raspberry Pi

After you are done wiring the hardware it is time to prepare the Raspberry Pi. We are going to install the Raspberry Pi OS to an SD card.

Step 1: Download the Raspberry Pi imager at https://www.raspberrypi.com/software/

Step 2: Open the Raspberry Pi Imager and click “Choose OS”

Choosing OS

Step 3: Click “Raspberry Pi OS (32-bit)”

Choosing the right version of the OS

Step 4: Click “Choose Storage”

Choosing Storage

Step 5: Choose your micro SD card

Choosing SD Card

Step 6: Click “Settings”

Choosing Settings

Step 7: Now set the hostname of your gateway. Enable SSH and set your username and password. Optionally you can also enable wifi here. Don’t forget to set the region options if u do.

Presetting Settings

Step 8: Click “Write”

Writing to SD Card

Step 9: Start up the Gateway and SSH in to it using an program like Putty (Download at https://www.putty.org/)

SSH Into Pi

Installing the Software

Step 1: enter the following command “sudo raspi-config”

Now go to option 3, Interface Options. After that go to option I4, SPI. Make sure this is enabled

Enabling SPI
Enabling SPI

Step 2: Enter the command “sudo apt-get install git”

Step 3: Enter the command “git clone -b spi https://github.com/ttn-zh/ic880a-gateway.git ~/ic880a-gateway”

Step 4: Enter the command “cd ~/ic880a-gateway”

Step 5: Enter the command “sudo ./install.sh spi”

Now It should ask you some questions about where your gateway is located. enter these details.

When the command-line output is showing “Detected EUI *number* from eth0” Write down or copy this number. This is very important since you gonna need this later! (this number is blurred with red in the image)

Installing the gateway Software

Registering your Gateway

Now we need to register our gateway at The-Things-Network.

Step 1: Go to https://console.cloud.thethings.network/ and select your region.

Step 2: Navigate to “Gateways” and find the button “Add Gateway”

Step 3: Now enter a name for your gateway and the EUI that u wrote down earlier. (Blurred with red in the image)

Step 4: Set the right region information.

Registering your new gateway

Wrapping Up

Your gateway should now connect to The-Things-Network. this may take till 24hours to show up on the website. (This is what happened to me at least).

Online Gateway

I Installed the gateway in a 3D Printed case found on Thingiverse. I found 2 options. A open case and a closed case. I also designed an antenna holder for the open case.

Open case: https://www.thingiverse.com/thing:1531261

Open case antenna holder: https://www.thingiverse.com/thing:5426720

Closed case: https://www.thingiverse.com/thing:2609466

Credits to this guide, it helped me out a lot: https://github.com/ttn-zh/ic880a-gateway/wiki

Open case
Closed case

Tags: , ,

One Response

  1. Mark says:

    Thanks for your blog, nice to read. Do not stop.

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Appliance - Powered by TurnKey Linux