Commit Graph

242 Commits

Author SHA1 Message Date
Oliver Jowett 65cd5fe441 Clean up AVR parsing a bit. Add length checks. Decode timestamps. 2021-12-09 18:37:50 +08:00
Oliver Jowett ef70374126 Report json write errors, with some rate limiting.
Fixes #129
2021-08-04 17:33:28 +08:00
Oliver Jowett dd53b36bdf
Merge pull request #142 from flightaware/mrar
MRAR Comm-B support
2021-08-03 21:28:58 +08:00
Adrian Batzill 6785c56348 Stratux output: include current receiver gain 2021-07-30 12:32:45 +01:00
Oliver Jowett 3367cc5a82 faup1090: bump TSV_VERSION to 9E for MRAR, Comm-B changes 2021-07-29 19:04:54 +08:00
Oliver Jowett fe36349083 faup1090: upload MRAR data 2021-07-29 19:04:54 +08:00
Oliver Jowett e0f794b1a5 Track MRAR data per-aircraft and emit in aircraft.json 2021-07-29 19:04:54 +08:00
Oliver Jowett 95ab1c0faa faup1090: upload unknown-format Comm-B messages on demand 2021-07-29 19:04:53 +08:00
Oliver Jowett fab8081322 Upload Comm-B GICB messages 2021-07-29 19:04:53 +08:00
Oliver Jowett ac97423249 Misc adaptive gain changes:
Update adaptive gain control loop to handle interactions between burst detection and dynamic range control.

Internal doc updates & naming cleanups.

