dump1090 generates several json files with informaton about the receiver itself, currently known aircraft,
and general statistics. These are used by the webmap, but could also be used by other things
e.g. [this collectd plugin](https://github.com/mutability/dump1090-tools/tree/master/collectd) feeds stats
about dump1090's operation to collectd for later graphing.
## Reading the json files
There are two ways to obtain the json files:
* By HTTP from dump1090's internal webserver, which defaults to running on port 8080. The json is served from the data/ path, e.g. http://somehost:8080/data/aircraft.json
* As a file in the directory specified by --write-json on dump1090's command line. These can be exposed via a
separate webserver.
The HTTP versions are always up to date.
The file versions are written periodically; for aircraft, typically once a second, for stats, once a minute.
The file versions are updated to a temporary file, then atomically renamed to the right path, so you should never see partial copies.
Each file contains a single JSON object. The file formats are:
## receiver.json
This file has general metadata about dump1090. It does not change often and you probably just want to read it once at startup.
The keys are:
* version: the version of dump1090 in use
* refresh: how often aircraft.json is updated (for the file version), in milliseconds. the webmap uses this to control its refresh interval.
* history: the current number of valid history files (see below)
* lat: the latitude of the receiver in decimal degrees. Optional, may not be present.
* lon: the longitude of the receiver in decimal degrees. Optional, may not be present.
## aircraft.json
This file contains dump1090's list of recently seen aircraft. The keys are:
* now: the time this file was generated, in seconds since Jan 1 1970 00:00:00 GMT (the Unix epoch).
* messages: the total number of Mode S messages processed since dump1090 started.
* aircraft: an array of JSON objects, one per known aircraft. Each aircraft has the following keys. Keys will be omitted if data is not available.
* hex: the 24-bit ICAO identifier of the aircraft, as 6 hex digits. The identifier may start with '~', this means that the address is a non-ICAO address (e.g. from TIS-B).
* type: type of underlying message, one of:
* adsb_icao: messages from a Mode S or ADS-B transponder, using a 24-bit ICAO address
* adsb_icao_nt: messages from an ADS-B equipped "non-transponder" emitter e.g. a ground vehicle, using a 24-bit ICAO address
* adsr_icao: rebroadcast of ADS-B messages originally sent via another data link e.g. UAT, using a 24-bit ICAO address
* tisb_icao: traffic information about a non-ADS-B target identified by a 24-bit ICAO address, e.g. a Mode S target tracked by secondary radar
* adsb_other: messages from an ADS-B transponder using a non-ICAO address, e.g. anonymized address
* adsr_other: rebroadcast of ADS-B messages originally sent via another data link e.g. UAT, using a non-ICAO address
* tisb_other: traffic information about a non-ADS-B target using a non-ICAO address
* tisb_trackfile: traffic information about a non-ADS-B target using a track/file identifier, typically from primary or Mode A/C radar
There are 5 top level keys: "latest", "last1min", "last5min", "last15min", "total". Each key has statistics for a different period, defined by the "start" and "end" subkeys:
* "total" covers the entire period from when dump1090 was started up to the current time
* "last1min" covers a recent 1-minute period. This may be up to 1 minute out of date (i.e. "end" may be up to 1 minute old).
* "last5min" covers a recent 5-minute period. As above, this may be up to 1 minute out of date.
* "last15min" covers a recent 15-minute period. As above, this may be up to 1 minute out of date.
* "latest" covers the time between the end of the "last1min" period and the current time.
Internally, live stats are collected into "latest". Once a minute, "latest" is copied to "last1min" and "latest" is reset. Then "last5min" and "last15min" are recalculated from a history of the last 5 or 15 1-minute periods.
Each period has the following subkeys:
* start: the start time (in seconds-since-1-Jan-1970) of this statistics collection period.
* end: the end time (in seconds-since-1-Jan-1970) of this statistics collection period.
* local: statistics about messages received from a local SDR dongle. Not present in --net-only mode. Has subkeys:
* blocks_processed: number of sample blocks processed
* blocks_dropped: number of sample blocks dropped before processing. A nonzero value means CPU overload.
* modeac: number of Mode A / C messages decoded
* modes: number of Mode S preambles received. This is *not* the number of valid messages!
* bad: number of Mode S preambles that didn't result in a valid message
* unknown_icao: number of Mode S preambles which looked like they might be valid but we didn't recognize the ICAO address and it was one of the message types where we can't be sure it's valid in this case.
* accepted: array. Index N has the number of valid Mode S messages accepted with N-bit errors corrected.
* signal: mean signal power of successfully received messages, in dbFS; always negative.
* peak_signal: peak signal power of a successfully received message, in dbFS; always negative.
* strong_signals: number of messages received that had a signal power above -3dBFS.
* remote: statistics about messages received from remote clients. Only present in --net or --net-only mode. Has subkeys:
* modeac: number of Mode A / C messages received.
* modes: number of Mode S messages received.
* bad: number of Mode S messages that had bad CRC or were otherwise invalid.
* unknown_icao: number of Mode S messages which looked like they might be valid but we didn't recognize the ICAO address and it was one of the message types where we can't be sure it's valid in this case.
* accepted: array. Index N has the number of valid Mode S messages accepted with N-bit errors corrected.
* http_requests: number of HTTP requests handled.
* cpu: statistics about CPU use. Has subkeys:
* demod: milliseconds spent doing demodulation and decoding in response to data from a SDR dongle
* reader: milliseconds spent reading sample data over USB from a SDR dongle
* background: milliseconds spent doing network I/O, processing received network messages, and periodic tasks.
* cpr: statistics about Compact Position Report message decoding. Has subkeys: