ModeSDeco2 20170127

+ fixed option "--airspy-rfbias" for powering a preamplifier directly from Airspy by injecting DC

+ changed option "--filter-nodup" on the opposite - by default it "On"

- disabled option "--airspy-packing" for AirSpy bit packing mode where 4 sets of 12 bit samples are packed into 3 sets of 16 bits for the transfer across the USB bus and this is good for some computers with cheap USB chipsets. But there is an overhead of extra memory bandwidth required on the host side to unpack the data into a useful format, so for optimal performance bit packing is disabled.


Highly recommend to specify the option --location <arg> of your receiver's location.
This value will be used to correctly decode the positions of aircraft when missing odd or even frames in the Compact Position Reporting (CPR) pair.
It does not require high precision coordinates, just specify values in decimal format with one or two decimal places (for example: --location 32.51:104.98)


Example for RTL:
./modesdeco2 --gain 49.6 --freq-correction 62 --location 32.51:104.98 --web 8088 --db D:\data\basestation.sqb --frdb D:\data\flightroute.sqb --silhouettes D:\data\silhouettes --pictures D:\data\pictures --beast 10003 --msg 30003 --sbs10001 10001 --metric

Example for AirSpy:
./modesdeco2 --airspy --location 32.51:104.98 --web 8088 --db D:\data\basestation.sqb --frdb D:\data\flightroute.sqb --silhouettes D:\data\silhouettes --pictures D:\data\pictures --beast 10003 --msg 30003 --metric --add-reference-point 56.39252:85.22168:THR21 --add-points 56.23667:83.98861:NN 56.69139:85.32917:SP 57.00722:82.05972:BA --web-auth admin:admin


./modesdeco2 --help
ModeSDeco2 v.20170127
Program options:
  -h [ --help ]             This help message
  --device-list             List available devices
  --device-index arg        Select RTL device (default: 0)
  --device-serial arg       Select RTL device by serial number
  --gain arg                Set Gain in RTL Receiver chip, dB (default: auto)
  --agc                     Enable Automatic Gain Control in RTL2832 chip (default: off)
  --freq-correction arg     Set RTL frequency correction, ppm (default: 0)
  --airspy                  Select AirSpy device
  --airspy-sn arg           Select AirSpy device by serial number
  --airspy-lna arg          Set LNA gain in AirSpy Receiver chip (default: 15)
  --airspy-mixer arg        Set Mixer gain in AirSpy Receiver chip (default: 15)
  --airspy-sr arg           Set AirSpy sample rate (default: max available) Example: 4, 6, 10
  --airspy-rfbias           Enable AirSpy RF Bias (default: off)
  --airspy-if arg           Set IF gain in AirSpy Receiver chip (default: 13)
  --airspy-workers arg      Set Airspy decoding worker threads (default: 1)
  --airspy-decimation arg   Set Airspy decoding decimation factor (default: 1)
  --airspy-fecbits arg      Forward Error Correction (FEC) bits (0..2) (default: 1)
  --airspy-linearity arg    Select Airspy linearity gains (0..21)
  --airspy-crc-valid        Select only CRC valid frames (default: off)
  --disable-correction      Disable correction of corrupted signals (Default: on)
  --input-file arg          Set input filename with I/Q signals
                            Format: type:filename (type: rtl,airspy10,airspy6)
  --rbs                     Enable RBS decoding (default: off) - for RTL devices only
  --beast arg               Enable BEAST output listen port (default: off)
  --avr arg                 Enable AVR output listen port (default: off)
  --avrmlat arg             Enable AVR MLAT output listen port (default: off)
  --avrmlatas arg           Enable AVR MLAT AirSpy output listen port (default: off)
  --sbs10001 arg            Enable SBS-3 output listen port (default: off)
  --msg arg                 Enable MSG output listen port (default: off)
  --web arg                 Enable Web Server on port (default: off)
  --google-key arg          Google Maps key
  --web-auth arg            Enable web auth username:password (default: off)
  --disable-web-log         Disable Web Log (default: on)
  --silhouettes arg         Set Silhouettes directory
  --pictures arg            Set Aircraft Pictures directory
  --db arg                  Set BaseStation DB Filename
  --frdb arg                Set FlightRoute DB Filename
  --location arg            Receiver location Lat:Lon Example: 36.27:-15.89
  --add-reference-point arg Add a new reference point for calculating distance and azimuth to the map Example: 38.5:-12.6:[Label1]
  --add-points arg          Add additional points (single or list) with coordinates to the map Example: 36.2:-15.3:[Label1] [38.5:-12.6:[Label1]] ...
  --verbose                 Verbose mode (default: off)
  --localtime               Local Time in MSG format output (default: UTC)
  --filter-expire arg       Filter record expire time, sec (default: 20)
  --filter-count arg        Filter record min count (default: 6)
  --filter-time arg         filter record min time, sec (default: 60)
  --filter-nocountry        Disable ICAO Country check filter (default: on)
  --filter-ic               Enable Interrogator Code suppression filter (default: off)
  --filter-nodup            Disable Duplicate filter (default: on)
  --flight-expire-time arg  Flight expire time, sec (default: 3600)
  --nmea arg                Enable GPS Emulation. Format: ICAO:Port:BaudRate
  --nmea-logfile arg        Set GPS Emulator logfile
  --metric                  Switch to metric system of distance measurement (default: imperial)



If running the program with one option "--help" and a description of the command-line options will be printed on console.
To stop the program, press the key combination <Control+C>


After the command <Control+C> to stop the program, be sure to wait for save data to the database file!
On the console will display a special message. Depending on number of observed aircraft the time for safely save data in the database can be up to one minute.


The decoding algorithm for AirSpy was provided courtesy of Youssef Touil http://airspy.com/
The aircraft and tower icon was provided courtesy of Andrew Whewell http://www.virtualradarserver.com/
The silhouettes was provided courtesy of Ian Kirby (copyright) http://www.sbsbst.co.uk/iank/
The WEB page "Charts" use Highcharts http://www.highcharts.com/

/sergsero
