OGN Tracking Protocol (OGNTP)

Introduction

The description of the Open Tracking Protocol follows.

Please note it is by no mean a complete specification (in its current state).
If you have particular doubt, questions or comments feel free to send us a message and we add the appropriate description here.
Same if you spot a mistake.

Modulation

Data is sent on a GFSK (BT=0.5) modulated carrier. Bitrate is 100kbps and Manchester encoding is used thus effective bit rate is 50 kbps.
The modulation is as used by the nRF905 chip, so that the already existing demodulator can be used. However, the existing Open Tracker hardware does not use nRF905 but other RF chips and modules: SPIRIT1, CC1101 and RFM69(H)W

Preamble and SYNC pattern

SYNC pattern is used to mark the start of a packet. It should be a sequence of bits with good autocorrelation properties. It should as well be sufficiently different from other protocols to avoid misreception and/or misinterpretations of other systems.

Preamble is the bit sequence sent by the RF chip before the SYNC pattern to allow for bit-level synchronization. Different chips send possibly different preambles, thus some care needs to be taken for the reception between different RF chips to work correctly.

Radio frame

The list of fields in the typical position frame. The actual layout of the elements is defined in the packet format.

Header field width [bits] range resolution unit Description Comment
Aircraft ID (address 24 0x000000-0xFFFFFF ICAO or OGN internal
Address type 2 0 .. 3 1=ICAO, 3=OGN
Address parity 1
Emergency flag 1 Manual or automatic emergency signalling Can be based on unusual movement parameters e.q. high sink rate or high spin rate. Internal pressure/acceleration/gyroscope/temperature sensors can be involved too.
Relay count 2 0 .. 3 0 = direct, 1..3 relayed frame Counts the number of time a frame has been relayed
Other data flag 1 Other than position data Can be meteo, thermal estimate, telemetry, … when set position data structure does not apply
Custom/encrypt flag 1 Data encrypted or format known to the (dedicated) listener When this flag is set, the data part has format defined by the owner of this device (or other parties, the owner wishes to inform)
Data field position data - other formats to be defined
Aircraft type 4 0 .. 15 glider, tow plane, helicopter, etc. Look at AircraftType for constants definition. TODO: do we have a C++ header file with these constants to point to ?
Stealth flag 1
Time 6 0 .. 59 1 sec UTC second, 0x3F=out of range
Latitude 24 +/- 90 0.0008/60 deg 1.5 meter accuracy
Longitude 24 +/- 180 0.0016/60 deg 3 meter on the Equator
GNSS Altitude 14 0 .. 61432 1 .. 8 meter Height above Geoid From the GPS receiver
Pressure altitude 9 +/-255 1 meter Difference from the GPS altitude From the pressure sensor, if installed
Climb rate 9 +/- 95.2 0.1 .. 0.8 meter/sec climb/sink rate Can come from GPS or barometer (if installed)
Difference between Standard Pressure Altitude and GNSS Altitude 9 +/- 255 1 meter if valid then altitude/climb are from the barometer For trackers with a barometer and an algorithm to correlate GPS altitude with pressure
Speed 10 0 .. 383.2 0.1 .. 0.8 meters/sec ground speed
Heading 10 0 .. 360 0.1 deg ground track heading
Turn rate 8 +/- 47.2 0.1 .. 0.8 deg/sec ground track turning rate
GPS fix mode 1 0=2D, 1=3D
GPS fix quality 2 0=no fix, 1=GPS, 2=D-GPS, 3=other Tracker can still transmit its (last known) position after GPS lock is lost (for whatever reason)
GPS DOP 6 GPS Dilution of Precision

The header is 4 bytes and the data portion of the radio frame takes 16 bytes.

Note: several fields have variable resolution coding, so that a greater range can be accommodated within a limited bit width while keeping relative resolution relatively constant.

Forward Error Correcting (FEC) code

For best reception range, with limited power, technique known as Forward Error Correction (FEC) can help.
By introducing additional, redundant information, transmission errors can be recovered by the receiver and the reception S/N threshold is effectively lower thus increasing the range.

Code chosen for the Open Tracker is Gallager code or Low Density Parity Check (LDPC) code. It is simple and decoding can be done by successive iterations and it accepts soft bit information from the demodulator.

The redundant information in this case is 48 bits = 6 bytes.

Packet relay

One particular feature of the Open Tracker is the capability to relay packets of other trackers.
The main goal is to relay packets of lower flying aircraft (or those on the ground) by the high flying aircraft, so the positions of those below have a chance to be caught by the ground receivers as the radio range heavily depends on the altitude.

Implementations

The protocol described here was implemented on SPIRIT1 RF chip (see the main OGN Tracker page). Then It was done as well on the CC1101 and RFM69(H)W RF chips/modules. In all cases the signals could be properly received on the DVB-T receiver, reception on SPIRIT1 and RFM69(H)W was tested as well. Some but not all combinations or reception between different RF chips have been positively tested, others are awaiting tests.

For all those implementations the Manchester encoding was done in software, not by the RF chip hardware. This gave more flexibility in programming the chip and on reception allowed for detections of transmission errors which made the error correction logic more efficient.

More complete list of implementations of the OGN-Tracker on various platforms
Platform CPU RF chip OS/dev-env Available industrial modules Software
1st Prototype STM32F4 SPIRIT1 g++
DIY-Tracker STM32F1 RFM69 FreeRTOS/g++ separate CPU,RF and GPS modules
ATmega32 CC1101
Adafruit Feather M0 SAMD21 RFM69 FreeRTOS/Arduino Adafruit Feather with RFM69 or RFM95 but needs a GPS
ESP32-OGN ESP32 SX1276/SX1262 FreeRTOS/ESP-IDF TTGO T-Beam (complete) and many other ESP32 modules but without GPS
HELTEC CubeCell STM32 SX1262 PlatformIO/Arduino HELTEC CubeCell ASR6502 with GPS (complete)

Probably the TTG T-Beam is the module to use if you want to construct an OGN-Tracker: it is well available, it has good GPS and ISM antenna, options like Bluetooth and WiFi.
Just insert the 18650 battery and there you go.
If 18650 is too heavy for your application, you can easily cut off the battery basket and solder a flar Li-Ion battery or not use the battery at all and run on external 5V supply.
Be very carefull with the battery polarity - do not connect it in reverse !

Encoding the packets

For exact packet format and encoding please refer to the source - see the [https://github.com/pjalocha/esp32-ogn-tracker/tree/master/main] in our GIT repository.
See here a demo code how to use the code to produce proper OGN packets which can then be transmitted through the radio chip.

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include <sys/time.h>

#include "ogn.h"                                   // OGN packet format
#include "ldpc.h"                                  // Low Density Parity Code encoder and decoder

int main(int argc, char *argv[])
{
  OGN_TxPacket<OGN1_Packet> TxPacket;              // OGN packet to be transmitted

  TxPacket.Packet.HeaderWord = 0;                  // start with clean header
  TxPacket.Packet.Header.Address  = 0x123456;      // set address: 24-bit number
  TxPacket.Packet.Header.AddrType = 3;             // set address-type: 3 is OGN-type
  TxPacket.Packet.calcAddrParity();                // set the address-parity bit

  TxPacket.Packet.Position.AcftType = 0xD;         // set the aircraft-type: drone
  TxPacket.Packet.Position.Time = 15;              // [sec] time corresponding to the position
  TxPacket.Packet.Position.FixQuality = 1;         // 0 = none, 1 = GPS, 2 = Differential GPS (can be WAAS)
  TxPacket.Packet.Position.FixMode    = 1;         // 0 = 2-D, 1 = 3-D
  TxPacket.Packet.EncodeDOP(15-10);                // [0.1] setDilution-Of-Precision to 1.5
  TxPacket.Packet.EncodeLatitude(5012345*6);       // set Latitude to 50.12345 deg north
  TxPacket.Packet.EncodeLongitude(2012345*6);      // set Longitude to 20.12345 deg east
  TxPacket.Packet.EncodeAltitude(1200);            // [m] set GPS altitude to 1200 m AMSL
  TxPacket.Packet.EncodeStdAltitude(1250);         // [m] set standard pressure altitude to 1250m
  // TxPacket.Packet.clrBaro();                    // or signal the pressure altitude is not available
  TxPacket.Packet.EncodeSpeed(355);                // [0.1m/s] set the ground speed 35.5 m/s
  TxPacket.Packet.EncodeHeading(1305);             // [0.1deg] set track-over-ground to 130.5 deg
  TxPacket.Packet.EncodeClimbRate(+45);            // [0.1m/s] set climb rate to +4.5 m/s
  // TxPacket.Packet.clrClimbRate();               // or signal climb rate is not available
  TxPacket.Packet.EncodeTurnRate(+15);             // [0.1deg/s] set the ground turn rate to 1.5deg/sec
  // TxPacket.Packet.clrTurnRate();                // or signal the turn rate is not available
  TxPacket.Packet.Print();                         // print the encoded information
                                                   // Note: we decode before whitenning the data part

  TxPacket.Packet.Whiten();                        // whiten the data portion of the packet
  TxPacket.calcFEC();                              // calculate the redundancy part of the packet

  printf("Header: Data [FEC] => ");
  TxPacket.Dump();                                 // dump as 32-bit words
  printf("Bytes:");
  TxPacket.DumpBytes();                            // dump as bytes, to be transmitted on the air after the SYNC

  return 0; }

When you run the code you get the printout of the 26 bytes you need to transmit in the OGN packet

 D:3:123456 R0  1/3D/ 1.5 15s: [+50.123447,+020.123453]deg 1200m[+50m] 35.5m/s 130.4deg +4.5m/s +1.5deg/s
Header: Data [FEC] => 0B123456: E9B75B48 4D917BCF D63A3178 0700C5B9 [2F0E3A3B 39A1] (0)
Bytes: 56 34 12 0B 48 5B B7 E9 CF 7B 91 4D 78 31 3A D6 B9 C5 00 07 3B 3A 0E 2F A1 39

Transmitting the packets on the air

Radio/modem parameters
Parameter Value Unit Comments
Frequency 868.2/868.4 MHz the two given frequencies are for Europe and Africa
Modulation GFSK BT=0.5
Freq. deviation +/-50 kHz
Chip rate 100 kbps
Bit rate 50 kbps Manchester encoded thus the chip rate twice as high
Packet size 26 bytes
SYNC size 4 bytes
SYNC pattern
Output power 14 dBm
Antenna dipol
Polarization vertical

Various aspects of the radio protocol for position reporting of drones and possibly other aircraft

Refer to the document

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License