STEP-1: Prepare OS
1.1 - Download and write Raspbian Lite image to microSD card.
https://downloads.raspberrypi.org/raspbian_lite_latest
1.2 - Enable SSH
After image is written, and while the microSD Card is still in the Laptop/Desktop, open File Explorer (Windows) or Finder (Mac), and open the drive named “boot” . This will open the /boot folder of Raspbian. In this folder create a new text file and rename it ssh
1.3 - Slip microSD card into RPi and power-up.
.
STEP-2: Serialize the two Dongles:
Serialize dongles to following serial numbers:
Dongle #1: 00000101
Dongle #2: 00000102
How-to Serialize Dongles for ES1090 + UAT978
.
STEP-3: Package install of Piaware and dump1090-fa
wget http://flightaware.com/adsb/piaware/files/packages/pool/piaware/p/piaware-support/piaware-repository_3.7.1_all.deb
sudo dpkg -i piaware-repository_3.7.1_all.deb
sudo apt-get update
sudo apt-get install piaware
sudo piaware-config uat-receiver-type none
sudo piaware-config allow-auto-updates yes
sudo piaware-config allow-manual-updates yes
sudo piaware-config feeder-id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
sudo apt-get install dump1090-fa
sudo reboot
Edit file /etc/default/dump1090-fa
and change device index from 0 to 00000101 as shown below:
RECEIVER_OPTIONS="--device-index 00000101 --gain -10 --ppm 0 --net-bo-port 30005"
.
STEP-4: Create files for second instance of dump1090-fa
4.1 - Create Service file for dump1090-fa2
sudo nano /lib/systemd/system/dump1090-fa2.service
Copy-paste following code and save file
# dump1090-fa2 service for systemd
[Unit]
Description=dump1090 ADS-B receiver (FlightAware customization)
Documentation=https://flightaware.com/adsb/piaware/
Wants=network.target
After=network.target
[Service]
User=dump1090
RuntimeDirectory=dump1090-fa2
RuntimeDirectoryMode=0755
ExecStart=/usr/share/dump1090-fa/start-dump1090-fa2 --write-json %t/dump1090-fa2 --quiet
SyslogIdentifier=dump1090-fa2
Type=simple
Restart=on-failure
RestartSec=30
RestartPreventExitStatus=64
Nice=-5
[Install]
WantedBy=default.target
.
4.2 - Create Startup file for dump1090-fa2
Create new file and make it executeable
sudo touch /usr/share/dump1090-fa/start-dump1090-fa2
sudo chmod +x /usr/share/dump1090-fa/start-dump1090-fa2
Open file in editor
sudo nano /usr/share/dump1090-fa/start-dump1090-fa2
Copy-paste following code and save file
#!/bin/sh
# Helper script that reads /etc/default/dump1090-fa2
# and either starts dump1090-fa2 with the configured
# arguments, or exits with status 64 to tell systemd
# not to auto-restart the service.
if [ -f /etc/default/dump1090-fa2 ]
then
. /etc/default/dump1090-fa2
fi
if [ -f /var/cache/piaware2/location.env ]
then
. /var/cache/piaware2/location.env
fi
if [ "x$ENABLED" != "xyes" ]
then
echo "dump1090-fa2 not enabled in /etc/default/dump1090-fa2" >&2
exit 64
fi
if [ -n "$PIAWARE_LAT" -a -n "$PIAWARE_LON" ]
then
POSITION="--lat $PIAWARE_LAT --lon $PIAWARE_LON"
fi
exec /usr/bin/dump1090-fa \
$RECEIVER_OPTIONS2 $DECODER_OPTIONS2 $NET_OPTIONS2 $JSON_OPTIONS2 $POSITION \
"$@"
# exec failed, do not restart
exit 64
.
4.3 - Create config file for dump1090-fa2
sudo nano /etc/default/dump1090-fa2
Copy-pasted following code and saved file
# dump1090-fa2 configuration
# This is sourced by /usr/share/dump1090-fa/start-dump1090-fa2 as a
# shellscript fragment.
# If you are using a PiAware sdcard image, this config file is regenerated
# on boot based on the contents of piaware-config.txt; any changes made to this
# file will be lost.
# dump1090-fa2 won't automatically start unless ENABLED=yes
ENABLED=yes
RECEIVER_OPTIONS2="--device-index 00000102 --gain -10 --ppm 0 --net-bo-port 31005"
DECODER_OPTIONS2="--max-range 360"
NET_OPTIONS2="--net --net-heartbeat 60 --net-ro-size 1000 --net-ro-interval 1 --net-ri-port 0 --net-ro-port 31002 --net-sbs-port 31003 --net-bi-port 31004,31104 --net-bo-port 31005"
JSON_OPTIONS2="--json-location-accuracy 1"
.
4.4 - Enable auto-start of dump1090-fa2 at boot
sudo systemctl enable dump1090-fa2
sudo systemctl restart dump1090-fa2
STEP-5: Create files for 2nd instance of Piaware
.
5.1 - Create Service file for piaware2
sudo nano /lib/systemd/system/piaware2.service
Copy-paste following code and save file
# piaware uploader service for systemd
# install in /etc/systemd/system
[Unit]
Description=FlightAware ADS-B uploader
Documentation=https://flightaware.com/adsb/piaware/
Wants=network-online.target
After=dump1090-fa2.service network-online.target time-sync.target
[Service]
User=piaware
RuntimeDirectory=piaware2
ExecStart=/usr/bin/piaware -p %t/piaware2/piaware.pid -plainlog -statusfile %t/piaware2/status.json -configfile /etc/piaware2.conf -cachedir /var/cache/piaware2
ExecReload=/bin/kill -HUP $MAINPID
Type=simple
Restart=on-failure
RestartSec=30
# exit code 4 means login failed
# exit code 6 means startup failed (bad args or missing MAC)
RestartPreventExitStatus=4 6
[Install]
WantedBy=default.target
.
5.2 - Create Config file for piaware2
sudo nano /etc/piaware2.conf
Copy-paste following code and save file
NOTE: Replace xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx by actual feeder-id of 2nd instance
# This file configures piaware and related software.
# You can edit it directly or use piaware-config from the command line
# to view and change settings.
#
# If /boot/piaware-config.txt also exists, then settings present in
# that file will override settings in this file.
uat-receiver-type none # updated by fa_piaware_config
allow-auto-updates yes # updated by fa_piaware_config
allow-manual-updates yes # updated by fa_piaware_config
feeder-id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
receiver-type other
receiver-port 31005
receiver-host 127.0.0.1
mlat-results-format beast,connect,localhost:31104
.
5.3 - Create folders for piaware2
sudo mkdir /var/cache/piaware2
sudo chown piaware /var/cache/piaware2
sudo chown piaware /etc/piaware2.conf
sudo systemctl enable piaware2
sudo systemctl start piaware2
.
STEP-6: Map and lighttpd integration for dump1090-fa2
.
6.1 - Create new file for lighttpd configuration for 2nd instance of dump1090-fa:
sudo nano /etc/lighttpd/conf-available/89-dump1090-fa2.conf
Copy-paste following code in the above file
Save file
# Allows access to the static files that provide the dump1090 map view,
# and also to the dynamically-generated json parts that contain aircraft
# data and are periodically written by the dump1090 daemon.
alias.url += (
"/dump1090-fa2/data/" => "/run/dump1090-fa2/",
"/dump1090-fa2/" => "/usr/share/dump1090-fa/html/"
)
# redirect the slash-less URL
url.redirect += (
"^/dump1090-fa2$" => "/dump1090-fa2/"
)
# Listen on port 8181 and serve the map there, too.
$SERVER["socket"] == ":8181" {
alias.url += (
"/data/" => "/run/dump1090-fa2/",
"/" => "/usr/share/dump1090-fa/html/"
)
}
# Add CORS header
$HTTP["url"] =~ "^/dump1090-fa2/data/.*\.json$" {
setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
}
.
6.2 - Enable lighttpd integration for 2nd instance
sudo lighty-enable-mod dump1090-fa2
sudo service lighttpd force-reload
.
STEP-7: Checks
.
7.1 - dump1090-fa
pi@raspberrypi:~ $ sudo systemctl status dump1090-fa
● dump1090-fa.service - dump1090 ADS-B receiver (FlightAware customization)
Loaded: loaded (/lib/systemd/system/dump1090-fa.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2019-06-24 05:45:31 EDT; 2h 13min ago
Docs: https://flightaware.com/adsb/piaware/
Main PID: 498 (dump1090-fa)
CGroup: /system.slice/dump1090-fa.service
└─498 /usr/bin/dump1090-fa --device-index 0 --gain 42.1 --ppm 0 --net-bo-port 30005 --max-range 360 --net --net-heartbeat
Jun 24 05:45:31 raspberrypi systemd[1]: Started dump1090 ADS-B receiver (FlightAware customization).
Jun 24 05:45:32 raspberrypi dump1090-fa[498]: Mon Jun 24 05:45:32 2019 EDT dump1090-fa 3.7.1 starting up.
Jun 24 05:45:33 raspberrypi dump1090-fa[498]: rtlsdr: using device #0: Generic RTL2832U OEM (Realtek, RTL2838UHIDIR, SN 0)
Jun 24 05:45:33 raspberrypi dump1090-fa[498]: Found Rafael Micro R820T tuner
Jun 24 05:45:34 raspberrypi dump1090-fa[498]: rtlsdr: tuner gain set to 42.1 dB
.
7.2 - dump1090-fa2
pi@raspberrypi:~ $ sudo systemctl status dump1090-fa2
● dump1090-fa2.service - dump1090 ADS-B receiver (FlightAware customization)
Loaded: loaded (/lib/systemd/system/dump1090-fa2.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2019-06-24 05:45:31 EDT; 2h 16min ago
Docs: https://flightaware.com/adsb/piaware/
Main PID: 481 (dump1090-fa)
CGroup: /system.slice/dump1090-fa2.service
└─481 /usr/bin/dump1090-fa --device-index 1 --gain -10 --ppm 0 --net-bo-port 31005 --max-range 360 --net --net-heartbeat
Jun 24 05:45:31 raspberrypi systemd[1]: Started dump1090 ADS-B receiver (FlightAware customization).
Jun 24 05:45:32 raspberrypi dump1090-fa2[481]: Mon Jun 24 05:45:32 2019 EDT dump1090-fa 3.7.1 starting up.
Jun 24 05:45:33 raspberrypi dump1090-fa2[481]: rtlsdr: using device #1: Generic RTL2832U (Realtek, RTL2832UFA, SN 1)
Jun 24 05:45:33 raspberrypi dump1090-fa2[481]: Found Rafael Micro R820T tuner
Jun 24 05:45:33 raspberrypi dump1090-fa2[481]: rtlsdr: enabling tuner AGC
.
7.3 - piaware
raspberrypi:~ $ sudo systemctl status piaware
● piaware.service - FlightAware ADS-B uploader
Loaded: loaded (/lib/systemd/system/piaware.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2019-06-24 05:45:31 EDT; 2h 22min ago
Docs: https://flightaware.com/adsb/piaware/
Main PID: 499 (piaware)
CGroup: /system.slice/piaware.service
├─499 /usr/bin/piaware -p /run/piaware/piaware.pid -plainlog -statusfile /run/piaware/status.json
├─795 /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr localhost --net-bo-port 30005 --stdout --lat 43.xxx --lon -79.xxx
└─813 /usr/lib/piaware/helpers/fa-mlat-client --input-connect localhost:30005 --input-type dump1090 --results beast,connect,localhost:30104
Jun 24 07:51:08 raspberrypi piaware[499]: 21278 msgs recv'd from dump1090-fa (851 in last 5m); 21278 msgs sent to FlightAware
Jun 24 07:56:08 raspberrypi piaware[499]: 22153 msgs recv'd from dump1090-fa (875 in last 5m); 22153 msgs sent to FlightAware
Jun 24 08:00:49 raspberrypi piaware[499]: mlat-client(813): Receiver status: connected
Jun 24 08:00:49 raspberrypi piaware[499]: mlat-client(813): Server status: synchronized with 139 nearby receivers
Jun 24 08:00:49 raspberrypi piaware[499]: mlat-client(813): Receiver: 141.4 msg/s received 43.4 msg/s processed (31%)
Jun 24 08:00:49 raspberrypi piaware[499]: mlat-client(813): Server: 0.1 kB/s from server 0.0kB/s TCP to server 0.5kB/s UDP to s
Jun 24 08:00:49 raspberrypi piaware[499]: mlat-client(813): Results: 54.4 positions/minute
Jun 24 08:00:49 raspberrypi piaware[499]: mlat-client(813): Aircraft: 17 of 38 Mode S, 18 of 21 ADS-B used
Jun 24 08:01:08 raspberrypi piaware[499]: 23154 msgs recv'd from dump1090-fa (1001 in last 5m); 23154 msgs sent to FlightAware
Jun 24 08:06:08 raspberrypi piaware[499]: 24259 msgs recv'd from dump1090-fa (1105 in last 5m); 24259 msgs sent to FlightAware
.
7.4 - piaware2
raspberrypi:~ $ sudo systemctl status piaware2
● piaware2.service - FlightAware ADS-B uploader
Loaded: loaded (/lib/systemd/system/piaware2.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2019-06-24 05:45:31 EDT; 2h 24min ago
Docs: https://flightaware.com/adsb/piaware/
Main PID: 503 (piaware)
CGroup: /system.slice/piaware2.service
├─503 /usr/bin/piaware -p /run/piaware2/piaware.pid -plainlog -statusfile /run/piaware2/status.json -configfile /etc/piaware2.co
├─808 /usr/lib/piaware/helpers/faup1090 --net-bo-ipaddr 127.0.0.1 --net-bo-port 31005 --stdout --lat 43.xxx --lon -79.xxx
└─821 /usr/lib/piaware/helpers/fa-mlat-client --input-connect 127.0.0.1:31005 --input-type auto --results beast,connect,localhost:31104
Jun 24 07:51:08 raspberrypi piaware[503]: 20533 msgs recv'd from dump1090-fa (904 in last 5m); 20533 msgs sent to FlightAware
Jun 24 07:56:08 raspberrypi piaware[503]: 21341 msgs recv'd from dump1090-fa (808 in last 5m); 21341 msgs sent to FlightAware
Jun 24 08:00:49 raspberrypi piaware[503]: mlat-client(821): Receiver status: connected
Jun 24 08:00:49 raspberrypi piaware[503]: mlat-client(821): Server status: synchronized with 138 nearby receivers
Jun 24 08:00:49 raspberrypi piaware[503]: mlat-client(821): Receiver: 126.9 msg/s received 41.6 msg/s processed (33%)
Jun 24 08:00:49 raspberrypi piaware[503]: mlat-client(821): Server: 0.1 kB/s from server 0.0kB/s TCP to server 0.4kB/s UDP to s
Jun 24 08:00:49 raspberrypi piaware[503]: mlat-client(821): Results: 59.6 positions/minute
Jun 24 08:00:49 raspberrypi piaware[503]: mlat-client(821): Aircraft: 16 of 36 Mode S, 22 of 26 ADS-B used
Jun 24 08:01:08 raspberrypi piaware[503]: 22293 msgs recv'd from dump1090-fa (952 in last 5m); 22293 msgs sent to FlightAware
Jun 24 08:06:08 raspberrypi piaware[503]: 23423 msgs recv'd from dump1090-fa (1130 in last 5m); 23423 msgs sent to FlightAware
.
7.5 - Map of original instance
IP-of-Pi/dump1090-fa/
.
7.6 - Map of 2nd instance
IP-of-Pi/dump1090-fa2/