Setting Up PiAware

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’

 1# interfaces(5) file used by ifup(8) and ifdown(8)
 2
 3# Please note that this file is written to be used with dhcpcd
 4# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
 5
 6# Include files from /etc/network/interfaces.d:
 7source-directory /etc/network/interfaces.d
 8
 9auto lo wlan0
10iface lo inet loopback
11
12iface eth0 inet dhcp
13
14allow-hotplug wlan0
15iface wlan0 inet dhcp
16    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
17
18allow-hotplug wlan1
19iface wlan1 inet manual
20    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

For ‘/etc/wpa_supplicant/wpa_supplicant.conf’

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

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

1/root/network_monitor.sh &

The contents of ‘/root/network_monitor.sh’

 1#!/bin/bash
 2
 3while true ; do
 4	if ifconfig wlan0 | grep -q "inet addr:" ; then
 5		sleep 60
 6	else
 7		echo "Network connection down! Attempting reconnection."
 8		ifup --force wlan0
 9		sleep 10
10	fi
11done

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’)

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

 1Subject: Welcome!  PiAware 'ab:cd:ef:c5:af:8a' activated and now live on FlightAware!
 2From: "FlightAware" <______@flightaware.com>
 3Reply-To: ______@flightaware.com
 4To: "Louis Kowolowski" <______@cryptomonkeys.org>
 5date = Sun, 22 May 2016 17:56:15 -0400
 6
 7Dear Louis Kowolowski,
 8
 9Good news!  We are now receiving and processing live data from your PiAware 
10(ab:cd:ef:c5:af:8a).
11
12You can view your receiver's statistics & rankings, plus you should set your 
13exact location and nearest airport here:
14
15https://flightaware.com/adsb/stats/user/lkowolowski
16
17It is important that your location be set precisely on that page in order for 
18multilateration (MLAT) to work.
19
20Going forward, as long as your Raspberry Pi is running, it should continue to 
21feed FlightAware automatically without any further effort.
22
23From your local network, you can access the live PiAware web interface here: 
24http://10.10.2.20:8080/
25
26Remember that the signals from aircraft are not designed to penetrate objects, 
27so the antenna should be located "line of sight" to the sky with no 
28obstructions. The most optimal installations, which are installed outdoors and 
29on a roof, have a range of over 250mi/400km.
30
31Thanks for your participation and have fun!  Please spread the word to friends 
32so that we can work together to improve coverage around the world
33
34FlightAware ADS-B Team
35adsbsupport@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

1[louisk@piaware ]$ sudo piaware-status
2dump1090 is running.
3faup1090 is running.
4piaware is running.
5dump1090 is listening for connections on port 30005.
6faup1090 is connected to port 30005.
7piaware is connected to FlightAware.
8dump1090 is producing data on port 30005.
9[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

Copyright

Comments