FLARM w szybowcu (zdjęcie: Sebastian Lampart)

Tracking gliders, airplanes, helicopters and baloons, part 3 – FLARM

We already know how to track airplanes using DVB-T USB dongle and Orange Pi or Raspberry Pi. Let’s move on to a new system that allows tracking of light aircrafts:

  • gliders
  • helicopters
  • baloons
  • smaller airplanes
Sender/reciever for glider (photo by: Sebastian Lampart)
Sender/reciever for glider (photo by: Sebastian Lampart)

FLARM – is a collision avoidance system for light aircrafts, popularized and approved by EASA, gaining traction, used mainly on gliders in Poland and Europe. We’re not going to use it to avoid collision – but to receive position and track light aircrafts – so we can share them on the OGN procest’s map – OPEN GLIDER. There are few station in Poland – let’s build a more robust network, so that gliders can be safer and their records – recorded.

What will you need?

Hardware:

  • Orange Pi Zero or Raspberry Pi
  • DVB-T USB Dongle. Look for the upgraded version in blue chassis – AKA “DVB-T RTL2832U+R820T2” – it offeres better sensitivity in interesting frequency – and will give you extra range. The most important part in that equation is the new R820T2 (version ‘2’) and of course the included antenna
  • Micro SD – could a cheap 8G for $4, but better is to use Sandisk Extreme/Ultra – at least 4GB
  • Power supply – at least 1.5 to 2A @5V with micro USB (i.e.: old charger from cellphone)
  • Two small heatsinks (radiators) for CPU and controller – for Orange Pi Zero
  • ALTERNATIVE: Raspberry Pi 2 or 3 – they have enough of CPU power, but triple the price
  • Antenna 868MHz. The one you got with USB dongle is OK for start – gives me around 50km of range without any modification. You can cut it to the lenght of single segment

Software:

    li>Armbian for Orange Pi – the best at this point is to use the Xenial NIghtly, developer/beta version, with 4.9.x kernel from https://www.armbian.com/orange-pi-zero/
  • ogn-decode i ogn-rf – software to be downloaded – ARM CPU version
  • Free ports on the Orange Pi/Raspberry Pi – 8080 and 8081 – if there’s nothing else there installed – they should be free to use.
Cokpit with FLARM  (photo by: Sebastian Lampart)
Cokpit with FLARM  (photo by: Sebastian Lampart)

Installation

First – if not installed already – we need SDR and some system libraries as well as binaries from glidernet.org:

To allow usage of the raw feed from airplanes we need to turn off the automatic loading of the DVB-T:

paste:

Reboot the Orange Pi/Raspberry Pi
Now, lets download from glidernet.org the correct file, unpack it:

Create a FIFO to allow communication between both parts of the OGN software:

View from glider (photo by: Sebastian Lampart)
View from glider (photo by: Sebastian Lampart)

Next, calibration of the USB dongle – cheap DVB-T USB tuners are not always good at tuning with high precision to given frequency – we need to correct the skew. To do that use the gsm_scan, that will give the ppm and gain correction values:

Change values so that the deviation is around 10ppm (check the best GSM frequency GSM) – write them down.
Create own configuration based on the example:

The example file contents based on my tuner: enter CORRECT values for FreqCorr, GSM: CenterFreq Gain – based on gsm_scan:

Finally – start in background two programs using very basic (or other by your choosing method) thanks to cron:
Create two files:

with:

Add rights to execute:

Second file:
nano /home/pi/rtlsdr-ogn/run_ogn-decode

with:

Rights to execute:

Now edit your crontab:

Wklejamy:

Of course in our example we’re using username “pi”.
Verify the operation by attaching screen: screecn -r XXX, or enter the URLs in we browsers: http://ADDRESS_OF_PI:8080/ oraz http://ADDRESS_OF_PI:8081/. Your station will be listed at: http://ognrange.onglide.com/, along with the range. Since FLARM changes – check every 6 months for new version.

That’s it!

Glider's tail (photo by: Sebastian Lampart)
Glider’s tail (photo by: Sebastian Lampart)




  • Tomek Boruh

    Super poradnik mimo tego, że w sumie to napisane to samo co w wiki ogna , ale brakuje mi tu kilku informacji , więc pozwolę delikatnie zasugerować :

    1) dla wielu niejasny jest punkt odnośnie kalibracji odbiornika , ten ./gsm_scan wywala dość sporo informacji i niestety ciężko stwierdzić co oznacza :
    “..Zmieniamy wartości aż odchył będzie w granicach max 10ppm (dla najlepszej częstotliwości GSM)…” fajnie byłoby gdybyś poparł to jakimś przykładem , screenem .

    2) super byłoby gdybyś dopisał do crontaba mały skrypt sprawdzający czy nie wyszła nowa wersja który automatycznie pobierałby i kopiował co trzeba. (w autoinstalatorze który niestety ostatnio zniknął ze stron OGN) taka opcja była zaimplemetowana i spoko to działało )

    więc moim zdaniem wpis spoko, ale te dwa punkty , byłyby prawdziwą wartością dodaną , do tego co oferuje dokumentacja na stronach projektu

    pozdro

    • Łukasz C. Jokiel

      1) O tak, to trzeba uzupełnić – pamiętam, że przy uruchomieniu miałem wątpliwości co do danych z przesunięcia
      2) Mam na to pomysł, ale pozostawię to jednak jako opcję – wolę wiedzieć niż pozwolić na samą instalację.

      Dzięki!

  • Marcin Sz

    Na Ras Pi2 (raspbian) binarki ARM’a wykładają sie z ‘segmentation fault’. Czy jest może dostęp do źródeł?

    • Łukasz C. Jokiel

      Nie używaj gałęzi GPU – to wersja dla RPi1 (armv6) – której nie testowałem, weź te z gałęzi ARM: http://download.glidernet.org/arm/ – działają dla kompilacji armv7 i armv6 na raspbianie RPi 2/3 lub na Armbianie

  • Krilow

    Hello, thank you for the tutorial. I am currently running a similar system using OPI PC + (LJNM). Is the zero working ok for you? Any problems so far with stability etc?
    Thank you

    • Łukasz C. Jokiel

      I have ADS-B piaware running on OPi PC too – also doing bunch of other taks – no problem with uptimes of ~90 days (usually reboot due to upgrades). Also with heatsink.

      • Krilow

        What about OPI zero and OGN? Is the processor handling the load well without too high of a temperature? I am asking because I posted your tutorial on the OGN irc and some users voiced concerns about how well the OPI zero can hande it. Thanks again.

        • Łukasz C. Jokiel

          I suggest copper tall heatsink (Opi PC and Opi A20 are OK with alu, small) and probably a fan if you get ambient temps of around 30. I have big (30cm) low-RPM fans that will start when ambient temp is around 30 or any OPi CPU reaches 50 – because this allows for less throttling of CPU.

          • Krilow

            Thank you. Can you tell me what is the callsign of the OGN receiver that is running on the OPI zero?