Stats tweaks.
2021-07-07 20:57:34 +08:00
Oliver Jowett fd8f2d77e1 Fix adaptive gain stats not getting set on stats_current -> zeros
appearing in stats output. Now we have a validity flag for the stats
members where we have to pick one value and not simply sum data.
2021-07-07 20:18:54 +08:00
Oliver Jowett 56625449e8
Adaptive gain, first pass (#134)
This PR adds basic adaptive gain support, which adjusts SDR gain on the fly based on the noise & signal levels seen.

There are two control mechanisms:

Dynamic range control is enabled by the --adaptive-range option. This adjusts SDR gain to try to achieve a minimum dynamic range, regardless of the exact hardware in the RF path.

Burst (loud message) control is enabled by the --adaptive-burst option. This decreases SDR gain when undecodable loud messages are heard, allowing for better reception of nearby aircraft at the expense of range.

This is only the basic implementation - see the PR for remaining work to do.
2021-06-29 20:11:13 +08:00
eric1tran 9f07a81dfa Bump faup1090 version to 8E 2021-02-24 19:21:26 +00:00
Eric Tran b7205e2e64
faup1090 changes to consume commands via stdin (#107)
* Create a network service and connection faup's stdin. Create a Modes.faup_rate_multiplier attribute and set from faup command input

* Use faup_rate_multiplier to adjust the minAge for emitting messages

* Convert upload_rate_multiplier to a double and adjust minAge with it

* Cleanup

* Var name change

* MODES_NOTUSED define for unused modes client object

* Sanity check on faup multiplier field
2021-02-09 07:25:51 -06:00
Oliver Jowett 1b1f9de119 Increase default stats json buffer size to 8k. Retry with a larger buffer if we run out of space, like we do with aircraft.json
With the addition of the per-DF stats, the stats output started to exceed 4k in some cases (notably, you need --net turned on).

Fixes #106
2021-02-07 22:22:01 +08:00
Oliver Jowett 6a11387861 Collect stats on messages received by DF type 2021-02-04 16:33:26 +08:00
Oliver Jowett f1c576b657 Support --stats-every with intervals <60 seconds. Add --json-stats-every option
Previously, json stats updates were fixed to 60 seconds, and using --stats--every
with an interval less than 60 seconds produced confusing results.

This commit fixes --stats-every with short intervals, and adds --json-stats-every
to control the json stats update interval. Note that if --json-stats-every is not
a multiple of 60 seconds, then the 1-/5-/15-minute data may not include all data
up to the current time (in that case, the most recent data is reflected in
the "latest" stats)

This implements the alternative approach discussed in PR #89
2021-02-01 15:18:42 +08:00
Oliver Jowett 490b5ce36f Clean up generateStatsJson error handling a bit 2021-02-01 14:07:00 +08:00
Adrian Batzill 6714148c45 Forward MLAT traffic to Stratux JSON output, marked with IsMlat:true value in JSON 2020-09-10 10:20:21 +02:00
Oliver Jowett 303dcc9915 Fix stratux output timestamps to really be UTC as they claim 2020-09-08 23:35:17 +08:00
Oliver Jowett 7356676c5b Don't need conditional output on the stratux port, that's done in prepareWrite() 2020-09-08 23:30:24 +08:00
Oliver Jowett da3e9766de Harden the stratux output a bit: use safe_snprintf, jsonEscapeString 2020-09-08 23:22:53 +08:00
Oliver Jowett ec90edcd8d Simpify stratux service init 2020-09-08 23:21:34 +08:00
Oliver Jowett bc9336e0be Revert "forward mlat messages to Stratux"
This reverts commit c89930b4b9.
2020-09-08 23:10:18 +08:00
Oliver Jowett 917aa6a0e2 Merge branch 'stratux' of https://github.com/Determinant/dump1090-fa-stratux into Determinant-stratux 2020-09-08 23:08:37 +08:00
Determinant c89930b4b9
forward mlat messages to Stratux 2020-09-07 15:36:34 -04:00
Determinant d25103361a
make change according to the suggestions 2020-08-30 21:21:49 -04:00
Oliver Jowett 1dbb8ab234 Expose modea_hit / modec_hit in aircraft.json 2020-08-24 15:03:17 +08:00
Rosen Penev 0df937e9c6
fix -Wmissing-declaration warnings
This should result in a smaller size.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-29 16:42:21 -07:00
Determinant 258e3f9d65 turn off stratux support by default 2020-03-30 12:34:11 -04:00
Determinant 8ba24e8c3b put the timestamp at last 2020-03-28 22:51:31 -04:00
Determinant eb1d42e47a ... 2020-03-28 15:27:22 -04:00
Determinant 2f9c3fe0e1 clean up 2020-03-28 15:25:31 -04:00
Determinant 52338202d1 ... 2020-03-28 15:25:31 -04:00
Determinant b6f007a104 WIP: support stratux protocol 2020-03-28 15:25:31 -04:00
Oliver Jowett 886b0d3f81 Treat ADS-R as a separate source type (higher priority than TIS-B, lower priority than direct ADS-B) 2019-12-11 12:43:19 -06:00
Oliver Jowett 105ec2098c "unreliable_tracks" -> "unreliable" in stats json as suggested in #56 2019-12-03 14:15:54 +08:00
Dan McGee 21743b03b7
Fix invalid JSON after addition of unreliable_tracks
When `unreliable_tracks` was added to the JSON output, the trailing `}` after `single_message` should likely have been removed.

Side note: should this just be `unreliable` since it is nested inside `tracks`? `all` and `single_message` don't have the `tracks` suffix.
2019-12-02 20:49:33 -06:00
Oliver Jowett f868e4c010 Bump TSV_VERSION for verbatim mode / track reliability changes 2019-12-02 13:01:43 +08:00
Oliver Jowett 19327926f1 Cooked vs verbatim was reversed, fix it 2019-11-27 22:28:09 +08:00
Oliver Jowett b2e9153653 Add stats for unreliable tracks 2019-11-27 21:41:33 +08:00
Oliver Jowett 8ffa43b65c Add a v/V Beast-format setting to control verbatim mode.
Make --net-verbatim just control the default setting.

0x1A '1' 'v' disables verbatim mode (send "cooked" output);
0x1A '1' 'V' enables verbatim mode

Support clients with different settings by switching them between output
writers depending on what setting they want, so clients with different
settings can co-exist (unlike the Mode A/C setting)

In cooked mode, FEC corrections are applied to messages before they are send
and only trustworthy messages are forwarded; this is the default case for
downstream clients that don't want to apply their own rules and are happy with
the decisions that dump1090 makes.

In verbatim mode, all messages are forwarded, but no FEC corrections are applied;
the downstream client needs to make its own FEC / noise filtering decisions.

Usually the default for new connections is cooked mode. --net-verbatim changes the
default to be verbatim mode.
2019-11-27 21:04:27 +08:00
Oliver Jowett 54409b4836 Split beast output into two separate writers for verbatim vs. non-verbatim
in preparation for supporting both types of connection in parallel
2019-11-27 21:01:46 +08:00
Oliver Jowett dfc588335a Move output filtering down a level into the individual output functions. 2019-11-27 20:57:01 +08:00
Oliver Jowett 54f2c54d8f Include only reliable tracks in aircraft.json, faup1090 output 2019-11-27 20:51:23 +08:00
Oliver Jowett ef125bd5f0 Bump TSV_VERSION for TAH sense fix. 2019-06-06 14:17:27 +08:00
Oliver Jowett 61f483c3e7 Bump TSV_VERSION to reflect extensive comm-b changes 2019-05-02 18:30:32 +08:00
Matthias Wirth 82c5ff6724 Fix possible missing \n termination of TSV messages
If the \n termination of TSV messages is missing, faup1090 encounters
the following error:
Caught background error: list must have an even number of elements
    while executing
"array set row [split $line "\t"]"
    (object "::faup1090" method "::FaupConnection::data_available" body line 28)

This missing termination with \n can happen when p == end is true in the
overrun check. vsnprintf will always terminate the string with \0, so if
the vsnprintf is called to write the to the last position in the buffer
(end-1), it will write \0 instead to terminate the string as not to
overflow the buffer.
To catch that possibility the overrun check is changed to p < end as
then vsnprintf is assured to have had enough room to write the \0
termination to end-1.
2019-04-08 20:29:56 +02:00
Matthias Wirth b281ceee7b Increase maximum TSV packet size
Due to commit 45886edc40
faup1090: write _v on every line, bump TSV_VERSION
and maybe other changes the TSV packets are bigger and some users have
reported the following error:
piaware[9040]: faup1090(27427): fatsv: output too large (max 600, overran by 20)

Fix this error by increasing TSV_MAX_PACKET_SIZE to 800
2019-04-08 20:03:57 +02:00
Oliver Jowett f46640a5c2 Track and report autopilot FMS/MCP separately; also report autopilot altitude source. 2019-03-19 18:44:09 +00:00