Raspberry Pi Installation

Install Operating System

  1. Download the latest Lite version of Raspian (the full desktop is not needed).
  2. Follow their instructions to install onto your SD card.
  3. Put a empty file with the name ssh on the boot partition.
  4. Ensure that you can boot from it.

Run:

sudo raspi-config

to expand the disk partition (to use the full SD card capacity):

  1. 7 Advanced option (7)
  2. A1 Expand Filesystem
  3. OK to reboot
  4. Finish on the main Menu
  5. Yes when asked to reboot now.

Ensure network connectivity (cancel with Ctrl+C):

ping 8.8.8.8

and then update:

sudo apt-get update && sudo apt-get upgrade -y

Manual installation of RTLSDR-OGN

This page describes a manual installation of an OGN receiver using an RTL-SDR compatible USB receiver. Some Linux knowledge is assumed: you should be comfortable using the command line, editing configuration files and running commands with sudo.

The usual installation flow is:

  • install the SDR and system packages,
  • download and unpack RTLSDR-OGN,
  • create the receiver configuration,
  • set or verify the SDR frequency correction,
  • run the receiver manually or install it as a service.

Before you start

You need:

  • a Linux system, commonly a Raspberry Pi or another small board computer,
  • an RTL-SDR compatible USB receiver,
  • a suitable antenna,
  • internet access during installation,
  • the receiver location and APRS receiver name you intend to use.

Install rtl-sdr

On Debian, Ubuntu, Raspberry Pi OS and similar distributions:

sudo apt-get install rtl-sdr

For other distributions, see the rtl-sdr software guide: http://osmocom.org/projects/sdr/wiki/Rtl-sdr#Software

After plugging the DVB-T/RTL-SDR dongle into the USB port, check that the system can see it:

lsusb
dmesg

Prevent kernel modules from claiming the USB dongle

Skip this section if rtl-sdr was installed from the package manager and the dongle works correctly.

Some systems load standard DVB-T television drivers for RTL-SDR dongles. Those drivers can claim the device before rtl-sdr can use it. If the receiver cannot access the dongle, blacklist the DVB-T kernel modules:

sudo -s

cat >> /etc/modprobe.d/rtl-glidernet-blacklist.conf <<EOF
blacklist rtl2832
blacklist r820t
blacklist rtl2830
blacklist dvb_usb_rtl28xxu
EOF

Reboot after changing the blacklist.

Install required packages

sudo apt-get -y install libconfig9 libjpeg8 libfftw3-dev lynx ntpdate ntp

On newer Debian or Raspberry Pi OS releases, libjpeg8 may no longer be available from the package repository. If the command above fails because of libjpeg8, use the workaround in the next section.

Workaround for newer Debian or Raspberry Pi OS releases

As described in https://github.com/glidernet/ogn-rf/issues/20, some newer Raspberry Pi OS and Debian installations cannot install libjpeg8 directly.

On a Raspberry Pi 3 or Raspberry Pi 4 64-bit system, you can install libjpeg8 and an updated RTLSDR-OGN binary manually:

sudo apt-get -y install libconfig9 libjpeg-dev libfftw3-dev lynx ntpdate ntp
wget -qO- http://www.ijg.org/files/jpegsrc.v8d.tar.gz | tar -xz
cd jpeg-8d/
./configure --libdir=/usr/lib/ --build=aarch64-unknown-linux-gnu
make
sudo make install
cd ..
rm -fr jpeg-8d/
wget -qO- http://clubhouse.sosaglidingclub.com/ogn/rtlsdr-ogn-bin-arm64-0.2.9_BullsEye.tgz | tar -xz

If you used this workaround, skip the next section and continue with "Create the named pipe".

Download and unpack RTLSDR-OGN

For Raspberry Pi:

wget http://download.glidernet.org/rpi-gpu/rtlsdr-ogn-bin-RPI-GPU-latest.tgz
tar xvzf rtlsdr-ogn-bin-RPI-GPU-latest.tgz

For other ARM systems:

wget http://download.glidernet.org/arm/rtlsdr-ogn-bin-ARM-latest.tgz
tar xvzf rtlsdr-ogn-bin-ARM-latest.tgz

Binaries for x86 and x86_64 targets are also available at http://download.glidernet.org/.

Create the named pipe

Since version 0.2.2, RF reception and decoding are separate processes. They communicate through this FIFO:

cd rtlsdr-ogn
mkfifo ogn-rf.fifo

Set file permissions for Raspberry Pi GPU usage

Run these commands only when using the Raspberry Pi GPU version. If you run without GPU support, or on another platform, skip this section.

sudo chown root gsm_scan
sudo chmod a+s gsm_scan
sudo chown root ogn-rf
sudo chmod a+s ogn-rf

Configure and tune the receiver

Connect the antenna. If the USB dongle was not connected during installation, power the system down, insert the dongle and power it on again.

The receiver must listen on the correct radio frequency. Many newer RTL-SDR dongles include a TCXO and normally need little or no frequency correction. For such dongles, you can usually start with FreqCorr = 0; in the receiver configuration and skip GSM calibration, unless reception results suggest otherwise.

Older or cheaper SDR receivers may use crystals with frequency errors of about +/-50 to 100 ppm. At 868 MHz, a 100 ppm error is about 86.8 kHz, which is significant for receiving aircraft beacons.

