FlightAware Discussions

Scripting a menu for configuring PiAware and other Add-ons

I’m relatively new to Raspberry Pi and Linux, but not afraid to tinker and look things up on the internet. I’ve installed:

  1. PiAware
  2. dump1090-fa
  3. graphs1090
  4. adsbcompare polar heatmap
  5. [frequency] heatmap (from “Do I Need a Filter” thread)
  6. timelapse1090
  7. dump978-fa

As I continue to tinker with my setup, I find myself needing to pull up the same threads over and over again just to remember the correct command line for what I want to do. Has anyone created a basic menu in a single script that can automate some of the common processes, especially some of the multistep processes? Something like:

  1. Dump1090-fa Change Config (ie, gain, device)
    sudo nano /etc/default/dump1090-fa
    sudo systemctl restart dump1090-fa
  2. Dump978-fa Change Config (ie, gain, device)
    sudo nano /etc/default/dump978-fa
    sudo systemctl restart dump978-fa
  3. ADSBCompare Compile Heatmap From Timelapse1090 data
    bash /home/pi/Desktop/PiAware/adsbcompare/polar.sh -1
  4. Do I Need A Filter Frequency Scan (1090)
    sudo systemctl stop dump1090-fa
    sudo /home/pi/Desktop/PiAware/frequencies/rtl_power -d 00001090 -f 800M:1200M:100k -i 30 -c 50% -e 30m -g 30 -F 9 >scan.csv
    sudo systemctl start dump1090-fa
    sudo /home/pi/Desktop/PiAware/frequencies/heatmap.py scan.csv $date+$time.png
  5. Do I Need A Filter Frequency Scan (978)
    sudo systemctl stop dump978-fa
    sudo /home/pi/Desktop/PiAware/frequencies/rtl_power -d 00000978 -f 800M:1200M:100k -i 30 -c 50% -e 30m -g 30 -F 9 >scan.csv
    sudo systemctl start dump978-fa
    sudo /home/pi/Desktop/PiAware/frequencies/heatmap.py scan.csv $date+$time.png
  6. TimeLapse1090 Change Config (ie, interval, total duration of history)
    sudo nano /etc/default/timelapse1090
    sudo systemctl restart timelapse1090
  7. Enable Bias-T
    sudo service dump1090-fa stop && /home/pi/rtl_biast/build/src/rtl_biast -b 1 -d 00001090 && sudo service dump1090-fa start
  8. Disable Bias-T
    sudo service dump1090-fa stop && /home/pi/rtl_biast/build/src/rtl_biast -b 1 -d 00001090 && sudo service dump1090-fa start

Though in compiling this list, I suppose I could just save this as a text file to copy and paste when needed…

1 Like

not all commands are available in a standard installation. You will need to describe which ones need to be installed first (e.g. rtl_power and rtl_bias_t) and add them to the script as well.

I would think it would be editable by the end user so that the directories match for the nonstandard add-on directories, etc.

More for maintenance, than for initial install.

In regards to changing gain: https://github.com/wiedehopf/adsb-scripts/wiki/Automatic-gain-optimization-for-dump1090-fa

https://github.com/wiedehopf/adsb-scripts/wiki/Automatic-installation-for-dump1090-fa

Just if you want some pointers.
It’s ugly code though, can be done much nicer.