Raspberry Pi (B+, RPi2 & RPi3) - Installation instructions for Raspbian, Dump1090 & Data Feeder

ab cd

Senior Member
#1
What you need is 3 components as follows:
1- An operating system like Raspbian.
2- A decoder software like Dump1090
3- A Data Feeding software.

STEP 1- Install Raspbian on microSD Card
You can download and install an operating system from Raspberry Pi official site. There are many different operating systems offered on this site. We recommend & describe here the installation of Raspbian on your Raspberry Pi.

Download the latest version of Raspbian installation software on your Desktop/Laptop from Raspberry Pi's Official Website: http://www.raspberrypi.org/downloads/

Instructions for Installation of Raspbian are on this page http://www.raspberrypi.org/documenta...ages/README.md.

After writing Raspbian image to your microSD card, remove the microSD card from your desktop/laptop and insert it into Raspberry Pi, and turn on the power to Raspberry Pi. The Raspberry Pi will start to boot, and present a configuration window.

You can do first run and configuration either using a SSH client (like PuTTY) instslled on your windows/mac desktop, or using a TV/monitor, mouse & keyboard connected to Raspberry Pi. Select GUI option (Graphical User Interface like windows) when configuration starts at the end of install.

STEP 2- Install Driver for RTL-SDR
This requires using console of Raspbian.
I will list the console commands here which I got from following sites:
https://ferrancasanovas.wordpress.co...-installation/
http://www.satsignal.eu/raspberry-pi/dump1090.html


(a) Install updates & tools
Code:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install git-core
sudo apt-get install git
sudo apt-get install cmake
sudo apt-get install libusb-1.0-0-dev
sudo apt-get install build-essential

(b) Install driver for RTL-SDR DVB-T Dongle.
Code:
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

cd ~
sudo cp ./rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/
sudo reboot

