This folder contains several items that together make a demo allowing you to track civilian aircraft and send that data in to RabbitMQ for processing, collation, and later central display.
There are several software products within this code base:-
- mutability-dump1090 - not included - download from https://github.com/mutability/dump1090 - provides the low level C code for running a Software Defined Radio. This is designed to be ran on a Raspberry Pi, but this version works well on a Mac
- adsb-console - A standalone Java app, designed to be run on the receiver (Raspberry Pi or Laptop) that sends data to a remote RabbitMQ instance
- adsb-live-processor - Spring Boot app that Listens to a RabbitMQ exchange for new aircraft positions, and updates a Live (60 second TTL) record in Redis per aircraft
- aircraft-monitor - Spring Boot web app that provides a rest endpoint (/data/aircraft.json) which pulls data from Redis on request, and a web front end (/gmap.html) to show collated aircraft position information
Every Pivot can run their own receiver and contribute to the global map! If you're interested in this, follow the below steps
First, contact Adam Fowler in the UK Platform Architect team afowler@pivotal.io for a key so you can send data to RabbitMQ.
The code you will use requires a specific chipset, so not all DVB-T receivers will work. A good one is the NeoElec R820T2 SDR NESDR Mini 2 which is what I use. This is an inexpensive item that can be found easily online, including from Amazon.
Now, install and compile dump1090:-
git clone https://github.com/mutability/dump1090
mv dump1090 mutability-dump1090
cd mutability-dump1090
# Following line is for Raspbian on the Raspberry Pi. Your system may vary
sudo apt-get install libusb-1.0-0-dev librtlsdr-dev maven
make
cd ..
If it fails, read the README in the project's folder for ideas, or get Adam Fowler on a zoom meeting.
Now prepare the data web server:-
sudo mkdir /run/dump1090
sudo chown pi:pi /run/dump1090
sudo apt-get install lighttpd
sudo cp lighttpd.conf /etc/lighttpd/
sudo /etc/init.d/lighttpd restart
Edit your receiver app to put the approximate (not too accurate!) location of your base station. This can be found in the --lon and --lat settings of ./runreceiver.sh
Now plugin your Software Defined Radio stick and run the receiver:-
./runreceiver.sh
To test view the internal (your base station only) json view: http://localhost:8081/data/aircraft.json
You should see aircraft information in the console, and in the map view
You now need to compile and run the adsb-console-java project.
cd adsb-console-java
mvn package
Now place the below in the file ./mutability-dump1090/runitmq-configured.sh
#!/bin/sh
export AMQP_URL=amqp://SOMEURL-PROVIDED-BY-ADAMFOWLER
./runitmq.sh
Edit runitmq.sh to reflect the name of your Base Station. E.g. "Fred's Base Station". Do not put your full name or address.
Now run it :-
./mutability-dump1090/runitmq-configured.sh
You should see messages about aircraft appear on the console. Now Ctrl+C to stop this.
Execute the following commands
sudo cp startup.sh /etc/init.d/dump1090
sudo chown root:root /etc/init.d/dump1090
sudo chmod gu+x /etc/init.d/dump1090
sudo ln -s /etc/init.d/dump1090 /etc/rc5.d/
sudo reboot
Upon restart you should be able to hit the JSON http endpoint again, as well as see all your data on the central map, below.
Your aircraft, along with aircraft from all global receivers, will now be visible on the central map here: http://aircraft-monitor-central.cfapps.io/gmap.html
DON'T DO THIS!!!
If you run a local copy then you will 'steal' messages from the central exchange unless you change the name of your queue in the adsb-live-processor RabbitMQ template configuration.
Running this app without modification will mean the global view will not list all aircraft, breaking the demo!!! So please DO NOT DO THIS!
Still wanna do it? Well...
- Create your own Small Redis cloud 'smallredis' and Cloud AMQP 'surveil-amqp' services
- Reconfigure your local adsb-console app to use this RabbitMQ URL, not the one provided by Adam Fowler
- Edit adsb-live-processor/src/resources/application.properties and change the 'group' setting to adsbposition.MYOWNQUEUENAME and save the file
- Run mvn package
- Run cf push for the app. This stands up three copies of the processor (just to prove it can - doesn't require three copies, one will suffice)
- Edit aircraft-monitor-java/manifest.yml To specify the app name of your choice (If pushing to EMEA, don't use the default!!!)
- Perform cf push on this app
- Bind both services to live-processor, and the smallredis service to aircraft-monitor, and re-configure the services
- You will now see your own data, you anti-social person you, not wanting to share. Tsk Tsk ;o)
The basic outline is:-
- Each aircraft transmits ADSB messages at varying rates and signal strengths on 1090 MHz. This uses the same transmission tech as Digital TV, allowing it to be receiver by cheap software defined radio TV sticks (ONLY IF their frequency range stretches to 1090 MHz)
- A receiver hears the signal, and decodes the raw data, creating a full (including partial messages) output on the console, and exposing a JSON endpoint with the latest data on http://localhost:8081/data/aircraft.json
- The adsb-console app reads this local URL once a second. It drops data that has already been sent, and drops partial information data (data without a flight code or longitude and latitude), and sends the remaining data to a RabbitMQ message exchange
- The adsb-live-processor app instance each listen to the same queue attached to this exchange, ensuring each message is processed only once whilst maintaining HA, and updates the aircraft's live view (a Redis object with the key as the flight code, and value as a JSON object). Each object has a time to live of 60 seconds, so aircraft that land or drop out of range of all receivers will vanish out of Redis after 60 seconds. Hence the name 'live view'.
- The aircraft monitor app has a Spring based rest endpoint (at /data/aircraft.json for ease of memory) that scans Redis for all aircraft keys, and produces a combined JSON output
- The web page of the aircraft monitoring app (at /gmap.html again for each of memory), queries this JSON endpoint once a second, and displays the global view on a map for you
Processor | Java status | C# status | Notes |
---|---|---|---|
adsb-console-java | Working, instance per base station (local) | N/A | Reads ADSB JSON and sends to RabbitMQ |
adsb-live-processor | Working, multi instance | Working, multi instance | Takes live feed and sends to Redis |
aircraft-monitor | Working | Working | Aircraft REST endpoint (and older map display web app) |
aircraftui | N/A | N/A | ReactJS (staticfile buildpack) new demo web UI |
All code and material is copyright Pivotal Inc all rights reserved, and licensed under the Apache 2 license unless otherwise stated.
aircraft-monitor-java contains the web front end from mutability-dump1090 within its src/main/resources/static folder which is from the mutability version of the dump1090 application available at https://github.com/mutability/dump1090 and are licensed under the GPL V2 License. These files are copied verbatim and have not been modified, except the config.js file which is designed for user editable configuration.
This app is provided as-is, without support. If you're using the internal pivotal demo app, then please email afowler@pivotal.io with all relevant information and I'll endeavour to give you pointers.
- Get dotnet version working fully with externalised configuration for adsb-live-processor-dotnet using Steeltoe