Fetches ADS-B flight data from radar servers (ModeSMixer2 or Virtual Radar Server) and presents a chronological view of past flights with an interactive live map of position reports.
- Make sure you have Python 3 installed,
- Install the dependencies package with
pip3 install -r requirements.txt
The application can either be configured by enviroment variables or by a config file
- Copy the
config.json
from contrib/samples to the project root - Configure host/port of your radar server
- Set the path to your data folder. It must contain BaseStation.sqb (not included, get it here) and mil_ranges.csv. Example
"dataFolder" : "/path/to/installation/resources/",
- Chose whether you want to track military planes only
See section below for details
- DATA_FOLDER
- SERVICE_URL
- SERVICE_TYPE
- MIL_ONLY
- DB_RETENTION_MIN
- UNKNOWN_AIRCRAFT_CRAWLING
Option name | Optional | Default value | Description |
---|---|---|---|
serviceUrl |
no | The url to your radar service | |
type |
yes | vrs | The type of your radar service, eithr vrs for VirtualRadarServer, mm2 for ModeSMixer2 or dmp1090 for dump1090 |
dataFolder |
yes | resources | the absolute path to your resources folder |
militaryOnly |
yes | false | Whether everything other than military planes should be filtered (true or false) |
deleteAfterMinutes |
yes | 1440 | Determines how many minutes after the last signal was received should the the flight in the dababase be retained before it's deleted. Set to 0 to keep entries indefinitely |
logging |
yes | syslogHost The host to send logs tosyslogFormat The syslog log formatlogLevel [optional] Log level, See here for more infoslogToConsole [optional] If true, logs are logged to syslog and to console, if false only to syslog |
|
crawlUnknownAircraft |
yes | false | If true, aircraft not found in BaseStation.sqb will be looked up in various data sources in the web. Since this method uses crawling which might now always be allowed. Beware: This could potentially lead to blockage of your IP address |
googleMapsApiKey |
no | The map view needs an API key to render the map. You can get one here. |
flightradar uses an Sqlite3 database (resources/flights.sqlite) to store flight information. You have to create and initialize the database with its schema first. When building a docker image, the database is initialized upon build time.
Initialize schema:
export FLASK_APP=flightradar.py
flask initschema
Running it with the debug webserver (Not recommended for productive use). Don't forget to initialize the db (see abve) before the first run
export FLASK_APP=flightradar.py
flask run
Runnig it with WSGI (productive setup) (binds to all interfaces on port 8083)
gunicorn flightradar:app --bind 0.0.0.0:8083
When running the application on Windows, consider the following:
- Use
SET
instead ofexport
when using Windows
- Performance may suffer if you have a lot of flights in your database. There's a lot of potential for improvement in the persistence layer.
- If you're running it in a Docker container, the flight db runs in the same container. Adding the possibility to externalize it might be a good idea