Bake a Pi

OPTION-3:
Jessie Lite image + dump1090-mutability + Piaware data feeder

(1) Insert microSD Card in your Desktop/Laptop’s card slot (or use a card reader plugged into USB Port).
(2) Format microSD Card.
(3) Download Jessie Lite image (zip) on your Desktop/Laptop and unzip downloaded file.
(4) Write the unzipped Jessie Lite image to microSD Card.
5) After image is written, and microSD card is still in card reader of Desktop/Laptop, (a) Enable ssh (b) Configure WiFi

(a) To enable SSH:

Windows:
In File Explorer, double click the drive letter of microSD card. This will open the folder /boot and show lots of files and some folders. Right click in /boot folder, and create a new blank file named ssh or ssh.txt

Mac: Open terminal and give following command
$ touch /Volumes/boot/ssh

(b) To enable Wifi on first boot (if required):

Windows:
In File Explorer, double click the drive letter of microSD card. This will open the folder /boot and show lots of files and some folders. Right click in /boot folder and create a new blank file named wpa_supplicant.conf. If your Desktop/Laptop does not show file extensions, configure Windows File explorer to show file extensions. If the file has a hidden extension .txt, it will not enable wifi.

Alternatively you can create this file by giving following command in Windows command prompt console, which will create file with correct extension:
C:\Windows\System32>echo > M:\wpa_supplicant.conf
(Replace letter M by drive letter of your microSD Card in Windows)

Mac: Open terminal and give following command
$ touch /Volumes/boot/wpa_supplicant.conf
Open the Finder program. Select the Micro SD card device labeled piaware. Open the file “wpa_supplicant.conf” in TextEdit.

Windows & Mac: In the opened blank file wpa_supplicant.conf, copy paste following text:



network={
    ssid="YOUR_SSID"
    psk="YOUR_PASSWORD"
}


Replace YOUR_SSID by your router’s wifi ssid, and YOUR_PASSWORD by your router’s wifi password.
Save file. On boot, wifi login info will be automatically copied into file /etc/wpa_supplicant/wpa_supplicant.conf, enabling wifi on first boot.

(6) Remove microSD card from card reader, insert into Pi, power up, and SSH.

(7) Install dump1090-mutability v1.15~dev

Below is a step-by-step method to built & install dump1090-mutability_1.15~dev from source code, and then steps to install data feeders FR24, FA, and PF.

[list]
STEP-1: UPDATE THE OPERATING SYSTEM



sudo apt-get update


STEP-2: INSTALL PRE REQUISIT PACKAGES (needed to build, and needed to fulfill dependencies)



sudo apt-get install -y git
sudo apt-get install -y build-essential
sudo apt-get install -y debhelper
sudo apt-get install -y rtl-sdr
sudo apt-get install -y librtlsdr-dev
sudo apt-get install -y libusb-1.0-0-dev
sudo apt-get install -y pkg-config
sudo apt-get install -y fakeroot
sudo apt-get install -y curl
sudo apt-get install -y cron
sudo apt-get install -y lighttpd


STEP-3: DOWNLOAD / CLONE THE SOURCE FILES TO YOUR RPi



cd ~/
sudo mkdir install-dump
cd install-dump
sudo git clone https://github.com/mutability/dump1090.git


STEP-4: BUILD THE DUMP1090-MUTABILITY PACKAGE
Note: This is a lengthy process, and seems to freez at several occasions. Please be patient, and let the process take it’s time to finish.



cd ~/install-dump/dump1090
sudo dpkg-buildpackage -b


STEP-5: INSTALL THE DUMP1090-MUTABILITY PACKAGE



cd ~/install-dump
sudo dpkg -i dump1090-mutability_1.15~dev_*.deb


STEP-6: CONFIGURE THE WEB SERVER



sudo lighty-enable-mod dump1090
sudo systemctl force-reload lighttpd


STEP-7: DUMP1090-MUTABILITY POST INSTALLATION CONFIGURATION



