Banana Pi Installation

'Easy' installation of RTLSDR-OGN (latest) on Banana Pi,
based on original work done by Paweł Jałocha.

Install operating system

To start with, download the Image from: [https://www.bananian.org/download] There are other distributions available but this is very lightweight and doesn't include a lot of unneeded software.

Once downloaded follow the instructions to install it to your SD card, then plug that into your Banana Pi and power it up.

The BPI should boot up and start flashing like a Christmas Tree. If it is connected to a network it will use DHCP to get an IP address and will start an SSH server. To login use the username 'root' and the password 'pi'

The first step is expanding the file system to fill the memory card

/usr/local/bin/raspi-config --expand-rootfs
reboot

Then update the operating system

wget https://dl.bananian.org/upgrade/bananian-update -O /usr/local/bin/bananian-update
chmod 700 /usr/local/bin/bananian-update
bananian-update

apt-get update
apt-get upgrade

Once this has been done reboot and you are ready to install.

Install rtl-sdr

Installation

sudo apt-get install rtl-sdr

For other distributions than debian/ubuntu/debian-deriavates, there is a detailed guide here: http://osmocom.org/projects/sdr/wiki/Rtl-sdr#Software

Now, once the DVB-T dongle is plugged into the USB port, you should find a corresponding message in lsusb or dmesg

Prevent kernel modules claiming use of the USB DVB-T dongle

Only required if rtl-sdr was manually built and installed. This is NOT required if you installed rtl-sdr via the "sudo apt-get install rtl-sdr" command as above. Some users report RPiB+ model also requires this.

At some point in time the standard Raspian distribution began to contain drivers for the DVB-T dongles, probably to make is easier to receive digital TV.
These drivers however, are not of any use for us, and they overtake the rtl-sdr driver, thus making it unusable. Here is how to disable them:

Create a file (with sudo):

sudo -s

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

Install required packages

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

Workaround for newer Debians on Raspberry Pi

As per https://github.com/glidernet/ogn-rf/issues/20 there is a known issue trying to install libjpeg8 on a Raspberry Pi running an OS that is newer than these instructions.

You can install libjpeg8 and rtlsdr-ogn manually with:

sudo apt-get -y install libconfig9 libjpeg-dev libfftw3-dev lynx ntpdate ntp # install the packages
wget -qO- http://www.ijg.org/files/jpegsrc.v8d.tar.gz | tar -xz ; cd jpeg-8d/ # Download and uncompress the source
./configure --libdir=/usr/lib/ --build=aarch64-unknown-linux-gnu # Configure the library to compile on a Pi 3 or Pi 4
make && sudo make install # Compile and install the library
cd .. ; rm -fr jpeg-8d/ # Optional cleanup
wget -qO- http://clubhouse.sosaglidingclub.com/ogn/rtlsdr-ogn-bin-arm64-0.2.9_BullsEye.tgz | tar -xz # Download the updated version of OGN

Note that if you followed those workaround instructions for your Raspberry Pi, you should skip the next step and go to the "Create named pipe" step

Download the binary and unpack it

For all Raspberry Pi, choose

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, choose
wget http://download.glidernet.org/arm/rtlsdr-ogn-bin-ARM-latest.tgz
tar xvzf rtlsdr-ogn-bin-ARM-latest.tgz

There are also binaries for x86 and x86_64 targets, see http://download.glidernet.org/.

Create named pipe

Since v0.2.2 rf-reception and decoding are separate processes. They communicate via this fifo.

cd rtlsdr-ogn
mkfifo ogn-rf.fifo

Receiver configuration and tuning for best performance

Now power system down, insert the USB DVB-T stick and repower on..
Attach your aerial.

The very first thing you need in order to receive the signals is to be on the correct radio frequency.
Cheap SDR receivers use cheap crystals and their frequency tolerance is about +/-50-100ppm.
At 868MHz 100ppm error makes you 86.8kHz away from the correct frequency, while frequency deviation for FLARM signals is +/-50kHz.
Technically, the software receiver can search a wide range of frequencies for radio packets but this inflicts lot of CPU, thus can only be done for stronger CPU boards, but not for Raspberry PI.
Thus you need to know how much off is the crystal of your DBV-T dongle before you proceed.

You can measure the crystal with the gsm_scan tool, run it like this:

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

Add "—gsm-850" to the gsm_scan if you're in North America

It should receive some GSM broadcast channels and measure the frequency correction.
Notice the GSM frequency with a strong broadcast channel, even better: with one or two directly adjacent channels.
Adjust the gain (--gain) and initial crystal correction (--ppm) for best reception of as many as possible channels with consistent correction measurement.
GSM signals are very strong, thus too much gain is not good. You need to find an optimal setting here.

The silver dongle from rtl-sdr.com normally just needs a crystal correction around 0 ppm.

NOTE: In Australia the 900Mhz mobile network is being decommissioned, in the near future it may become difficult to run GSMSCAM and get a usable result. It is recommended to use a V3 dongle as they rarely require a freq offset. (August 2018 - some signals are still being found for GSMSCAN).

Rename the file named either Example.conf or Template.conf so that the name corresponds to your receiver's location (e.g. LFLE.conf, EPZR.conf, myPlace.conf)

(this assumes you are still in the rtlsdr-ogn directory, if not you need to "cd rtlsdr-ogn" first)

cp Template.conf myPlace.conf

Then edit the file, to set-up the receiver:
enter your crystal correction, GSM frequency for calibration, geographical position, APRS name. See more details about the the receiver's configuration file.

nano myPlace.conf

NOTE: FLARM frequency in both North and South Ametica and Israel is different from the European standard. You need to add a following line(in the RF block) to your myPlace.conf, otherwize your station will be "deaf" to FLAM signals.

FreqPlan = 2;

Install as service

If you don't want to start the receiver by hand every time the RPI boots, then 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

Update /etc/rtlsdr-ogn.conf according to name of your configuration file, by replacing SampleConfigurationFileNameToChange.conf by the name of your config file and pi with your actual username

sudo nano /etc/rtlsdr-ogn.conf

Note that the path used in that command is to rtlsdr-ogn, not the directory of the version you have installed. This is a symbolic link that will always direct to the actual directory which has as version specific name.

Start the service

sudo service rtlsdr-ogn start

Remark: When the service starts it waits for time synchronisation (NTP). It may takes up to 30mn on just booted RPi. Gossip says if you install ntpdate it synchronizes much faster.

Your service is now running and will start automatically at next boot.

If you wish to re-run gsm_scan after this point you will have to stop the service.

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

You can see console output of your receiver at any time with:

telnet localhost 50000

containing infos regarding to the decoding-process and

telnet localhost 50001

containing infos regarding to the APRS datatraffic.

And to finalize

Please don't forget to add your new receiver to the receiver list.
Some words on how to increase Raspberry Pi stability

Install Special Driver for RTL-SDR.com v3 dongle

The RTL-SDR.com version 3 dongle has a built-in bias-T circuit which can be used to supply power supply to preamps. It can be activated in software, but requires a custom compiled rtlsdr driver. Here are the installation instructions:

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 ..
sudo make install

# get rid of the old libraries
sudo apt-get remove --purge rtl-sdr
sudo apt-get autoremove

To activate the power supply please add the line 'BiasTee = 1;' line to the rtlsdr-ogn.conf file
RF:
{ 
  FreqCorr = +0;          # [ppm]      "big" R820T sticks have 40-80ppm correction factors, measure it with gsm_scan
  BiasTee      = 1;

  OGN: # for FLARM packets acquisition
  { Gain = 22.9; # [dB] RF input 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