Skip to content

Instantly share code, notes, and snippets.

Created July 23, 2016 22:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/ce8cee8731895fc59527fff87cfebc9d to your computer and use it in GitHub Desktop.
Save anonymous/ce8cee8731895fc59527fff87cfebc9d to your computer and use it in GitHub Desktop.

Start a Terminal

Execute

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git-core git cmake libusb-1.0-0-dev build-essential
git clone git://git.osmocom.org/rtl-sdr.git
cd rtl-sdr
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
sudo make install
sudo ldconfig

Connect antenna, cables (without band-pass filter), Install dongle

cd ~
sudo cp ./rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/
sudo printf 'blacklist dvb_usb_rtl28xxu\nblacklist rtl2832\nblacklist rtl2830' > /etc/modprobe.d/nortl.conf
sudo reboot
rtl_test

Calibrate:

Download, compile and install the Kalibrate programm

mkdir ~/kal
cd ~/kal
sudo apt-get install libtool autoconf automake libfftw3-dev
git clone https://github.com/asdil12/kalibrate-rtl.git
cd kalibrate-rtl
git checkout arm_memory
./bootstrap
./configure
make
sudo make install

Calibrate:

kal -s GSM900 -d 0 -g 40

You'll get something like:

Found 1 device(s): 0: Generic RTL2832U OEM

Using device 0: Generic RTL2832U OEM Found Rafael Micro R820T tuner Exact sample rate is: 270833.002142 Hz [R82XX] PLL not locked! Setting gain: 40.0 dB kal: Scanning for GSM-900 base stations. GSM-900: chan: 16 (938.2MHz - 303Hz) power: 764382.95 chan: 29 (940.8MHz - 107Hz) power: 3099720.22 chan: 37 (942.4MHz + 351Hz) power: 814043.05 chan: 56 (946.2MHz - 106Hz) power: 255238.03 chan: 65 (948.0MHz - 115Hz) power: 645372.85 chan: 69 (948.8MHz + 115Hz) power: 4609305.74 chan: 73 (949.6MHz + 239Hz) power: 642985.06 chan: 102 (955.4MHz - 512Hz) power: 694681.27


Use the most powerful channel (69 in the example above) for calibration

kal -c <channel> -d 0 -g 40

You'll get something like:

Found 1 device(s): 0: Generic RTL2832U OEM

Using device 0: Generic RTL2832U OEM Found Rafael Micro R820T tuner Exact sample rate is: 270833.002142 Hz [R82XX] PLL not locked! Setting gain: 40.0 dB kal: Calculating clock frequency offset. Using GSM-900 channel 69 (948.8MHz) average [min, max] (range, stddev)

  • 64Hz [39, 87] (49, 13.600428) overruns: 0 not found: 0 average absolute error: -0.067 ppm

Note the "average absolute error" number. If you have it around 0, everything's fine.
If not, you may need to change the frequency when you start `dump1090`.

Build dump1090

cd ~
git clone git://github.com/MalcolmRobb/dump1090.git
cd dump1090
sudo apt-get install pkg-config
make

Try it:

./dump1090 --interactive --net

You should be getting output like:

Hex Mode Sqwk Flight Alt Spd Hdg Lat Long Sig Msgs Ti|

3C4B4C S 34000 470 344 5 39 1 44D076 S 25000 4 5 1 3C66B3 S 2037 DLH8YA 19475 339 121 48.916 11.190 4 27 5 040032 S 2540 ETH707 5875 273 119 49.905 8.698 8 113 0 3C6DCD S 7610 31000 465 108 4 12 1 44A8A2 S 1000 JAF83X 34625 454 292 5 130 2 710105 S 2702 SVA116 33000 510 125 49.382 7.167 4 156 1 4243D0 S 9725 295 007 6 38 7 3C6671 S 0137 DLH4LC 2525 207 070 50.057 8.638 10 205 1 495296 S 2326 14000 345 359 4 36 3 3C5CB5 S 34600 409 066 5 42 1 3C6655 S 7662 DLH1304 16600 402 095 50.021 9.583 6 131 0 06A1BD S 34975 5 2 8 3C706E S 2557 GEC8296 11250 339 119 49.804 8.976 5 203 0 45AC32 S 4057 SAS2588 36025 464 023 49.144 9.098 5 174 0 478371 S 0732 SAS4823 41000 456 172 49.701 8.036 10 374 0 3C6488 S 7621 DLH1308 2550 182 139 49.963 8.537 8 91 0 3C666A S 0612 DLH584 12300 386 135 49.696 9.132 6 274 0 406A93 S 2735 38025 449 312 48.890 8.772 4 160 1 400868 S 3221 TCX7867 34000 435 304 49.723 7.388 4 229 0 896197 S 7661 UAE48 7125 278 023 50.185 8.787 69 475 0 896405 S 2232 ETD69K 39000 493 098 50.222 8.175 12 407 0 3C1FBD S 15 84 0 3C5EE8 S 0262 26825 439 337 49.301 9.089 5 185 0 3C486C S 1000 BER359J 13075 313 358 49.726 8.663 9 333 0



FlightAware Band-Pass filter is highly recommended, it drastically increases the number of messages.


Making dump1090 boot-fest:

sudo nano /etc/init.d/dump1090.sh

#!/bin/bash

BEGIN INIT INFO

Provides: dump1090

Required-Start: $remote_fs

Required-Stop: $remote_fs

Default-Start: 2 3 4 5

Default-Stop: 0 1 6

Short-Description: dump1090 initscript

END INIT INFO

Fill in name of program here.

PROG="dump1090" PROG_PATH="/home/pi/dump1090" PROG_ARGS="--quiet --gain -10 --net --net-beast" PIDFILE="/var/run/dump1090.pid"

start() { if [ -e $PIDFILE ]; then ## Program is running, exit with error. echo "Error! $PROG is currently running!" 1>&2 exit 1 else ## Change from /dev/null to something like /var/log/$PROG if you want to save output. cd $PROG_PATH ./$PROG $PROG_ARGS 2>&1 >/dev/null & echo "$PROG started" touch $PIDFILE fi }

stop() { if [ -e $PIDFILE ]; then ## Program is running, so stop it echo "$PROG is running" killall $PROG rm -f $PIDFILE echo "$PROG stopped" else ## Program is not running, exit with error. echo "Error! $PROG not started!" 1>&2 exit 1 fi }

Check to see if we are running as root first.

if [ "$(id -u)" != "0" ]; then echo "This script must be run as root" 1>&2 exit 1 fi

case "$1" in start) start exit 0 ;; stop) stop exit 0 ;; reload|restart|force-reload) stop start exit 0 ;; **) echo "Usage: $0 {start|stop|reload}" 1>&2 exit 1 ;; esac exit 0



sudo chmod +x /etc/init.d/dump1090.sh
sudo update-rc.d dump1090.sh defaults
sudo /etc/init.d/dump1090.sh start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment