UKHAS Wiki

UK High Altitude Society

User Tools

Site Tools


guides:lora_tracking_guide

This is an old revision of the document!


Beginners Guide to Tracking using LoRa

Many flights now use LoRa (Long Range modem) devices for tracking, either instead of or in addition to RTTY tracking. This is a short guide on how to receive and upload (to the UKHAS servers) live tracking data and/or images (SSDV) from a balloon sending out LoRa telemetry/SSDV.

Hardware

The minimum needed to receive and decode LoRa are:

  • LoRa Transceiver
  • Microcontroller with SPI interface
  • Suitable antenna
  • Power

These are some examples of working systems that people have built:

  • AVR + LoRa + 2-line LCD + battery power - see this example
  • AVR + LoRa + FTDI USB-TTL adapter for connection to a PC/Mac
  • AVR + LoRa + Bluetooth + LiPo - see this example
  • Raspberry Pi + LoRa - see this
  • Pi + LoRa + GPS + touchscreen LCD - see this

Some just show the balloon position; some also upload telemetry/SSDV to the UKHAS servers, and some offer a distance/direction to the balloon or even road navigation.

Software

Basic software for LoRa can be very simple, since the LoRa modules do the hard work of decoding the radio signals into data. All that's needed is some code to set the frequency and mode of the LoRa device (“mode” being broadly equivalent to baud rate, USB/LSB etc. for RTTY), test for when a packet has been received, accept that packet and then do something with it. A simple AVR or PIC processor with SPI interface and a few hundred bytes or so of RAM is enough for this.

Most though, receivers need to be able to upload to the internet, which of course requires some sort of internet connection. Whilst these exist for microcontrollers, it's easier to use something like a Raspberry Pi that has a LAN interface built-in, or can be used with a USB-connected WLAN device. The software then needs to be able to decide the type of incoming packet (e.g. telemetry or SSDV or something else) and then upload to the correct server. The rest of this article explains how to build such a device (a LoRa HAB gateway) using a Raspberry Pi, one or two LoRa modules on a suitable board, an internet connection, and this LoRa gateway software.

Gateway - Hardware

It's simple to build a gateway using a Pi prototyping board and one or two LoRa modules. Most LoRa HAB flights use the 434MHz HopeRF RFM98 but some use the 868Mhz HopeRF RFM95. Connections to the Pi are simple:

  • LORA PI
  • 3.3V 3.3V Power
  • GND Ground
  • MOSI MOSI
  • MISO MISO
  • NSS CE0 (CE1 for 2nd module)
  • SCK SLCK
  • DIO0 Any free GPIO pin
  • DIO5 Any free GPIO pin

Or you can buy a board designed for the task.

Gateway - Software

Install Raspbian on an SD card as usual, and boot the Pi from it. Then run:

  • sudo raspi-config

and enable SPI.

If you are using Raspbian Lite (recommended if you are dedicating the Pi to this task so don't need the X desktop) then you need to install git:

  • sudo apt-get install git

Install WiringPi as follows

  • cd
  • git clone
  • cd wiringPi
  • ./build

Install SSDV (to decode and store images locally):

Install these libraries:

  • sudo apt-get install libcurl4-openssl-dev
  • sudo apt-get install libncurses5-dev

Finally, install the gateway software itself:

Gateway - Configuration

All configuration items are held in /home/pi/lora-gateway/gateway.txt which you can edit with any text editor (e.g. vim, nano if you're a noob, or emacs if you're a bit weird). The first part of the file contains general configuration for the installation, which normally you would only need to edit once:

  • tracker=YOUR_CALLSIGN - Put in whatever you like for the callsign (e.g. your ham radio callsign or IRC nick)
  • EnableHabitat=Y - Leave this is “Y” for “Yes” to upload telemetry to Habitat. “N” is useful for payload testing.
  • EnableSSDV=Y - Leave this is “Y” for “Yes” to upload SSDV to the SSDV server. “N” is useful for payload testing.
  • JPGFolder=ssdv - this is the folder (relative to /home/pi/lora-gateway) where SSDV images will be stored.
  • LogTelemetry=Y - Leave this as “Y” to append telemetry to /home/pi/lora-gateway/telemetry.txt
  • LogPackets=Y - Leave this as “Y” to append packet information to /home/pi/lora-gateway/packets.txt
  • CallingTimeout=60 - If the tracked payload uses calling mode, then the gateway will return to original frequency (calling channel) after this number of seconds.
  • ServerPort=6004 - The program emits JSON tracker telemetry to this port.
  • Latitude=0.0 - Your position
  • Longitude=0.0 - Your position
  • Antenna=Watson W-50 - Your antenna
guides/lora_tracking_guide.1466447357.txt.gz · Last modified: 2016/06/20 18:29 by daveake

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki