Commit Graph

43 Commits

Author SHA1 Message Date
Oliver Jowett a135d2b915 Add a --no-fix-df option
Usually, all message candidates are speculatively corrected as if
they were DF11/17/18, even if the DF field has a different value. This
allows correction of messages when there is correctable damage to the
DF field.

However, running every message candidate through a couple of CRC checks
is expensive, CPU-wise, when decoding messages off the air, as there are
a large number of message candidates that are actually just junk data, and
computing CRCs for all of those adds up. The --no-fix-df option allows
disabling this sort of correction. The tradeoff is that messages with
damage to the DF field will not be corrected.
2021-03-08 14:23:35 +08:00
Oliver Jowett 2ea75a345d fix merge indentation 2021-02-01 11:50:43 +08:00
Oliver Jowett 1eab1fc04b
Merge branch 'dev' into fix-interactive-ttl 2021-02-01 11:48:07 +08:00
Edwin Groothuis c06c697e26 When using a --interactive-ttl of more than 99, the alignment
didn't work out.
2021-01-23 17:48:49 +11:00
George Joseph 68e95c06cc Interactive mode updates
These updates were designed to assist those using interactive
mode to tune antennas and SDR gain.

* Add options to display distance and bearing in interactive mode

  Distance and bearing instead of latitude and longitude can now be
  displayed in interactive mode using the following options to
  dump1090-fa and view1090-fa.

  --interactive-show-distance   Show aircraft distance and bearing
                                instead of aircraft lat/lon
                                (requires --lat and --lon)
  --interactive-distance-units  Distance units ('km', 'sm', 'nm')
                                (default: 'nm')"

  You have to specify a reference --lat and --lon for this to
  work of course.

* A new line now shows at the top of the interactive display that
  has for the current sample:

  Total valid aircraft count
  Vidible aircraft count
     Will be less than total if the screen hasn't enough lines to show
     them all.
  Max RSSI
  Min RSSI
  Mean RSSI
  Max Distance

 Tot:  47 Vis:  47 RSSI: Max 25.4+ Mean -29.5 Min -36.9-  MaxD:  197.3nm+

* Add max distance and min/max RSSI indicators

  A '+' after the distance in a row indicates it's the row with the
  maximum distance.

  A '+' after the RSSI in a row indicates it's the row with the highest
  RSSI.

  A '-' after the RSSI in a row indicates it's the row with the lowest
  RSSI.

  The summary line at the top of the screen always shows the values for
  ALL aircraft, even those not visible.  The row indicators only mark
  visible rows though.

  In this example, the first aircraft is both the farthest away and has
  the weakest RSSI.  The second aircraft has the strongest RSSI.

 Tot:  47 Vis:  47 RSSI: Max 25.4+ Mean -29.5 Min -36.9-  MaxD:  197.3nm+     -
 Hex    Mode  Sqwk  Flight   Alt    Spd  Hdg  Dist(nm) Bearing  RSSI  Msgs  Ti
────────────────────────────────────────────────────────────────────────────────
 A8D5A4 S2                   34000  438  252   197.3+      85  -36.1-   26  2
 A39A13 S2ac  5740  FFT525   30750  439  256    98.8       68  -25.4+  123  0
 A70B23 S2ac  2744  LXJ553   43000  419  258   136.1       39  -33.6   174  0

* Finally, a new option '--interactive-callsign-filter' has been added
  to allow filtering interactive by callsign.  The value can be a
  simple string, in which case aircraft with that string anywhere in its
  callsign will be displayed, or a regular expression should you want a
  more precise match.

  Examples:
    --interactive-callsign-filter UAL
      will match all aircraft with UAL anywhere in its callsign.
    --interactive-callsign-filter "^UAL"
      will match only those callsigns that start with UAL.
    --interactive-callsign-filter "^(UAL|AAL)"
      will match only those callsigns that start with UAL or AAL.
    --interactive-callsign-filter "^N[0-9]" or "^N[[:digit:]]"
      will match only those callsigns that start with "N" and a number

  If you need more info on regular expressions, see this link:
  https://en.wikipedia.org/wiki/Regular_expression
2020-09-29 06:23:55 -06:00
Oliver Jowett 74607b31ed Factor out FIFO handling; reimplement as a linked list, not a circular buffer.
Update all the SDR implementation to use it.

This was getting pretty ugly with code getting copy&pasted in all the SDR
implementations. Unify it all and give it a simpler API. Linked list works out
much simpler than the circular buffer. Also, simplify copying the overlap region
around by just using a separate buffer (it's only a few hundred bytes long, so
the double copy is not a big deal).
2020-08-05 19:50:38 +08:00
Oliver Jowett c890bb6125
Merge pull request #67 from neheb/st
Make more functions static
2020-08-02 22:42:07 -05: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
Oliver Jowett 0793c64ee8 Clean up linkage of struct Modes to actually make sense.
(how did this work before? But it's been unchanged since at least
2013..)

Maybe fixes #65
2020-06-06 21:52:04 +08:00
Oliver Jowett ae29613d85 Exit view1090 on connection loss in non-interactive mode 2019-12-02 19:52:43 +08:00
Oliver Jowett a224f6f783 Put a warning header up in view1090 interactive mode when there's no connection 2019-12-02 19:51:06 +08:00
Oliver Jowett fb110802d6 When view1090 reconnects, re-send our connection settings on the new connection 2019-12-02 19:50:31 +08:00
Oliver Jowett a8737f7916 Remove --aggressive entirely, replaced by "--fix --fix" to enable 2-bit FEC.
nb: messages with a correctable 2-bit error are only forwarded to network
clients that have enabled verbatim mode (and they will be forwarded with
the 2-bit error still present, so the downstream client must apply its own
correction if desired)
2019-11-27 21:09:19 +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
Rosen Penev ffff5d6646
treewide: Replace usleep with nanosleep
usleep was removed in POSIX 2008 and is optionally unavailable with
uClibc-ng.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-10-03 18:10:46 -07:00
Oliver Jowett 2142d2edf5 Whitespace changes only: cleaning up trailing whitespace at EOL 2017-06-15 18:17:07 +01:00
Oliver Jowett 0526388bdc Factor out sendBeastSettings(), use it in view1090. 2016-12-29 17:53:04 +00:00
Oliver Jowett 4bb070be50 Add support for radarcape type 5 (receiver position) messages. 2016-12-27 19:07:10 +00:00
Oliver Jowett f6b1b94c7d Use ncurses for interactive mode (reduces flicker on slow connections a lot!) 2016-10-11 20:37:28 +01:00
Oliver Jowett 60f1f3bcb6 Table-ize the Mode A to C conversions, add a Mode C to Mode A conversion function. 2016-10-11 17:57:25 +01:00
Oliver Jowett 568e843b9f Add --max-range to view1090, use the same defaults as dump1090. 2016-08-26 11:29:42 +01:00
Oliver Jowett 2b466535de Support multiple listening ports per listener type.
Beast input defaults to listening on both 30004 and 30104.
Drop the FATSV listener entirely (use faup1090 for that)
Ignore --net-beast.
2016-01-24 18:47:58 +00:00
Oliver Jowett 1a3f65eaab Add --no-interactive, --show-only options to view1090
This turns it into a handy debug tool for looking at raw messages
from an existing running dump1090 without having to mess around with
a separate copy of dump1090 and netcat tunnels etc.
2015-06-29 12:41:55 +01:00
Oliver Jowett 278448179d Factor out net services so they're not tied to a static array.
This lets different things dynamically create the services they need,
and sorts out the horrible hacks that view1090 used to make outgoing
connections. Now you can explicitly create a service and tell it to make
an outgoing connection.

This means that view1090 can now just set all the ports to zero (to disable
the listeners), do a normal net init, then explicitly construct the beast
input service without a listener and tell it to make a connection as needed.
2015-06-26 17:50:51 +01:00
Oliver Jowett f9ed7e4a97 More time_t -> milliseconds conversions.
This lets us support fractional net flush times among other things, which is handy.
2015-02-10 22:24:22 +00:00
Oliver Jowett 7053ad02da Make aircraft tracking use milliseconds everywhere. 2015-02-10 21:49:37 +00:00
Oliver Jowett 899c51ce85 Only emit network messages once we have seen two of them
(except in --net-verbatim mode, where we emit them all)

Move aircraft tracking into track.[ch].

