Making A LoRa Gateway

 

A nice thing about LoRa is that the receiver needs very very little processor power - even a lowly PIC or AVR has plenty enough power to do the job - because the hard work is done inside the LoRa chip.  However, having received the data it would be good to upload it to the internet so that others can follow the flight on a map, and/or view the pretty pictures being received, and for this a Raspberry Pi is ideal.

So to build a LoRa gateway you need:

  • Pi In The Sky LoRa board
  • Raspberry Pi A+ or B+ or V2 B
  • Internet connection to the Pi (wired or wireless)
  • 70cm (434MHz) antenna

The LoRa board is exactly the same as used by the tracker.

Note: You can also use LoRa 868MHz modules in which case the antenna needs to be different

LoRa Board

The above board is populated with 2 LoRa modules, so it can be used to listen on 2 separate frequencies at the same time.  Our software supports the use of 1 or 2 modules, and either can be 434 or 868 MHz versions.

Physically install is very simple – just push on to the Pi using a standard pin header extender (supplied).  Or a pin header with extended pins can be used if you want to stack another board on top.

Software Installation

Next, burn an operating system onto a suitable SD card.  For this purpose anything from 4GB should be fine.  The following instructions are for Raspbian, and no other operating systems have been tested.

First, run raspi-config:

sudo raspi-config

Then expand the filesystem, as you would normally do, then choose Advanced Options –> SPI and enable SPI.

It’s also worthwhile to change the hostname (Advanced Options –> Hostname) to something like "LoRaGateway".  Finally, close the program and agree to reboot the Pi.

Once rebooted, login again.  We now have some software to install.  First, install wiringPi, which is used for the SPI library and to read the status of the LoRa module via 2 of its INT pins:

cd ~
git clone git://git.drogon.net/wiringPi
cd wiringPi
./build

The gateway software uses the curl library for internet access (uploading telemetry data and/or image data), so install that:

sudo apt-get install libcurl4-openssl-dev

and the ncurses library used for the screen display:

sudo apt-get install libncurses5-dev

Finally, install the gateway software itself:

cd ~
git clone https://github.com/PiInTheSky/lora-gateway.git
cd lora-gateway
make

That completes the installation, so now for the configuration.  The main settings are in a file gateway.txt in the above folder (/home/pi/lora-gateway).  Here’s a simple example:

tracker=MYCALLSIGN
frequency_0=434.450
mode_0=5
AFC=Y

This firstly sets your callsign, which if you are a radio amateur would normally be your radio callsign, but it can be something else.

The next part sets the frequency and mode for the first LoRa device (the one in position “CE0”).  Frequency is in MHz and should match the frequency of the tracker that you intend to receive.

For full details on all settings see the README.md file in the /github repository.

Usage

To run, just type

sudo ./gateway

and you will see a screen like this:

Now start up your tracker and, all being well, you should soon start to see the packets landing at the gateway:

Published on