PlaneCatcher script for tracking "interesting" aircraft that your station picks up


#1

After this year’s UN Week, I wanted to see if my ADS-B receiver had picked up any of the cool aircraft that came to NYC but obviously wasn’t able to stare at the screen 24/7. I searched around but couldn’t find anything that did exactly what I wanted, which was to save and notify me of any aircraft from my receiver that met my criteria, so I decided to write my own script, which I called PlaneCatcher.

PlaneCatcher Features:
-Daily reports of aircraft of note, saved on Raspberry Pi
-Live notification on iOS, Android, or browser via Pushover with link to view on FlightAware
-Shows time first received, Flight ID, aircraft registration (or Mode-S hex if not available), and country
-Filter by exact registration (not all countries supported)
-Filter by registration country (again, not all supported)
-Filter by Mode-S hex
-Filter by Flight ID
-Works by querying aircraft.json at two second intervals

Example of Android notifications:

Example of daily report:
41%20PM

The code is available at: https://pastebin.com/2xjiHbUt

Setup:
-For notifications to work on Pushover, you need to have the requests Python module installed or rewrite the code to send HTTP POST requests without the module. You’ll also need a Pushover account.

  1. Copy python file onto Raspberry Pi.
  2. Fill out all the parts in the code marked with “////”
  3. Fill out the arrays in the code listed below:
    -“filteredairlines”: airlines you don’t want to be notified about, this takes the first three letters from the flight ID [e.g. “SWA”]
    -“filteredcountries”: aircraft from countries aircraft you don’t want to be notified about, use the country’s two letter code [e.g. “US”]
    -“desiredregs”: registrations you want to be notified about, this overrides the filteredairlines and filteredcountries list [e.g. “N123AB”]
    -“desiredairlines”: airlines you want to be notified about, this also overrides filteredairlines and filteredcountries
    -“desiredhexcodes”: any hexcodes for aircraft that don’t have registration support [e.g. “c060a6”]
  4. Start the daemon by running python NameOfSavedCodeFile.py start

Side notes:
-In the notification and in the daily summary if the registration can be calculated from the Mode-S hex it will be included. If not, the hex will take its place.
-If the country of origin can be calculated from the hex the two letter country code will be included. For the list of countries supported, see the first chunk of code. Also, I haven’t verified the countries other than the US and Canada.
-US Military hex codes are not included in the US filter. If you would like to filter military aircraft as well, find 0xA00000 and replace it with 0xAFFFFF.
-Countries that have registration calculation support are: United States, Canada, South Africa, France, Germany, Belgium, Denmark, Finland, Greece, Portugal, Romania, Turkey, Jordan, Pakistan, Singapore, Syria, Australia, Argentina, Russia, Cuba, South Korea, and Japan.
-The -flights.dat file shows each unique notified flight (no duplicates)
-The -raw.dat file shows all of the raw input from aircraft.json from notified flights
-My Raspberry Pi does not run the PiAware image so I can’t attest to its compatibility there, but I don’t see why there would be any issues.

Hope someone is able to find some utility from this! :grinning:


#2

Good work. Looks good and useful.

I wanted to try it, but realized it requires me to install Pushover App on my phone, which I dont want as

  • My phone is already over-crowded with Apps
  • I dont want to pay US $4.99 (Canadian $6.43) for it.

Is there a way to get the notifications without installing any App? Like just by normal email?


#3

Email is a good idea as well. I cobbled up something quick, so I’ve only tested it briefly, and with Yahoo Mail. Also at least with Yahoo Mail, you need to enable the “Allow apps that use less secure sign in” setting in Security for external SMTP to work.

Additional things you’ll need to fill out for the email version:
-“From” address
-“To” address
-Subject if you want to change it
-SMTP server address
-SMTP port
-SMTP login/password

I’ve left the SMTP settings for Yahoo Mail, but you’ll have to find the information for your email provider if you don’t use Yahoo.

SMTP Version