From charlesreid1

 
(25 intermediate revisions by one other user not shown)
Line 1: Line 1:
Scripts to install prerequisites for flight-aware: https://charlesreid1.com:3000/charlesreid1/flight-aware
==Hardware==


==Hardware==
The FlightAware hardware consists of a standard RTL-SDR dongle, plus an optional noise filter (the cylinder on the right). The FlightAware USB stick plugs into the computer, and the other end connects to an antenna.


{|
{|
Line 9: Line 9:
|}
|}


==Software==
==Software/Installation==
 
Scripts to execute the commands below can be downloaded here: https://git.charlesreid1.com/charlesreid1/flight-aware
 
In the end you will have software receiving signals from aircraft transponders, decoding the information, displaying it in a dashboard, and forwarding it on to FlightAware.
 
[[Image:FlightStatsLocal2.png|500px]]
 
===Install software needed===


Start by installing stuff that you need:
Start by installing stuff that you need:


<pre>
<pre>
#!/bin/sh
#
# pastebin.com/eKbm118F
#
# This installs prereqs and builds rtl-sdr.
# You will need to reboot at the end.
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "~~~ INSTALLING STUFF ~~~~~~~~~~~~~~~~~~~~~~"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
apt-get install -y \
apt-get install -y \
libboost-all-dev \
libboost-all-dev \
Line 32: Line 29:
devscripts \
devscripts \
cmake \
cmake \
portaudio19-dev
portaudio19-dev \
 
iproute \
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
python-virtualenv
echo "~~~ INSTALLING EVEN MORE STUFF ~~~~~~~~~~~~"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"


apt-get install -y \
apt-get install -y \
Line 45: Line 40:
tcllib \
tcllib \
tcl-tclreadline \
tcl-tclreadline \
</pre>
===Install RTL-SDR===


echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
Next, install rtl-sdr package from osmocom. We will also need to disable the DVB driver, not using this for TV.
echo "~~~ INSTALLING RTL-SDR STUFF ~~~~~~~~~~~~~~"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"


git clone git://git.osmocom.org/rtl-sdr.git /root/codes/rtl-sdr
<pre>
cd /root/codes/rtl-sdr
export RTL_DIR="/root/codes/rtl-sdr"
git clone git://git.osmocom.org/rtl-sdr.git ${RTL_DIR}
cd ${RTL_DIR}
mkdir build
mkdir build
cd build
cd build
Line 57: Line 55:
make
make
make install
make install
cd /root
cp ${RTL_SDR}/rtl-sdr.rules /etc/udev/rules.d/.
cp /root/codes/rtl-sdr/rtl-sdr.rules /etc/udev/rules.d/.
ldconfig
ldconfig


echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
# disable DVB driver
echo "~~~ DISABLING DVB DRIVER. NO TV HERE BRO ~~"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
 
mkdir -p /etc/modprobe.d/
mkdir -p /etc/modprobe.d/
cd /etc/modprobe.d/
cd /etc/modprobe.d/
echo "blacklist dvb_usb_rtl28xxu" >> /etc/modprobe.d/ban-rtl.conf
</pre>


echo "blacklist dvb_usb_rtl28xxu" >> /etc/modprobe.d/ban-rtl.conf
Before moving on to the next step, need to restart.


echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
After restarting, plug the FlightAware device in.
echo "~~~ OKAY NOW PLUG IN THE RECEIVER BRO ~~~~~"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "~~~ WHEN U R DONE THEN RESTART ~~~~~~~~~~~~"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
</pre>


Next, install software specifically for dump1090. Once you're finished, you should be able to see some flight info:
===Install dump1090-fa===


<pre>
Next, we need to install a program to dump out (and decode) information from the 1090 MHz band. There is a dump1090 program (generic), and there is a dump1090-fa program (specific to FlightAware). We will install dump1090-fa. At the conclusion of this step, you should be able to see your first flight information decoded from the receiver.
#!/bin/sh
#
# pastebin.com/eKbm118F
#
# This installs dump1090_mr.
# The last step should show some flight info.


echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
Start by checkout out a copy of the flightaware dump1090 repo:
echo "~~~ INSTALLING DUMP1090_MR ~~~~~~~~~~~~~~~~"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"