STEP 3-Installation of Dump1090 (If you want to install dump1090-mutability, please see post #5 before proceeding)
Code:
cd ~
git clone git://github.com/MalcolmRobb/dump1090.git
cd dump1090
make
./dump1090 --interactive --net --net-http-port 8080

you may get following error message;

Code:
Kernel driver is active, or device is claimed by second instance
In the first case, please either detach or blacklist the kernel
(dvb_usb_rtl28xxu), or enable automatic detaching at compile time

usb_claim_interface error -6
Error opening the RTLSDR device: Device or resource busy

To solve this problem you have to create a blacklist file as follows:

Code:
cd /etc/modprobe.d
sudo nano /etc/modprobe.d/rtl-sdr-blacklist.conf

This will create & open the blacklist file rtl-sdr-blacklist.conf
type following lines in this file & save the file (Ctrl+O).



Code:
blacklist dvb_usb_rtl28xxu
blacklist e4000
blacklist rtl2832

To enable display of planes on Google Map in a Browser, give following command in console:

Code:
cd ~/dump1090
./dump1090 --interactive --net --net-http-port 8080

STEP 4- Installation of Data feeder :
For detailed step-by-step instructions for installing PFClient, please see my next post below.
http://forum.planefinder.net/thread...-raspbian-dump1090-data-feeder.241/#post-2451



Additional: How to see aircrafts on Google Map in a Browser :
To display Google Map +airplanes on the browser of Raspberry PI, type in RPi's browser http://127.0.0.1:8080

To display Google Map with airplanes on your Desktop/Laptop (connected to your LAN on which RPI is also connected), type in browser the address http: //<IP address of RPi on LAN>:8080, Google Map with airplanes will display.

If Google Map does not display, type following command in console:
Code:
cd ~/dump1090
./dump1090 --interactive --net --net-http-port 8080
and then again type in browser the address http: //<IP address of RPi on LAN>:8080, Google Map with airplanes will display.

If on closing the console, the Google Map becomes blank, then use following procedure to automatically start the net feed and keep it alive by creating a script as follows:

First create a blank script file "dump1090.sh" with the command:
Code:
sudo nano /etc/init.d/dump1090.sh
Now copy and paste the following code into the new file, and save the file (Ctrl+O), then exit nano text editor back to console (Ctrl+X):
Code:
#!/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="--interactive --net --net-ro-size 500 --net-ro-rate 5"
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.
## Found at http://www.cyberciti.biz/tips/shell-...ck-script.html
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
Now make this file executable with the following command:

Code:
sudo chmod +x /etc/init.d/dump1090.sh
Now create the run level shortcuts with the command:

Code:
sudo update-rc.d dump1090.sh defaults
Reboot the RPi. You can now see Google map displayed in your browser by typing http: //<IP address of your RPi on LAN>:8080.

If you want, you can stop or restart dump1090 manually with the commands:
Code:
sudo /etc/init.d/dump1090.sh stop
or
sudo /etc/init.d/dump1090.sh start
 
Last edited:

ab cd

Senior Member
#3
Step by Step Method of Installation of PF Client on R Pi B+, RPi 2 & RPi3 (Linux Raspbian)

INSTALL
To install Plane Finder Client, enter these commands in console:


PFClient (Default Open Street Map, Switchable to Google Map)
Code:
wget http://client.planefinder.net/pfclient_4.1.1_armhf.deb
sudo dpkg -i pfclient_4.1.1_armhf.deb
The above version is current as on June 19, 2018.
For latest version check this page: https://planefinder.net/sharing/client


CONFIGURE
After installation is complete as above, type http: //<ip address of RPi on your network>:30053/setup.html in your browser, and follow instructions on the page opened. The <ip address of RPi on your network> will be something like 192.168.2.12 and can be found from your router setup.


Choose option to request sharecode, if you don't already have one. Planefinder will send it to you by email. After you receive sharecode, you can enter it on above page and complete your configuration.

During configuration,enter:
Sharecode
Receiver Lat: Your Latitude in decimal format
Receiver Lon: Your Longitude in decimal format
Click "Assign Share Code"
PFClient Config 2.PNG


This will open a new page. On this page enter:
Receiver Data Format: Beast
How are you connecting to your receiver: Network
IP Address: 127.0.0.1
Port Number: 30005
Click "Complete configuration"
PFClient Config 3.PNG



PF Client web interfaces:
After SETUP is complete and pfclient is up & running, you can see following in your computer's browser.
http:// <ip-address-of-RPi>:30053/map.html (shows planes on Google Map)
http:// <ip-address-of-RPi>:30053/stats.html (shows stats of your receiver)
http:// <ip-address-of-RPi>:30053/logs.html (shows logs of your receiver)


(<ip-address-of-RPi> will be something like 192.168.2.15 . Obtain exact value from your router settings)
PF Client--3.5.png Planefinder Stats.PNG Planefinder Logs.PNG


AND THAT IS ALL....... ENJOY!

Have any questions? Want to report a bug?
Forum for Plane Finder Client 3.5:
https://forum.planefinder.net/threads/plane-finder-client-3-5.974/
 
Last edited:
#4
Hi ab cd, great posts. Thanks from me and future noobs. :):)

This should be made a sticky and non-editable (except for abcd) or else the thread will become "contaminated" by lots of debugging questions.
 
Last edited:

ab cd

Senior Member
#5
DUMP1090-MUTABILITY

Instead of dump1090, you can install dump1090-mutability which has more functionality.

DO NOT to install both versions of dump. Install either dump1090 OR dump1090-mutability.


1. Download installation package, and install it:
Code:
wget https://github.com/mutability/dump1090/releases/download/v1.14/dump1090-mutability_1.14_armhf.deb
sudo dpkg -i dump1090-mutability_1.14_armhf.deb
The above Version is current as on Feb 06, 2018

3. Perform Detailed configuration:
Code:
sudo dpkg-reconfigure dump1090-mutability
During configuration when asked:
(a) "Interface address to bind to (blank for all interfaces) " , remove 127.0.0.1 and leave entry blank. This is a workaround to overcome a bug piaware.

(b) "Extra arguments to pass to dump1090", enter " --net --net-http-port 8080 ". This will enable display of dump1090's google map on web browser.

4. If you want to use the external webserver integration:
Code:
sudo apt-get install lighttpd && sudo lighty-enable-mod dump1090
The Web interface (gmap) will be displayed at http: //<ip address of RPi>/dump1090/

5. Upgrade:
Code:
sudo apt-get upgrade

6. Start, Stop, Status
Code:
sudo /etc/init.d/dump1090-mutability stop  # to stop
sudo /etc/init.d/dump1090-mutability start  # to start again
sudo /etc/init.d/dump1090-mutability status  # to check if it is running.
#If running, status check should give: [ ok ]dump1090-mutability is running.
#If not running, status check should give: [FAIL] dump1090-mutability is not running ... failed!

7. Changing Settings
You can anytime modify the settings by two methods:

