Setting up PiAware

 22.05.2016 -  Louis Kowolowski -  ~5 Minutes

Notes from setting up a PiAware   (Raspberry Pi based flight tracker.

Instructions available from FlightAware   ). In the begining it was a little bumpy because I was trying to start off using wifi instead of a wire. Once I got the wifi bits configured, things improved quite a bit. Ended up with a properly functioning PiAware that is sending flight information to FlightAware   .

Annoying things I encountered

  • Raspian boots into X, requiring a mouse to operate
  • Wifi doesn’t appear to be functional from the base image
  • Instructions on “clicking a wifi gui” were not helpful, there wasn’t one
  • wpa-supplicant didn’t run on boot

Doing the Install

As described on the PiAware documentation, the install consists of downloading the proper application (Mac vs Windows) and the img file. The application will write the img file to the (micro) SD card. Once that’s done, insert the card into the RPi (Raspberry Pi), hook up power and HDMI and you should be presented with a booting system that deposits you in X.

Setup and Configuration

Once booted, I was left looking at a logged-in X-session. I suspect most people plug the RPi in to ethernet and the magic dhcp does things. I didn’t have handy way to have both ethernet and HDMI plugged in, so I opted for HDMI and wifi. By default, I wasn’t able to figure out a pointy-clicky way to configure the wireless. There were references to a wifi configuration button, but all I could find was a network button that wouldn’t let me make any changes (select interface, and if wlan0 is selected, there is a space for ssid, but again, no changes could be made). After a little googling, I found that I needed to make the following changes:

  • /etc/network/interfaces
  • /etc/wpa_supplicant/wpa_supplicant.conf

For ‘/etc/network/interfaces’

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo wlan0
iface lo inet loopback

iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

For ‘/etc/wpa_supplicant/wpa_supplicant.conf’

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
	ssid="FBI Surveillance Van 02"
	psk="booger"
}

Add the following line to ‘/etc/rc.local’ to the bottom (well, not quite the bottom, right above the ’exit 0’ line.

/root/network_monitor.sh &

The contents of ‘/root/network_monitor.sh’

#!/bin/bash

while true ; do
	if ifconfig wlan0 | grep -q "inet addr:" ; then
		sleep 60
	else
		echo "Network connection down! Attempting reconnection."
		ifup --force wlan0
		sleep 10
	fi
done

After all this, I was able to reboot and have it join the network and acquire an IP (you can see it with ‘ifconfig wlan0’)

[pi@piaware ]$ ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr b8:27:eb:90:fa:df
          inet addr:10.10.2.20  Bcast:10.10.2.255  Mask:255.255.255.0
          inet6 addr: fe80::ba27:ebff:fe90:fadf/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:109395 errors:0 dropped:9 overruns:0 frame:0
          TX packets:99887 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:11800753 (11.2 MiB)  TX bytes:68059764 (64.9 MiB)

[pi@piaware ]$

Updates

From the terminal run ‘apt-get update’ and ‘apt-get upgrade’ to pull down the updated packages. Nothing fancy or exciting. No gotchas.

Fully functioning

You should be able to login to the FlightAware   site now and claim your PiAware (now that it has network connectivity, it should’ve registered). You have a control panel where you can configure a number of items ranging from privacy visibility on maps, outage notifications, location information, and view statistics about your PiAware.

The last change I made to the PiAware was to disable the “boot to X”. Having to plug a mouse in to use a system that typically acts headless is silly.

Welcome E-Mail

Subject: Welcome!  PiAware 'ab:cd:ef:c5:af:8a' activated and now live on FlightAware!
From: "FlightAware" <______@flightaware.com>
Reply-To: ______@flightaware.com
To: "Louis Kowolowski" <______@cryptomonkeys.org>
date = Sun, 22 May 2016 17:56:15 -0400

Dear Louis Kowolowski,

Good news!  We are now receiving and processing live data from your PiAware 
(ab:cd:ef:c5:af:8a).

You can view your receiver's statistics & rankings, plus you should set your 
exact location and nearest airport here:

https://flightaware.com/adsb/stats/user/lkowolowski

It is important that your location be set precisely on that page in order for 
multilateration (MLAT) to work.

Going forward, as long as your Raspberry Pi is running, it should continue to 
feed FlightAware automatically without any further effort.

From your local network, you can access the live PiAware web interface here: 
http://10.10.2.20:8080/

Remember that the signals from aircraft are not designed to penetrate objects, 
so the antenna should be located "line of sight" to the sky with no 
obstructions. The most optimal installations, which are installed outdoors and 
on a roof, have a range of over 250mi/400km.

Thanks for your participation and have fun!  Please spread the word to friends 
so that we can work together to improve coverage around the world

FlightAware ADS-B Team
adsbsupport@flightaware.com

Local viewing

Lastly, you can view what your PiAware sees by visiting http://<your PiAware ip>:8080. You should see something that looks similar to this

Clicking on one of the planes will provide more information including things like altitude, speed, track, and squawk code.

You can check the status of your PiAware on the Cli with

[louisk@piaware ]$ sudo piaware-status
dump1090 is running.
faup1090 is running.
piaware is running.
dump1090 is listening for connections on port 30005.
faup1090 is connected to port 30005.
piaware is connected to FlightAware.
dump1090 is producing data on port 30005.
[louisk@piaware ]$

Summary

Once the wireless was configured, everything works as expected. Using a small 12" antenna, I can pick up flights with about a 60mi radius. You can get more range with different antenna’s and/or filters. There are also extra pkgs you can use which make the piaware even more fun.

Footnotes and References