sudo dpkg-reconfigure dump1090-mutability


For most settings, accept default settings by pressing “Enter”.
For following settings, enter values as shown:
(a) RTL-SDR dongle to use: 0
(b) Your receiver’s Latitude (in decimal format): xx.xxxx
(c) Your receiver’s Longitude (in decimal format): yy.yyyy
(d) Interface address to bind to (blank for all interfaces): remove default 127.0.0.1 and leave blank.

For advance users:Alternatively, you can change the settings by editing the configuration file shown below:



sudo nano /etc/default/dump1090-mutability
#after making changes, save file and exit 
#restart dump1090-mutability
sudo systemctl restart dump1090-mutability


(8) Install Piaware 3.5 data feeder (add-on package install)



wget http://flightaware.com/adsb/piaware/files/packages/pool/piaware/p/piaware-support/piaware-repository_3.5.1_all.deb
sudo dpkg -i piaware-repository_3.5.1_all.deb
sudo apt-get update

sudo apt-get install piaware

sudo piaware-config allow-auto-updates yes
sudo piaware-config allow-manual-updates yes

#now restart piaware
sudo systemctl restart piaware


(9) For retaining existing station number and it’s stats

First find and note down existing station’s “Unique Identifier” which is in the format “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”. You can find it from any of these three places:

Easiest method, from your stats page: flightaware.com/adsb/stats/user/yourusername
Before re-imaging, from Pi: cat /var/log/piaware.log
Before re-imaging, from Pi: cat /var/cache/piaware/feeder_id

Once you have “Unique Identifier”, give following command after booting and SSH,



#delete the "Unique Identifier" in cache (which was assigned automatically at boot)
sudo rm /var/cache/piaware/feeder_id

#assign existing "Unique Identifier" by piaware-config command below
# replace “12345678-1234-1234-1234-123456789abc” by Unique Identifier of your existing station

sudo piaware-config feeder-id 12345678-1234-1234-1234-123456789abc 

#Restart piaware 
sudo systemctl restart piaware


(10) For a new station, claim your Pi by logging in to your account and go to page:
flightaware.com/adsb/piaware/claim

11) ADD TERRAIN LIMIT RINGS (OPTIONAL)
Dump1090-mutability v1.15~dev can display terrain limit rings using data obtained from the website http://www.heywhatsthat.com.

(a) First you have to generate a panorama for your location. To do this, follow the steps in first post of the following thread:
What is the Maximum Range I can Get?

(b) Once your panorama is generated, look near the top left of your newly created panorama page. You will see URL of your panorama there. The URL will be http: // www . heywhatsthat . com/?view=XXXXXXXX where XXXXXXXX is the ID for your panorama.

See screenshot below.

(c) Use following command to download the generated panorama’s JSON file “upintheair.json” to your RPi, and save it in the folder “/usr/share/dump1090-mutability/html” (replace XXXXXXXX in the command below by your panorama’s ID).



sudo wget -O /usr/share/dump1090-mutability/html/upintheair.json "http://www.heywhatsthat.com/api/upintheair.json?id=XXXXXXXX&refraction=0.25&alts=3048,12192"


You can create as many rings as you want by adding elevations (in meters) at the end of URL given in the wget command above after “&alts=”, separated by commas.

10,000 ft = 3048 m
20,000 ft = 6096 m
25,000 ft = 7620 m
30,000 ft = 9144 m
40,000 ft = 12192 m

Hence if you want to add all the 5 elevation rings noted above, the string at the end of wget URL will become “&alts=3048,6096,7620,9144,12192”

To keep map un-cluttered, I have used only 2 rings in the wget command above. i.e. the 10,000 feet (3048 meters), and 40,000 feet (12192 meters).
Important:
Use altitude in meters in the wget URL above.
Do NOT use feet.

(d) RESTART dump1090-mutability



sudo systemctl restart dump1090-mutability


[/list:u]

2 Likes