(a) Easy: By running "dpkg-reconfigure dump1090-mutability" as root
Code:
sudo dpkg-reconfigure dump1090-mutability

(b) Advance: Editing by console command
Code:
cd ~
cd  /etc/default/
sudo dump1090-mutability --argument value    #see list of arguments & values below
sudo reboot   #for changes to take effect, reboot after you finish making changes
Arguments & value in above command are:
Code:
-----------------------------------------------------------------------------
| dump1090 ModeS Receiver  dump1090-mutability v1.13 |
-----------------------------------------------------------------------------
--device-index <index>  Select RTL device (default: 0)
--gain <db>  Set gain (default: max gain. Use -10 for auto-gain)
--enable-agc  Enable the Automatic Gain Control (default: off)
--freq <hz>  Set frequency (default: 1090 Mhz)
--ifile <filename>  Read data from file (use '-' for stdin)
--interactive  Interactive mode refreshing data on screen
--interactive-rows <num> Max number of rows in interactive mode (default: 15)
--interactive-ttl <sec>  Remove from list if idle for <sec> (default: 60)
--interactive-rtl1090  Display flight table in RTL1090 format
--raw  Show only messages hex values
--net  Enable networking
--modeac  Enable decoding of SSR Modes 3/A & 3/C
--net-only  Enable just networking, no RTL device or file used
--net-bind-address <ip>  IP address to bind to (default: Any; Use 127.0.0.1 for private)
--net-http-port <port>  HTTP server port (default: 8080)
--net-ri-port <port>  TCP raw input listen port  (default: 30001)
--net-ro-port <port>  TCP raw output listen port (default: 30002)
--net-sbs-port <port>  TCP BaseStation output listen port (default: 30003)
--net-bi-port <port>  TCP Beast input listen port  (default: 30004)
--net-bo-port <port>  TCP Beast output listen port (default: 30005)
--net-fatsv-port <port>  FlightAware TSV output port (default: 10001)
--net-ro-size <size>  TCP output minimum size (default: 0)
--net-ro-interval <rate> TCP output memory flush rate in seconds (default: 0)
--net-heartbeat <rate>  TCP heartbeat rate in seconds (default: 60 sec; 0 to disable)
--net-buffer <n>  TCP buffer size 64Kb * (2^n) (default: n=0, 64Kb)
--net-verbatim  Do not apply CRC corrections to messages we forward; send unchanged
--lat <latitude>  Reference/receiver latitude for surface posn (opt)
--lon <longitude>  Reference/receiver longitude for surface posn (opt)
--max-range <distance>  Absolute maximum range for position decoding (in nm, default: 300)
--fix  Enable single-bits error correction using CRC
--no-fix  Disable single-bits error correction using CRC
--no-crc-check  Disable messages with broken CRC (discouraged)
--phase-enhance  Enable phase enhancement
--aggressive  More CPU for more messages (two bits fixes, ...)
--mlat  display raw messages in Beast ascii mode
--stats  With --ifile print stats at exit. No other output
--stats-every <seconds>  Show and reset stats every <seconds> seconds
--onlyaddr  Show only ICAO addresses (testing purposes)
--metric  Use metric units (meters, km/h, ...)
--snip <level>  Strip IQ file removing samples < level
--debug <flags>  Debug mode (verbose), see README for details
--quiet  Disable output to stdout. Use for daemon applications
--ppm <error>  Set receiver error in parts per million (default 0)
--no-decode  Don't decode the message contents beyond the minimum necessary
--write-json <dir>  Periodically write json output to <dir> (for serving by a separate webserver)
--write-json-every <t>  Write json output every t seconds (default 1)
--json-location-accuracy <n>  Accuracy of receiver location in json metadata: 0=no location, 1=approximate, 2=exact
--help  Show this help

Debug mode flags: d = Log frames decoded with errors
  D = Log frames decoded with zero errors
  c = Log frames with bad CRC
  C = Log frames with good CRC
  p = Log frames with bad preamble
  n = Log network debugging info
  j = Log frames to frames.js, loadable by debug.html

When trying to manually editing settings, you may get following error message;
Code:
Kernel driver is active, or device is claimed by second instance
In the first case, please either detach or blacklist the kernel
(dvb_usb_rtl28xxu), or enable automatic detaching at compile time

usb_claim_interface error -6
Error opening the RTLSDR device: Device or resource busy

