DIY The Things Network LoRa Gateway using iC880A-spi and a Raspberry Pi
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.
-Raspberry Pi 3b+ (Everything newer then a Raspberry pi 2 should work)
-IMST iC880A-SPI LoRa Concentrator board
-Antenna and connector cable
-PCB Backplane (optional)
-3D Printed case (optional)
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 Pin
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”
Step 3: Click “Raspberry Pi OS (32-bit)”
Step 4: Click “Choose Storage”
Step 5: Choose your micro SD card
Step 6: Click “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.
Step 8: Click “Write”
Step 9: Start up the Gateway and SSH in to it using an program like Putty (Download at https://www.putty.org/)
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
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)
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.
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).
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