Anonymous
×
Create a new article
Write your page title here:
We currently have 27 articles on PhenixOps. Type your article name above or click on one of the titles below and start writing!



PhenixOps
27Articles

Installing and running Piaware

Intro

A little fun project using a Raspberry Pi Zero W and a DVBT stick running the flightaware software.

Make sure (if it is your first) to have a set including connectors and a poweradaptor with 5.1v output.

If you plan for a mobile setup, make sure the powerbank provides the 5,1v output.

Since i'm on a budget i start out with the Raspberry Pi Zero W

Getting started

Put the Raspberry together, much like lego.

Download the software from flightaware

wget http://piaware.flightcdn.com/piaware-sd-card-3.8.1.img.zip

Unzip the file and cd into the piaware-sd-card-3.8.1.img folder (yes it is a folder..)

Check for your SD card

lsblk

Mine seems to be /dev/mmcblk0 device which is mounted at /media/phenixops/disk

mmcblk0                     179:0    0    15G  0 disk  
└─mmcblk0p1                 179:1    0    15G  0 part  /media/phenixops/disk


Make sure the card contains NO files, they will ALL BE LOST WHEN YOU CONTINUE!

From the folder, copy the image to the card using dd
fun@phenixops:/home/fun/Downloads/piaware-sd-card-3.8.1.img# dd bs=4M if=piaware-sd-card-3.8.1.img of=/dev/mmcblk0 conv=fsync

Configuring the Wifi

After the image has been copied (you might have to reseat the SD card) you can edit the configuration to enable wifi

Edit the piaware-config.txt file you will find on the sdcard
vi piaware-config.txt

Set your SSID/Password

Change the part with the wireless-ssid and wireless password to what goes for your network

wireless-ssid YourSSID
wireless-password Blablabla

(Make sure you enter the details of your phone's hotspot if you want to take it outside..)

Next pop out the SD card and put it into the Raspberry Pi

Checking the network

Login to your wifi router and check for the newly added addres
Make sure it is broadcasting 802.11n as the Raspberry Pi does not support other protocols

Enable SSH

This is more related to Raspbian but hey we all need ssh

At this point you just need to create a file called ssh, with no content

In the boot folder on the SD create a file called ssh
/boot# touch ssh

Reboot the Raspberry. ssh will become available after the restart
Check on your local router which device has been added to find out what the ip is.

One note, the Raspberry Pi Zero does not support 5G wifi.

Login using SSH

You can login with these credentials:

user: pi 
pass: flightaware

Change the password to a better one as it is a default

Troubleshooting

setting the feeder id

Somehow this is not set right upon install, i found the solution

sudo piaware-config feeder-id 7a3b295a-489e-4b91-9c9d-4c778e71c925

User your own, you can find it using:
piaware-showtraffic

Usefull tools and commands for troubleshooting

Piaware config and if is active

piaware-status 
piaware-config
piaware-showtraffic
tail -f /var/log/piaware.log

Check ports, should be listening<pr>

netstat -tulpn|less

Check if your device is present or perhaps dropped out of service due to low power

lsusb

And finally a physical check to see if the dongle is in the data port on your Raspberry Zero..

Bad Tuners

Unfortunately my first attempt to setup did not work, while the software was doing it's task. No messages were being send to the flightaware server. It took me quite some time to check if things were in the right place. Ports available, processes being started. I spend quite some time to test everything and documented it. When i posted a message to the flightaware forum, wiedehopf pointed out that the tuner on my dongle does not work on the 1090 band.

So i was happy to find out there was nothing wrong with my setup yet i really wanted to see things working. But it became a free crashcourse on Piaware and troubleshooting is fun.

These tuners will not work. Check using rtl_test

Fitipower FT0012
Fitipower FT0013

How to connect your Piaware using SSL

To make things modern and save you can use a SSL certificate for the webserver. All you need to do is copy the configuration and place your SSL certificate file on the server.

Certificate Chain

Create a server.pem by putting your keys into a single file using the cat command. You need to have the private key along with the cert Search google for info.

Put the file in the /etc/lighttpd/ directory on the Raspberry, either using scp or copy paste using terminals.

Change the rights to the file
chmod 400 /etc/lighttpd/server.pem

Troubleshoot using
service lighttpd status

Configuration

Copy the 10-ssl.conf file from /etc/lighttpd/config-available to /etc/lighttpd/config-enabled and edit
cp /etc/lighttpd/config-available/10-ssl /etc/lighttpd/config-enabled/10-ssl

Edit the config and point to your server.pem and the port you would like ssl to run on
vi /etc/lighttpd/config-enabled/10-ssl.conf

server.modules += ( "mod_openssl" )

$SERVER["socket"] == "0.0.0.0:8080" {
        ssl.engine  = "enable"
        ssl.pemfile = "/etc/lighttpd/server.pem"
        ssl.cipher-list = "HIGH"
}


See my Piaware setup in full effect

https://radar.phenixops.net:8080

My Setup on Flightaware.com

You can find the statistics at https://flightaware.com/adsb/stats/user/PhenixOps

Additional configuration

Check my article on fail2ban , automated firewalling.

Buy me a coffee

If you would like me to build more interesting things support me here:
https://www.buymeacoffee.com/PhenixOps