RTLSDR-OGN can search across a range of frequencies, but a wide search uses more CPU. On small boards such as a Raspberry Pi, it is better to measure the dongle frequency correction before running the receiver.

If you have an older dongle, an unknown dongle, or poor reception with zero correction, run gsm_scan:

cd rtlsdr-ogn
./gsm_scan --ppm 50 --gain 20

In North America, add --gsm-850:

./gsm_scan --gsm-850 --ppm 50 --gain 20

The tool should receive GSM broadcast channels and report the measured frequency correction. Look for a strong GSM channel, preferably with one or two directly adjacent channels. Adjust --gain and --ppm until reception is stable and the correction measurement is consistent.

GSM signals are strong, so too much gain can make the result worse. The silver dongle from rtl-sdr.com and other TCXO-based dongles normally need a correction close to 0 ppm.

NOTE: In Australia, the 900 MHz mobile network has been decommissioned or reduced in many areas. It may be difficult to run gsm_scan and get a useful result. A V3 dongle is recommended because it usually needs little or no frequency offset.

Create the receiver configuration

Rename or copy the example configuration so that the file name matches your receiver location or receiver name, for example LFLE.conf, EPZR.conf or myPlace.conf.

If you are still in the rtlsdr-ogn directory:

cp Template.conf myPlace.conf

Edit the file:

nano myPlace.conf

Set at least:

  • the frequency correction, often 0 ppm for TCXO dongles or the measured crystal correction for older dongles,
  • the GSM frequency used for calibration,
  • the receiver geographical position,
  • the APRS receiver name.

More details are described in the receiver configuration file.

NOTE: The receiver gain is configured in the RF.OGN section. A fixed gain can be set with RF.OGN.Gain. Starting from RTLSDR-OGN version 0.3.2, an automatic gain control algorithm is also available. It adjusts the tuner gain to keep the measured input noise within the limits defined by RF.OGN.MinNoise and RF.OGN.MaxNoise, both expressed in dB.

The configuration file uses the libconfig format: settings are organized in nested groups such as RF: { OGN: { ... }; };. For the general syntax rules, see the libconfig manual: libconfig configuration file grammar.

NOTE: The FLARM frequency in North America, South America and Israel is different from the European frequency plan. In those regions, add the following line inside the RF block of your receiver configuration file, otherwise the station will not receive the local FLARM frequency:

FreqPlan = 2;

Install RTLSDR-OGN as a service

If you do not want to start the receiver manually after each boot, install it as a service:

sudo apt-get -y install procserv telnet
sudo wget http://download.glidernet.org/common/service/rtlsdr-ogn -O /etc/init.d/rtlsdr-ogn
sudo wget http://download.glidernet.org/common/service/rtlsdr-ogn.conf -O /etc/rtlsdr-ogn.conf
sudo chmod +x /etc/init.d/rtlsdr-ogn
sudo update-rc.d rtlsdr-ogn defaults

Edit the service configuration:

sudo nano /etc/rtlsdr-ogn.conf

Replace SampleConfigurationFileNameToChange.conf with the name of your receiver configuration file. Replace pi with your actual Linux user name.

The path used by the service points to rtlsdr-ogn. This is a symbolic link to the actual version-specific installation directory.

Start the service:

sudo service rtlsdr-ogn start

When the service starts, it waits for time synchronization through NTP. On a freshly booted Raspberry Pi this can take some time.

The service will now start automatically at the next boot.

If you need to run gsm_scan again, stop the service first:

sudo service rtlsdr-ogn stop
cd rtlsdr-ogn
./gsm_scan --ppm 50 --gain 20

Check receiver output

Receiver decoding output is available with:

telnet localhost 50000

APRS data output is available with:

telnet localhost 50001

Final steps

Please add your new receiver to the receiver list.

See also: increase Raspberry Pi stability.

Optional: RTL-SDR.com V3 bias-T support

The RTL-SDR.com V3 dongle has a built-in bias-T circuit that can supply power to a preamplifier. This is optional. Use this section only if you need software-controlled bias-T power.

Bias-T support requires the RTL-SDR.com driver:

sudo apt-get -y install git g++ gcc make cmake build-essential libconfig-dev libjpeg-dev libusb-1.0-0-dev
git clone https://github.com/rtlsdrblog/rtl-sdr-blog
cd rtl-sdr-blog
mkdir build
cd build
cmake ..
make
sudo make install

sudo apt-get remove --purge rtl-sdr
sudo apt-get autoremove

To activate bias-T power, add BiasTee = 1; inside the RF block of your receiver configuration file, for example myPlace.conf:

RF:
{
  FreqCorr = +0;
  BiasTee = 1;

  OGN:
  {
    Gain = 22.9;
    # For RTLSDR-OGN 0.3.2 and later, automatic gain control can use MinNoise and MaxNoise instead of a fixed Gain.
  };
};

Valid gain settings are:

0.0 0.9 1.4 2.7 3.7 7.7 8.7 12.5 14.4 15.7 16.6 19.7 20.7 22.9 25.4 28.0 29.7 32.8 33.8 36.4 37.2 38.6 40.2 42.1 43.4 43.9 44.5 48.0 49.6
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License