Stopping and Restarting of PiAware Services for Backups

When anyone re-images microSD card with latest image, the re-imaging itself (using Raspberry Pi Imager) is not difficult, but people face difficulty in configuring it. Another discouraging factor is to reinstall and configure feeders of other sites. However if you follow instructions below, re-imaging is not as difficult as it seems

NOTE: It is strongly recommended to use a SPARE microSD card to make a fresh install. This way your existing install will be preserved and you can fall back on it if fresh install fails or you decide to quit before finishing the fresh install.

STEP-1: Retrive & Save Feeder Keys

Before you write fresh image, retrieve feeder keys from existing image, copy-paste and save these in Notepad on your desktop/laptop.

1.1 - Piaware feeder-id

Following command will print feeder-id

cat /var/cache/piaware/feeder_id
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx

1.2 - Plane finder share-code

Give following command

cat /etc/pfclient-config.json

It will output following long line. Your Planefinder sharecode is the last item zzzzzzzzz in this long line

{"tcp_address":"127.0.0.1","tcp_port":"30005","select_timeout":"10","data_upload_interval":"10","connection_type":"1","aircraft_timeout":"30","data_format":"1","latitude":"xx.xxxx","longitude":"yy.yyyy","sharecode":"zzzzzzzzzzzz"}

1.3 - Flightradar24 key:

Give following command

cat /etc/fr24feed.ini  

Following line in output of above command has your fr24 key:

fr24key="xxxxxxxxxxxxxxxx"

1.4 - Radarbox24 key:

Give following command:

cat /etc/rbfeeder.ini  

Following line in output of above command has you RB24 key

key=xxxxxxxxxxxxxxxxxxxxxx

STEP-2: Write image to microSD Card

Use RaspberryPi Imager. It would allow you to configure:

  • hostname (for example I use raspberrypi or raspi-1 etc)
  • username (for example I use pi or abcd etc)
  • login password
  • WiFi SSID & WiFi password
  • timezone (for example America/Toronto)
  • keyboard (for example uk or us)
  • enable SSH

Install RaspberryPi OS on microSD card using Raspberry Pi Imager

 

STEP-3: Slip microSD card in RPi and Power up.

STEP-4: Install Piaware, dump1090-fa, and dump978-fa

NOTE:
The dump978-fa is for USA only. Users outside USA should NOT install dump978-fa
Even users in USA who are not interested to add another dongle and antenna for 978 MHz should not install dump978-fa.

Detailed instructions are here:
https://flightaware.com/adsb/piaware/install

STEP-5: Configure Station ID

Alternative-1:
Get a brand new station number & feeder id

Log-in to your Flightaware account.
Go to followin page and follow instructions to claim a new station
https://flightaware.com/adsb/piaware/claim

Alternative-2:
Configure an Existing Station

(a) - Find existing station’s feeder-id (Unique Identifier)
Log-in to your Flightaware account.
Go to “My ADSB” / stats page flightaware.com/adsb/stats/user/
On above page look for 32-digit Unique Identifier: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

(b) - SSH and configure station id:

sudo piaware-config feeder-id xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx 
# Replace xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  
# by your actual feeder-id 

sudo systemctl restart piaware

Note: Steps 6 & 7 below do not apply to receivers outside USA, as UAT 978 does not exist outside USA. These steps also do not apply to the receivers in USA who have not installed dump978-fa.

STEP-6: Configuration for using both dump1090-fa & dump978-fa (Two dongles are required)

6.1 - Serialize dongles if using UAT 978: (CLICK HERE)

If you want to recieve both ES1090 and UAT978, then two dongles are required, one for 1090 and other for 978. In this case you will have to serialize dongles so that correct dongle+antenna sets are used by dump1090-fa and dump978-fa.

For 1090 Mhz dongle: use 8-digit serial # 00001090
For 978 Mhz dongle : use 8-digit serial # 00000978

Note: You can use any other serial numbers if you want, but do not use single digit serial numbers (0 to 9) or (01 to 09), as these may conflict with device numbers. Use at least two digit numbers like 21 or 93 etc)

6.2 - Configure dump1090-fa & dump978-fa to use dongles of assigned serial numbers

sudo sed -i 's/^RECEIVER_SERIAL=.*/RECEIVER_SERIAL=00001090/' /etc/default/dump1090-fa  
sudo sed -i 's/driver=rtlsdr[^ ]* /driver=rtlsdr,serial=00000978 /' /etc/default/dump978-fa  
sudo piaware-config uat-receiver-type sdr

6.3 - Reboot so that dump1090-fa & dump978-fa can pick their assigned dongles at boot

$ sudo reboot  

STEP-7: Install graphs1090 (by @wiedehopf )

sudo bash -c "$(wget -q -O - https://github.com/wiedehopf/graphs1090/raw/master/install.sh)"  

 

STEP-8: Installing other feeders

8.1 - Install Flightradar24 feeder:

wget -qO- https://fr24.com/install.sh | sudo bash -s  

## Provide your email and fr24 key when asked

After installation completes, issue following commands

sudo systemctl enable fr24feed  

sudo systemctl restart fr24feed

 

8.2 - Install Planefinder feeder

wget http://client.planefinder.net/pfclient_5.0.161_armhf.deb  
sudo dpkg -i pfclient_5.0.161_armhf.deb  

On 64-bit RaspberryPi OS, 2nd command above will run, then give message that package failed to install due to dependency issue. Give following command to fix it:

sudo apt --fix-broken install

8.3 - Install Radarbox24 feeder

sudo bash -c "$(wget -O - http://apt.rb24.com/inst_rbfeeder.sh)"  

During installation, you will be asked “do you want to install dump978-rb (yes/no)”. Type no to skip instyallation of dump978-rb

sudo rbfeeder --setkey xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

## Replace xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx by your actual key

Press Ctrl+C keys, then give following command:

sudo systemctl restart rbfeeder   

Install mlat-client

sudo apt install mlat-client   

Add your Latitude, Longitude and elevation above sea level (in meters) in file /etc/rbfeeder.ini

sudo nano /etc/rbfeeder.ini

In above file add following 3 lines in [client] section
(Replace xx.xxx, yy.yyyy, and zzz by their actual values)

lat=xx.xxxx
lon=yy.yyyy
alt-zzz

Please see screenshot below:

 

8.4: Install Adsbexchange feeder

curl -L -o /tmp/axfeed.sh https://adsbexchange.com/feed.sh

sudo bash /tmp/axfeed.sh