To solve this problem, stop the dump1090-mutability by following command , and run the manual configuration process:
Code:
sudo /etc/init.d/dump1090-mutability stop
 
Last edited:

ab cd

Senior Member
#6
HOW TO GET ALTERNATING BLUE/RED CIRCLES IN DUMP1090-MUTABILITY?
Open console and follow these steps:

Code:
cd /usr/share/dump1090-mutability/
dir
#you will see following:
config-template  html
STEP-1: Make a new directory orig-html and copy original files of html directory into new directory orig-html
In case you want to revert back, you can copy back these original files to html.
Code:
cd /usr/share/dump1090-mutability/
sudo mkdir orig-html
sudo cp /usr/share/dump1090-mutability/html/*.* /usr/share/dump1090-mutability/orig-html/

#check that files have been successfully copied in new directory orig-html:

dir /usr/share/dump1090-mutability/orig-html/

#This will be displayed:
config.js  gmap.html  planeObject.js  script.js  spinny.gif  style.css
STEP-2: Now EDIT the file "config.js" in the folder html:
Code:
cd /usr/share/dump1090-mutability/html
sudo nano config.js
This will open file config.js for editing in terminal.
Make changes shown in red.

// --------------------------------------------------------
//
// This file is to configure the configurable settings.
// Load this file before script.js file at gmap.html.
//
// --------------------------------------------------------

// -- Output Settings -------------------------------------
// Show metric values
// This controls the units used in the plane table,
// and whether metric or imperial units are shown first
// in the detailed plane info.
Metric = false; // true or false

// -- Map settings ----------------------------------------
// These settings are overridden by any position information
// provided by dump1090 itself. All positions are in decimal
// degrees.

// Default center of the map.
DefaultCenterLat = 45.0;
DefaultCenterLon = 9.0;
// The google maps zoom level, 0 - 16, lower is further out
DefaultZoomLvl = 7;

SiteShow = true; // true to show a center marker
SiteLat = xx.xxxx; //your Latitude position of the marker
SiteLon = yy.yyyy; //your Longitude
SiteName = "My Radar Site"; // tooltip of the marker


// -- Marker settings -------------------------------------
// The default marker color
MarkerColor = "rgb(127, 127, 127)";
SelectedColor = "rgb(225, 225, 225)";
StaleColor = "rgb(190, 190, 190)";


SiteCircles = true; // true to show circles (only shown if the center marker is$
// In nautical miles or km (depending settings value 'Metric')
SiteCirclesDistances = new Array(50,100,150,200,250,300);

// Show the clocks at the top of the righthand pane? You can disable the clocks$
ShowClocks = true;

// Controls page title, righthand pane when nothing is selected
PageName = "DUMP1090";



After modifications, save (Ctrl+o) and exit (Ctrl+x)

STEP-3: Now modify file script.js in folder html
Code:
cd /usr/share/dump1090-mutability/html
sudo nano script.js
This will open file script.js for editing.
Now press "Ctrl+w" then type "function drawCircle" and press Enter.
The cursor will move to "function drawCircle"
Following code will be displayed. Make changes as shown in red:

function drawCircle(marker, distance) {

var circleColor;
if (distance==50||distance==150||distance==250)circleColor="#0000FF";
if (distance==100||distance==200||distance==300)circleColor="#FF0000";
if (typeof distance === 'undefined') {
return false;

if (!(!isNaN(parseFloat(distance)) && isFinite(distance)) || distance <$
return false;
}
}

distance *= 1000.0;
if (!Metric) {
distance *= 1.852;
}

// Add circle overlay and bind to marker
var circle = new google.maps.Circle({
map: GoogleMap,
radius: distance, // In meters
fillOpacity: 0.0,
strokeColor: circleColor,
strokeWeight: 2,
strokeOpacity: 0.3
});
circle.bindTo('center', marker, 'position');
}


After modifications, save (Ctrl+o) and exit (Ctrl+x)

now run the web interface and you will see colored circles.


Range Rings Dump1090-mutability.PNG.png
 

ab cd

Senior Member
#7
dump1090-mutability: How to change the clock "Last Update" to show your local time on gmap.html page.

Step-1: Open script.js for Editing
Code:
cd /usr/share/dump1090-mutability/html
sudo nano script.js
This will open in nano, the file script.js for editing.

Step-2: Press Ctrl+w and type the search keyword getUTC, and press Enter.
The cursor will jump to first getUTC in the following code:

if (ReceiverClock) {
var rcv = new Date(now * 1000);
ReceiverClock.render(rcv.getUTCHours(),rcv.getUTCMinutes(),rcv.getUTCSeconds());
}



comment out these 4 lines of code (i.e. type // at the start of each line) . It will look like following:

// if (ReceiverClock) {
// var rcv = new Date(now * 1000);
//ReceiverClock.render(rcv.getUTCHours(),rcv.getUTCMinutes(),rcv.getUTCSeconds());
// }

STEP-3: Press Ctrl+w and type keyword ticking and press Enter.
Cursor will jump to word ticking of following code:

// disable ticking on the receiver clock, we will update it ourselves
ReceiverClock.tick = (function(){})

comment out the 2nd line of code (i.e. type // at the start of the line) . It will look like following:

// disable ticking on the receiver clock, we will update it ourselves
//ReceiverClock.tick = (function(){})

Step-4: Save the file (Ctrl+o) then exit (Ctrl+x).

Step-5: Reboot RPi. After RPi has rebooted, reload page gmap.html


To change the Title of top-right clock from "Last Update" to "Local Time":
Step 1: Open gmap.html to edit.
Code:
cd /usr/share/dump1090-mutability/html
sudo nano gmap.html
This will open in nano, the file gmap.html for editing.

Step-2: Press Ctrl+w and type keyword Last Update, and press Enter.
The cursor will jump to the following line:

<td align="center">Last Update</td>

Change Last Update to Local Time.

The line in gmap.html will become:

<td align="center">Local Time</td>

Now save (Ctrl+o) and exit (Ctrl+x). Reload gmap.html web page.

 
Last edited:

loplo

New Member
#8
I'd keep Last Update, TBH. This way you can spot problems with the hardware. Sometimes the dongle USB can become unresponsive without creasing dump1090, then the right clock would stop at the last time a packet was received.

Edit
With the changes you mentioned, the clock will still stop if no packages received, but it will show local time vs UTC.
Only presumptions, I did not operate these changes.
 

ab cd

Senior Member
#9
I'd keep Last Update, TBH. This way you can spot problems with the hardware. Sometimes the dongle USB can become unresponsive without creasing dump1090, then the right clock would stop at the last time a packet was received.

Edit
With the changes you mentioned, the clock will still stop if no packages received, but it will show local time vs UTC.
Only presumptions, I did not operate these changes.
I am operating my changes for over a month, but never noticed any of the problems you have mentioned.
 

loplo

New Member
#10
Just watch the dial hand showing the seconds, and you can see sometimes stall/jump. IMHO that means that the process hung for a second or two.
 

ab cd

Senior Member
#11
Just watch the dial hand showing the seconds, and you can see sometimes stall/jump. IMHO that means that the process hung for a second or two.
Edited the procedure in post #8. No more stall & jump of seconds' hand.
With new updated procedure, the Receiver Clock (Local Time) is no more updated along with data update. It runs on its own :D
Thanks for pointing out.
 
Last edited:
#12
Just installed the PFClient, all working fine.

The stats and gmap work fine (nice UI on the live stats!), but what i'm most interested in is the
Google Earth - "range-in-direction" map (/ge.html) which doesnt seem to be available anymore?

(http://<Pi_IP>:30053/ge.html doesnt show anything).

Is this still supported - was hoping to use this to build polar (?) data maps locally, rather than VRS on my PC.

THX
 

ab cd

Senior Member
#13
Just installed the PFClient, all working fine.

The stats and gmap work fine (nice UI on the live stats!), but what i'm most interested in is the
Google Earth - "range-in-direction" map (/ge.html) which doesnt seem to be available anymore?

(http://<Pi_IP>:30053/ge.html doesnt show anything).

Is this still supported - was hoping to use this to build polar (?) data maps locally, rather than VRS on my PC.

THX
If I recall correctly, @Lee Armstrong: mentioned that google is going to end webpage support for Google Earth shortly. May be by now this is implemented.
A new BETA2 version of PFClient is now available. That also does not have Google Earth interface, only Google Map interface is available. The advantage of new BETA2 is that it does NOT use node js, and as a result has cpu usage dropped from 25% (pfclient+node js) to less than 1% (beta2)! Try it:

http://forum.planefinder.net/threads/plane-finder-client-beta2-3-0-1435.258/
 
Last edited:

ab cd

Senior Member
#16
Top