f t g m
Copyright 2024 - Internet Of Things & M2M Communication Experts

Technology Blogs

Build Low Cost Development LoRa Gateway (Raspberry PI + Multitech MTAC)

Assumption is that you know what LoRa technology. Howevever, if you are not familiar with it basics are:

Topology used by LoRaWan network is laid out in star-of-stars topology. End-devices communicate with gateways that relay messages to network servers. Gateways use sophisticated digital baseband chip (SX1301) that use DSP to simultaneously decode up to 8 frequencies at any data rate. There is a lot more to it than just SX1301 (two more chips are required SX1257 and quite some more circuitry to tune front end RF circuits to 433MHz, 868MHz, 915 MHz or any other frequency band). Best place to get more info is LoRa Aliance.

In most cases focus of our development are end-devices. However in order to test them we need full LoRaWan configuration (end-device, gateway and network server). We can get them all at low-cost.

  1. LoRaWan End-device - it collects some data from real-word and it uses LoRaWan to send them to network server via LoRa gateway. You must provide one, build one, get evaluation board, etc. End-devices typically use SX1276 or similar chipsets (Microchip is another manufacturer of end-device RF chipsets). Assumption is that you have one and that you want to test its connectivity over LoRaWan.
  2. LoRaWan Gateway - We are about to build it using Raspberry PI and Multitech MTAC mCard + USB to PCI-E adapter)
  3. LoRaWan Network server - You can find open source version of the server and start there but best option is to create an account with The Things Network and forward packets to public LoRaWan network created by you.

Hardware Required

We've done it all based on the original article written by our coleagues at Mirakonta (http://www.mirakonta.es). We'd like to stress that this type of gateway should be used only for lab evaluation and development purposes.

Original article is at: https://github.com/mirakonta/lora_gateway/wiki

Our experiences varried a bit, hence this article and we'll outline differences.

Hardware components that we'll need are:

  • Raspbery PI Computer
     (Since this article was written we also tried and succeeded in compiling and running LoRa GW and packet forwarder on Beaglebone black board).

  • MultiTech MTAC Card (915MHz for US or Australia or 868Mhz for EU)

  • Mini PCI-E Wireless WWAN to USB Adaptor (look in ebay there are always some variants on sale).Please note that original miraconta article suggested that hardware modifications were required on this board (Part 2). We've done it as per article and it all worked. Once we got it all going we tried it in card without modification and it still worked. Your experiences might vary depending on the type of PCI-E adapter you have.

 Software


We followed Part 3 of original Mirakonta article and  in our case it did not work out of the box. We could see packets being sent to TTN server but none were coming back from TTN server. After trying several things with config and no success we tried getting packet_forwarder and lora_gateway sources from TTN git repositories. So instead of git cloning from https://github.com/mirakonta we cloned it from https://github.com/TheThingsNetwork.

The rest was the same so just to make it simplier here are the correct command lines you need to run:

mkdir ~/lora
cd ~/lora
mkdir exec
git clone https://github.com/TheThingsNetwork/lora_gateway.git
git clone https://github.com/TheThingsNetwork/packet_forwarder.git
cd ~/lora/lora_gateway make clean all
cd ~/lora/packet_forwarder make clean all
cp ~/lora/packet_forwarder/basic_pkt_fwd/basic_pkt_fwd ~/lora/exec/
cp ~/lora/packet_forwarder/gps_pkt_fwd/gps_pkt_fwd ~/lora/exec/
cp ~/lora/packet_forwarder/gps_pkt_fwd/global_conf.json ~/lora/exec/
cd ~/lora/exec

I'll not get into all the details on how to configure packet forwarder to forward packets to correct TTN server. In general you should configure your band plan and network servers as per following article: TTN Server Addresses

And finally as we don't have GPS based board we used basic packet forwarder instead:

sudo ./basic_pkt_fwd

This gateway is located in our lab and it is part of The Things Network Sydney/Australia TTN Community. Geteway supports Class A LoRa devices, it supports OTA and will forward packets to TTN server. In order to get your devices to join TTN network and check your data on the server you'll need to add end-device details (DevEUI amd AppKey]. Refer to following for details on actual configuration steps: TTNCTL