Clean up references to "interactive mode" when tracking
aircraft - we always track aircraft, even in non-interactive
mode.
2015-02-08 14:27:03 +00:00
Oliver Jowett 7c64f27c22 Remove unused user latitude/longitude defines. 2015-01-21 11:53:45 +00:00
Oliver Jowett 0433ed3f5d icao_filter.[ch] from the experimental branch. 2015-01-20 23:53:26 +00:00
Oliver Jowett 270a22e06a CRC reimplementation to be byte-at-a-time table-driven.
Also be smarter about error correction, avoiding ambiguous cases
when --aggressive is specified.
2015-01-20 23:04:05 +00:00
Oliver Jowett 43ec58c78e Remove dead tracking code related to the removed PlanePlotter feed. 2015-01-04 20:09:38 +00:00
Oliver Jowett fc45eded0b Removing COAA/PlanePlotter stuff (+ binary-only object file) that I can't support or test. 2014-12-27 20:16:56 +00:00
Oliver Jowett f707f2cdce More version reporting tweaks. 2014-12-10 12:44:00 +00:00
Malcolm Robb 8b05286a24 Version 1.09.1007.14
Updates to support COAA Planeplotter Ground Station on an RPi
2014-08-06 15:29:05 +01:00
hhm a86eb7a61c B"H view1090: do not use pthreads
It *seems* that pthreads are used in dump1090 for I/! sample reading
only. So view1090 need not use pthread_exit.
2014-07-06 05:58:44 -04:00
hhm ec09cc7a71 B"H view1090: sleep a bit between loops
view1090 was using close to 100% CPU before, with the non-blocking
commits and the reconnection code. sleep a bit between loop iterations
to keep CPU usage low.

CPU usage with this addition was down to <1% in testing.
2014-07-03 02:41:06 -04:00
hhm 350a57f858 B"H view1090: do not block
- do not block on network data
2014-07-02 07:41:43 -04:00
hhm 96015e38c8 B"H view1090: handle disconnection
- keep trying to reconnect to server if disconnected
2014-07-02 07:38:46 -04:00
Malcolm Robb 30ae45ec2b Windows Version of dump1090
Make the modifications necessary to compile dump1090 for WinXP, Win7 and
hopefully Win8.

The files can be compiled using M$ Visual Studio/C++ 6.0. Due to various
licensing issues, I haven't included the libraries or DLLs. You will
need to locate pthreadVC2.lib and rtlsdr.lib to link the file, install
the zadig drivers to support the dongle, and locate libusb-1.0.dll,
msvcr100.dll, pthreadVC2.dll and rtlsdr.dll.

dump1090.exe will not run on any Windows version prior to XP SP2,
because msvcr100.dll imports several functions from the Windows kernel
that are not available on earlier versions. This means dump1090 won't
work on Win2K.

The major change to the code relates to file handles. The original code
assumes Linux behaviour in that handles are allocated from 0
sequentially upwards. However Windows handles are allocated pseudo
randomly, and handle numbers greater than 1024 would break the code. The
code has therefore been modified to use a linked list of connection
structures, rather than a static array limited to 1024 entries.
2014-04-25 14:48:14 +01:00
Malcolm Robb 86093ea95e WIZARDISHUNGRY
Dynamically size terminal using SIGWINCH

f18180fef4
2014-02-22 22:11:11 +00:00
Malcolm Robb f50744b11b Better Incorporate coaa.h 2013-09-30 11:46:36 +01:00
Malcolm Robb 19ce5a29b1 Additional debug message printing 2013-09-26 19:25:14 +01:00
Malcolm Robb 0430323014 Implement a remote interactive screen
No changes to dump1090, (except the version number)

Include a sample Linux batch start file called dump1090.sh for use when
running dump1090 headless. This file needs to be copied to the
/etc/init.d/ subdirectory on your raspberry pi, and marked as
executable. Then when you re-start your RPi, dump1090 will start-up
auto-magically and run as a sort of server to allow both local and
remote connection to it's various internet ports.

Modified the Makefile to build a new headless helper application called
view1090

Added view1090. This is an executable that allows you to connect to
dump1090 when it is running and 'see' the interactive screen display.
The default is to try and connect to dump1090 on IP address 127.0.0.1
port 30005. This should work if you are running on the same RPi as
dump1090 and using the default dump1090 port settings. However, if
you're running on a different machine you will have to specify the IP
address of the RPi running dump1090 using the --net-bo-ipaddr switch.
Something like "view1090 --net-bo-ipaddr 192.168.2.65" . You may also
have to sudo it, depending on your privilige settings.

I've also compiled view1090 as a Wiin32 exe, so you should be able to
run it under any 32 bit version of Microsoft Windows - i.e. Win95, Win
2K, Win XP, Win 7 etc.  It may work on Win 8 and 64 bit Windows, but I
haven't tried it. The Win32 version is compiled from the same source, so
takes all the same command line switches.
2013-09-24 18:37:54 +01:00