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:
===
LARM – 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.
First – if not installed already – we need SDR and some system libraries as well as binaries from glidernet.org:
cd /home/pi
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install rtl-sdr
sudo apt-get install libconfig-dev fftw3-dev libjpeg-dev libconfig9 libjpeg8
To allow usage of the raw feed from airplanes we need to turn off the automatic loading of the DVB-T:
nano /etc/modprobe.d/rtl-sdr-blacklist.conf
paste:
blacklist dvb_usb_rtl28xxu
blacklist e4000
blacklist rtl2832
blacklist r820t
blacklist rtl2830
blacklist dvb_usb_rtl28xxu
blacklist dvb_usb_rtl2832u
Reboot the Orange Pi/Raspberry Pi
Now, lets download from glidernet.org the correct file, unpack it:
wget http://download.glidernet.org/arm/rtlsdr-ogn-bin-ARM-latest.tgz
tar xvzf rtlsdr-ogn-bin-ARM-latest.tgz
Create a FIFO to allow communication between both parts of the OGN software:
cd rtlsdr-ogn
mkfifo ogn-rf.fifo
(photo: Stanisław 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:
cd rtlsdr-ogn
./gsm_scan --ppm 50 --gain 20
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:
cp Template.conf EPXX_OGN.conf
nano EPXX_OGN.conf
The example file contents based on my tuner: enter CORRECT values for FreqCorr, GSM: CenterFreq Gain – based on gsm_scan:
RF:
{
FreqCorr = +87.060; # [ppm] "big" R820T sticks have 40-80ppm correction factors, measure it with gsm_scan
GSM: # for frequency calibration based on GSM signals
{ CenterFreq = 938.4; # [MHz] find the best GSM frequency with gsm_scan
Gain = 25.0; # [dB] RF input gain (beware that GSM signals are very strong !)
} ;
} ;
Position:
{ Latitude = +51.1514; # [deg] Antenna coordinates
Longitude = +18.4642; # [deg]
Altitude = 150; # [m] Altitude above sea leavel
GeoidSepar = 48; # [m] Geoid separation: FLARM transmits GPS altitude, APRS uses means Sea level altitude
} ;
APRS:
{ Call = "EPXX1"; # APRS callsign (max. 9 characters)
# Please refer to http://wiki.glidernet.org/receiver-naming-convention
} ;
Finally – start in background two programs using very basic (or other by your choosing method) thanks to cron:
Create two files:
cd /home/pi
nano /home/pi/rtlsdr-ogn/run_ogn-rf
with:
#!/bin/bash
cd /home/pi/rtlsdr-ogn
/home/pi/rtlsdr-ogn/ogn-rf /home/pi/rtlsdr-ogn/EPXX_OGN.conf
Add rights to execute:
chmod 755 /home/pi/rtlsdr-ogn/run_ogn-rf
Second file:
nano /home/pi/rtlsdr-ogn/run_ogn-decode
with:
#!/bin/bash
cd /home/pi/rtlsdr-ogn
/home/pi/rtlsdr-ogn/ogn-decode /home/pi/rtlsdr-ogn/EPXX_OGN.conf
Add rights to execute:
chmod 755 /home/pi/rtlsdr-ogn/run_ogn-decode
Now edit your crontab:
crontab -e
Paste:
*/5 * * * * if [ `pgrep ogn-rf | tr '\n' ' '| awk '{print $1}'` ]; then echo "ogn-rf dziala"; else screen -dmS ognrf /home/pi/rtlsdr-ogn/run_ogn-rf; fi > /tmp/ognrf.log 2>&1
*/5 * * * * if [ `pgrep ogn-decode | tr '\n' ' '| awk '{print $1}'` ]; then echo "ogn-decode dziala"; else screen -dmS ogndecode /home/pi/rtlsdr-ogn/run_ogn-decode; fi > /tmp/ogndecode.log 2>&1
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!
(zdj. Stanisław Lampart)