<pre>
DUMP1090_PATH="/root/codes/dump1090"
DUMP1090_PATH="/root/codes/dump1090"
git clone https://www.github.com/flightaware/dump1090 ${DUMP1090_PATH}
git clone https://www.github.com/flightaware/dump1090 ${DUMP1090_PATH}
cd ${DUMP1090_PATH}
cd ${DUMP1090_PATH}
make BLADERF=no
</pre>


echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
You DO NOT want to build this manually - that will cause dump1090 binaries to sit in that directory and they will not be found on your path. Furthermore, there will be no startup service, and the piaware program tries to invoke dump1090-fa via a startup service. So, just build the .deb package. (If you see warnings about not being able to sign the package with a GPG key, that's okay, we're just building the package for ourselves.)
echo "~~~ OK BRO HERE GOES ~~~~~~~~~~~~~~~~~~~~~~"
echo "~~~ HOPE U SEE SOME PLANE STUFF RN ~~~~~~~~"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"


${DUMP1090_PATH}/dump1090 --interactive
<pre>
./prepare-wheezy-tree.sh
cd package-wheezy/
dpkg-buildpackage -b
</pre>
 
Now install the two packages created, in the specified order:
 
<pre>
cd ../
dpkg -i dump1090-fa_3.5.1~bpo9+1_amd64.deb
dpkg -i dump1090_3.5.1~bpo9+1_all.deb
</pre>
</pre>


Finally, install the tcllauncher for flightaware:
This installs a binary called dump1090-fa, as well as installing a startup service called dump1090-fa. Running the command below should reveal a new startup service called dump1090-fa:


<pre>
<pre>
#!/bin/sh
$ service --status-all
#
</pre>
# pastebin.com/eKbm118F
#
# tinyurl.com/y7lghzs4
#
# The FlightAware should now be working.
# This script will install PiAware
# so you have a fancy-pants dashboard.


echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
===Test dump1090-fa===
echo "~~~ INSTALL FLIGHTAWARE TCLLAUNCHER ~~~~~~~"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"


Now we can test the dump1090-fa binary. First, make sure your FlightAware RTL-SDR dongle is plugged in. If you have problems with the commands below, you can also try restarting.
First, test the dump1090-fa utility (standalone, not as a startup service):
<pre>
dump1090-fa --interactive
</pre>
[[Image:Dump1090Interactive_Screenshot.png|500px]]
===Install Piaware===
Two steps:
* Install tcllauncher for Piaware GUI
* Install Piaware debian package
Start with tcllauncher:
<pre>
export FA_DIR="/root/codes/tcllauncher"
export FA_DIR="/root/codes/tcllauncher"
git clone https://github.com/flightaware/tcllauncher.git ${FA_DIR}
git clone https://github.com/flightaware/tcllauncher.git ${FA_DIR}
Line 128: Line 130:
make
make
make install
make install
</pre>


echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
Next, install piaware:
echo "~~~ INSTALL PIAWARE ~~~~~~~~~~~~~~~~~~~~~~~"
echo "~~~ (IF N.E.1 AXES, UR RUNNIN WHEEZY) ~~~~~"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"


<pre>
export PIAWARE_DIR="/root/codes/piaware_builder"
export PIAWARE_DIR="/root/codes/piaware_builder"
git clone https://github.com/flightaware/piaware_builder.git ${PIAWARE_DIR}
git clone https://github.com/flightaware/piaware_builder.git ${PIAWARE_DIR}
cd ${PIAWARE_DIR}
cd ${PIAWARE_DIR}
./sensible-build.sh wheezy
./sensible-build.sh wheezy
cd package-wheezy/
dpkg-buildpackage -b
cd ../
dpkg -i piaware_3.5.1~bpo9+1_amd64.deb
sudo update-rc.d piaware defaults
</pre>
===Set Piaware Configuration===
Set flightaware credentials by editing <code>/etc/piaware.conf</code>:
<pre>
flightaware-user <username>
flightaware-password <password>
mlat-results no
wired-network yes
</pre>
==Running==
===Start Dump1090 Startup Service===
Once you've run through each of the steps above, you can run piaware by first starting the dump1090-fa startup service, then starting the piaware startup service:


make
<pre>
make install
$ service dump1090-fa start
sudo update-rc.d piaware defaults
$ service piaware start
</pre>
 
When you run the command to check on the status of the piaware service, you should see a line that says "piaware received a message from dump1090-fa!"


echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
<pre>
echo "~~~ NOW SET UR FLIGHTAWARE CREDS ~~~~~~~~~~"
# systemctl status piaware
echo "~~~ service piaware start ~~~~~~~~~~~~~~~~~"
echo "~~~ piaware-config -user USERNAME -password"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
</pre>
</pre>
See [[#Troubleshooting]] section below for expected output.
===FlightAware Flight Stats Page===
To submit information to FlightAware, you need a FlightAware username. FlightAware keeps track of the statics that you have submitted to their site. The stats page for a given FlightAware receiver requires an internet connection, and can be found by inserting your username in the following URL: <code><nowiki>http://flightaware.com/adsb/stats/user/<username></nowiki></code>.
For example, here's my FlightAware stats page URL: http://flightaware.com/adsb/stats/user/charlesreid1
===Skyview Local Stats Page===
Alternatively, there is a local stats page (Skyview), which requires the lighttpd service to be running. It does not require an internet connection, but without an internet connection you will not see a map. The lighttpd service should have been installed as part of the FlightAware prerequisite software installation step. From the machine running the FlightAware software, start the lighttpd service:
<pre>
$ service lighttpd start
</pre>
This should open port 8080. Next, visit localhost:8080 from that machine, or 192.168.X.Y:8080 (use the IP address of the machine running FlightAware) to connect to the page over the local network. You should see a page like the screenshot below. If you get a 404 or a page not found, make sure the lighttpd service is running.
[[Image:FlightStatsLocal.png|500px]]


==Troubleshooting==
==Troubleshooting==
Line 155: Line 199:


To check on the status of piaware, and assuming it was installed using the piaware_builder repository (i.e., that you built a debian package and installed it using dpkg), which also creates a startup service, you can use systemctl to check on the status of the startup service:
To check on the status of piaware, and assuming it was installed using the piaware_builder repository (i.e., that you built a debian package and installed it using dpkg), which also creates a startup service, you can use systemctl to check on the status of the startup service:
Output:
[[Image:SystemctlStatusPiawareSuccess.png|500px]]


<pre>
<pre>
Line 186: Line 234:
<pre>
<pre>
# cat /run/piaware/status.json  
# cat /run/piaware/status.json  
</pre>
If everything is okay, you will see something like this:
<pre>
{
    "piaware"  : {
        "status"  : "green",
        "message" : "PiAware 3.5.1 is running"
    },
    "expiry"  : 1503098467731,
    "interval" : 5000,
    "mlat"    : {
        "status"  : "red",
        "message" : "Multilateration is not enabled"
    },
    "adept"    : {
        "status"  : "green",
        "message" : "Connected to FlightAware and logged in"
    },
    "radio"    : {
        "status"  : "green",
        "message" : "Received Mode S data recently"
    },
    "time"    : 1503098456731
}
</pre>
If something is wrong with the hardware and/or the communication with dump1090-fa, you will see something like this:
<pre>
{
{
     "piaware"  : {
     "piaware"  : {
Line 208: Line 287:
}
}
</pre>
</pre>


==Links==
==Links==
Line 232: Line 308:


==Flags==
==Flags==
{{SDRFlag}}
{{RadioFlag}}


[[Category:Radio]]
[[Category:Radio]]
[[Category:SDR]]
[[Category:SDR]]

Latest revision as of 20:33, 17 August 2020

Hardware

The FlightAware hardware consists of a standard RTL-SDR dongle, plus an optional noise filter (the cylinder on the right). The FlightAware USB stick plugs into the computer, and the other end connects to an antenna.

FlightAwareHardware1.jpg FlightAwareHardware2.jpg

Software/Installation

Scripts to execute the commands below can be downloaded here: https://git.charlesreid1.com/charlesreid1/flight-aware

In the end you will have software receiving signals from aircraft transponders, decoding the information, displaying it in a dashboard, and forwarding it on to FlightAware.

FlightStatsLocal2.png

Install software needed

Start by installing stuff that you need:

apt-get install -y \
	libboost-all-dev \
	libusb-1.0 \
	libusb-dev \
	libusb-1.0-0-dev \
	devscripts \
	cmake \
	portaudio19-dev \
	iproute \
	python-virtualenv

apt-get install -y \
	tcl8.5-dev \
	tclx8.4-dev \
	itcl3-dev \
	tcl-tls \
	tcllib \
	tcl-tclreadline \

Install RTL-SDR

Next, install rtl-sdr package from osmocom. We will also need to disable the DVB driver, not using this for TV.

export RTL_DIR="/root/codes/rtl-sdr"
git clone git://git.osmocom.org/rtl-sdr.git ${RTL_DIR}
cd ${RTL_DIR}
mkdir build
cd build
cmake ../
make
make install
cp ${RTL_SDR}/rtl-sdr.rules /etc/udev/rules.d/.
ldconfig

# disable DVB driver
mkdir -p /etc/modprobe.d/
cd /etc/modprobe.d/
echo "blacklist dvb_usb_rtl28xxu" >> /etc/modprobe.d/ban-rtl.conf

Before moving on to the next step, need to restart.

After restarting, plug the FlightAware device in.

Install dump1090-fa

Next, we need to install a program to dump out (and decode) information from the 1090 MHz band. There is a dump1090 program (generic), and there is a dump1090-fa program (specific to FlightAware). We will install dump1090-fa. At the conclusion of this step, you should be able to see your first flight information decoded from the receiver.

Start by checkout out a copy of the flightaware dump1090 repo:

DUMP1090_PATH="/root/codes/dump1090"
git clone https://www.github.com/flightaware/dump1090 ${DUMP1090_PATH}
cd ${DUMP1090_PATH}

You DO NOT want to build this manually - that will cause dump1090 binaries to sit in that directory and they will not be found on your path. Furthermore, there will be no startup service, and the piaware program tries to invoke dump1090-fa via a startup service. So, just build the .deb package. (If you see warnings about not being able to sign the package with a GPG key, that's okay, we're just building the package for ourselves.)

./prepare-wheezy-tree.sh
cd package-wheezy/
dpkg-buildpackage -b

Now install the two packages created, in the specified order:

cd ../
dpkg -i dump1090-fa_3.5.1~bpo9+1_amd64.deb
dpkg -i dump1090_3.5.1~bpo9+1_all.deb

This installs a binary called dump1090-fa, as well as installing a startup service called dump1090-fa. Running the command below should reveal a new startup service called dump1090-fa:

$ service --status-all

Test dump1090-fa

Now we can test the dump1090-fa binary. First, make sure your FlightAware RTL-SDR dongle is plugged in. If you have problems with the commands below, you can also try restarting.

First, test the dump1090-fa utility (standalone, not as a startup service):

dump1090-fa --interactive

Dump1090Interactive Screenshot.png

Install Piaware

Two steps:

  • Install tcllauncher for Piaware GUI
  • Install Piaware debian package

Start with tcllauncher:

export FA_DIR="/root/codes/tcllauncher"
git clone https://github.com/flightaware/tcllauncher.git ${FA_DIR}
cd ${FA_DIR}
autoconf
./configure --with-tcl=/usr/lib/tcl8.5
make
make install

Next, install piaware:

export PIAWARE_DIR="/root/codes/piaware_builder"
git clone https://github.com/flightaware/piaware_builder.git ${PIAWARE_DIR}
cd ${PIAWARE_DIR}
./sensible-build.sh wheezy
cd package-wheezy/
dpkg-buildpackage -b
cd ../
dpkg -i piaware_3.5.1~bpo9+1_amd64.deb
sudo update-rc.d piaware defaults

Set Piaware Configuration

Set flightaware credentials by editing /etc/piaware.conf:

flightaware-user <username>
flightaware-password <password>
mlat-results no
wired-network yes

Running

Start Dump1090 Startup Service

Once you've run through each of the steps above, you can run piaware by first starting the dump1090-fa startup service, then starting the piaware startup service:

$ service dump1090-fa start
$ service piaware start

When you run the command to check on the status of the piaware service, you should see a line that says "piaware received a message from dump1090-fa!"

# systemctl status piaware

See #Troubleshooting section below for expected output.

FlightAware Flight Stats Page

To submit information to FlightAware, you need a FlightAware username. FlightAware keeps track of the statics that you have submitted to their site. The stats page for a given FlightAware receiver requires an internet connection, and can be found by inserting your username in the following URL: http://flightaware.com/adsb/stats/user/<username>.

For example, here's my FlightAware stats page URL: http://flightaware.com/adsb/stats/user/charlesreid1

Skyview Local Stats Page

Alternatively, there is a local stats page (Skyview), which requires the lighttpd service to be running. It does not require an internet connection, but without an internet connection you will not see a map. The lighttpd service should have been installed as part of the FlightAware prerequisite software installation step. From the machine running the FlightAware software, start the lighttpd service:

$ service lighttpd start

This should open port 8080. Next, visit localhost:8080 from that machine, or 192.168.X.Y:8080 (use the IP address of the machine running FlightAware) to connect to the page over the local network. You should see a page like the screenshot below. If you get a 404 or a page not found, make sure the lighttpd service is running.

FlightStatsLocal.png

Troubleshooting

Checking Status: Method 1

To check on the status of piaware, and assuming it was installed using the piaware_builder repository (i.e., that you built a debian package and installed it using dpkg), which also creates a startup service, you can use systemctl to check on the status of the startup service:

Output:

SystemctlStatusPiawareSuccess.png

# systemctl status piaware

● piaware.service - FlightAware ADS-B uploader
   Loaded: loaded (/etc/systemd/system/piaware.service; disabled; vendor preset: disabled)
   Active: active (running) since Fri 2017-08-18 04:22:31 PDT; 10h ago
     Docs: https://flightaware.com/adsb/piaware/
 Main PID: 2831 (piaware)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/piaware.service
           └─2831 /usr/bin/piaware -p /run/piaware/piaware.pid -plainlog -statusfile /run/piaware/status.json

Aug 18 15:12:34 WindowsXP sudo[3810]:  piaware : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/netstat --program --tcp --wide --all --
Aug 18 15:12:34 WindowsXP sudo[3810]: pam_unix(sudo:session): session opened for user root by (uid=0)
Aug 18 15:12:34 WindowsXP sudo[3810]: pam_unix(sudo:session): session closed for user root
Aug 18 15:12:34 WindowsXP piaware[2831]: no ADS-B data program seen listening on port 30005 for 370 seconds, trying to start it...
Aug 18 15:12:34 WindowsXP piaware[2831]: attempting to start dump1090..
Aug 18 15:12:34 WindowsXP piaware[2831]: can't start dump1090, no services that look like dump1090 found
Aug 18 15:12:44 WindowsXP sudo[3813]:  piaware : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/netstat --program --tcp --wide --all --
Aug 18 15:12:44 WindowsXP sudo[3813]: pam_unix(sudo:session): session opened for user root by (uid=0)
Aug 18 15:12:44 WindowsXP sudo[3813]: pam_unix(sudo:session): session closed for user root
Aug 18 15:12:44 WindowsXP piaware[2831]: no ADS-B data program seen listening on port 30005 for 10 seconds, next check in 60s

Checking Status: Method 2

To check the status of piaware, you can also use the status.json file:

# cat /run/piaware/status.json 

If everything is okay, you will see something like this:

{
    "piaware"  : {
        "status"  : "green",
        "message" : "PiAware 3.5.1 is running"
    },
    "expiry"   : 1503098467731,
    "interval" : 5000,
    "mlat"     : {
        "status"  : "red",
        "message" : "Multilateration is not enabled"
    },
    "adept"    : {
        "status"  : "green",
        "message" : "Connected to FlightAware and logged in"
    },
    "radio"    : {
        "status"  : "green",
        "message" : "Received Mode S data recently"
    },
    "time"     : 1503098456731
}

If something is wrong with the hardware and/or the communication with dump1090-fa, you will see something like this:

{
    "piaware"  : {
        "status"  : "green",
        "message" : "PiAware 3.5.1 is running"
    },
    "expiry"   : 1503094220448,
    "interval" : 5000,
    "mlat"     : {
        "status"  : "red",
        "message" : "Multilateration is not enabled"
    },
    "adept"    : {
        "status"  : "green",
        "message" : "Connected to FlightAware and logged in"
    },
    "radio"    : {
        "status"  : "red",
        "message" : "Not connected to receiver"
    },
    "time"     : 1503094209448
}

Links

Multilateration (MLAT) overview: https://flightaware.com/adsb/mlat/

PiAware if you already have dump1090: http://flightaware.com/adsb/piaware/install

PiAware building base station: http://flightaware.com/adsb/piaware/build

PiAware repo: https://github.com/flightaware/piaware

PiAware builder repo: https://github.com/flightaware/piaware_builder

PiAware repo wiki - release notes: https://github.com/flightaware/piaware/wiki/PiAware-Release-Notes

  • "Piaware will now attempt to start dump1090 if no ADS-B producer program is seen listening for connections on port 30005 (the "Beast" binary data port) for more than six minutes."

Dump1090 repo: https://github.com/flightaware/dump1090

FlightAware stats: https://flightaware.com/adsb/stats/user/charlesreid1

Flags