New aircraft spotted notifications

What’s the best way to go about getting notifications for any new aircraft that’s spotted using the aircraft.json?

are there any scripts available which already that do this?

Slightly different, but close enough to not start a new post:

I’m looking to setup a DB to record each plane that my system picks up. Does anyone have a setup?

Modesmixer2 can record aircraft seen to a basestation.sqb database, as can Virtual Radar Server. There is also Flight Air Map, which is somewhat more difficult to set up and has higher resource requirements.

Collecting is simple:

In /usr/share/dump1090-mutability I created a simple bash script called collect_hex.sh


#!/bin/bash

aircraftjson="/run/dump1090-mutability/aircraft.json"
hexdump="/var/cache/dump1090-mutability/dbicao24/hexdump.txt"
hexdb="/var/cache/dump1090-mutability/dbicao24/hexdb.txt"
tfile="/tmp/collect_hex.$$.tmp"

cat $aircraftjson | json_pp -f json -t dumper -json_opt pretty | grep hex | cut -d "'" -f 4 > $hexdump
cat $hexdb $hexdump | egrep -v "^(000000|~)" | sort -u > $tfile && mv $tfile $hexdb


It simply gets the aircrafts ICAO24-identifier from the actual aircraft.json and stores them in a file. This data is then added to a file that contains all aircrafts you ever picked up (/var/cache/dump1090-mutability/dbicao24/hexdb.txt). Run this script via crontab every minute to collect all aircrafts:


*/1  * * * *  /usr/share/dump1090-mutability/collect_hex.sh

Well, that is plain text file and not a database, but you get the idea.

I’m working on a script that adds the collected ICAO24-codes to a SQLite-database and adds additional info like registration, aircraft-type and operator. Code is not ready, but I can share it if there is interest.

This database then can be used to check what you picked up, for example military aircrafts:


sqlite> select * from ICAO24 where OperatorName like "%Force%" order by OperatorName;
Icao24    Registration  ModelIcao   ModelName                       OperatorIcao  OperatorName                    Country   
--------  ------------  ----------  ------------------------------  ------------  ------------------------------  ----------
44F423    CH-03         C130        Lockheed C130H Hercules         BAF           Belgian Air Force                         
C2B3F5    177704        C17         Boeing C17A Globemaster III     CFC           Canadian Armed Forces                     
498422    2801          A319        Airbus A319-115XCJ              CEF           Czech Air Force                           
3F58AE    14+01         GL5T        Bombardier BD700 Global 5000    GAF           German Air Force                          
43C6F5    ZZ332         A332        Airbus KC-30  Voyager           SHF           Royal Air Force                           
43C6F7    ZZ334         A332        Airbus A330-243MRTT             RRR           Royal Air Force                           
43C6F6    ZZ333         A332        Airbus KC-30  Voyager           SHF           Royal Air Force                           
AE013A    59-1488       K35R        Boeing KC135R Stratotanker                    United States Air Force                   
AE035B    58-0054       K35R        Boeing KC135T Stratotanker                    United States Air Force                   
AE0385    59-1467       K35R        Boeing KC135T Stratotanker                    United States Air Force                   
AE04AB    99-0102       C560        Cessna UC35A Citation Ultra                   United States Air Force                   
AE0501    59-1504       K35R        Boeing KC135T Stratotanker                    United States Air Force                   
AE0656    58-0102       K35R        Boeing KC135R Stratotanker                    United States Air Force                   
AE144E    05-5144       C17         Boeing C17A Globemaster III     RCH           United States Air Force                   
AE1470    07-7178       C17         Boeing C17A Globemaster III     RCH           United States Air Force                   
AE20C6    07-7185       C17         Boeing C17A Globemaster III     RCH           United States Air Force                   
AE2FA3    08-8191       C17         Boeing C17A Globemaster III                   United States Air Force           

Great idea. We can’t all watch our dump1090 data all the time, so storing them in a file to be able to watch it later is a great idea!

Please share!!!

yes please feel free to share , that would be great

I will share that script, but time to work on it is limited at the moment. And as an extra, a stroke of lightning nearby made some damage, the power supply for my Odroid C1 running PiAware died and the Odroid itself did not boot (MicroSD-card damaged). I had a recent backup, but setting everything up again did take some hours and is still ongoing.

I installed FlightAirMap yesterday, seems pretty cool, a couple bugs or maybe I haven’t configured it all correctly.

I really like the statistics feature, which lets you search all your past tracked aircraft by date, flight#, airline, plane model, airport, etc. Flight info is not always correct, but the whole stats interface is quite nice.

Having sql server and apache running does consume a good chunk of ram, and the background data-logging process takes about 10% cpu on my Pi2. And I suppose it could shorten SDcard life with all that activity. Anyway it looks like a promising project!

github.com/Ysurac/FlightAirMap