Code Monkey home page Code Monkey logo

adsb_deku's Introduction

adsb_deku

github crates.io docs.rs build status

Decoder for ADS-B(Automatic Dependent Surveillance-Broadcast) Downlink Format protocol packets from 1090mhz. See dump1090_rs for a Rust demodulator. View planes in the sky around you, with only a rtl-sdr!

Radar Example

Applications

Minimum required rust version: 1.70.0.

Client Applications

Client applications use this library to display the data accumulated from an ADS-B demodulation server in various ways.

radar tui

An ADS-B client for the terminal written in Rust. Radar connects to an ADS-B demodulation server and stores this info, allowing an operator to control the display of the data.

  • Map Tab - Plot currently detected aircraft on lat/long grid. Add known locations with --locations option.
  • Coverage Tab - Plot all detected aircraft lat/long positions since starting radar. Features grayscale heatmap.
  • Aircraft Tab - Show detailed table of information about currently detected aircraft. Set aircraft position as center lat/long.
  • gpsd - Derive lat/long from a gpsd instance using --gpsd flag.

See apps/README.md for map control keybindings.

This application uses ratatui for generating the display to the terminal.

# Startup "radar" display in tui relative to your antenna position
> cargo r --bin radar --release -- --lat="50.0" --long="50.0" --locations "(name,lat,long)" "(name,lat,long)"

1090

Display protocol data structures and currently tracked planes using this library in the same fashion as dump1090-fa to a terminal stdout. Optionally panic on missing implementation or fmt::Display, see > ./1090 -h.

# Startup 1090 decode chain using this library
> cargo r --bin 1090 --release -- --debug

1090 Example

Server/Demodulation(External) Applications

This library contains logic for decoding a message, you must use a server for demodulating the message from 1090mhz into bytes usable by this library. These are called Server applications.

Rust translation of the popular C dump1090 tools, with demodulation and data forwarding functions.

> cargo r --release

Library

See libadsb_deku for more details.

Common

See rsadsb_common for more details.

adsb_deku's People

Contributors

aedrax avatar amacd31 avatar andelf avatar cablesynth avatar dependabot[bot] avatar jachdich avatar mikemorris avatar paunstefan avatar splaspood avatar step-security-bot avatar wcampbell0x2a avatar wiseman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

adsb_deku's Issues

Reserved field assertion failed

8bf10497c3e6a6291cfec0feaf12
thread 'main' panicked at '[E] Assertion error: field reserved failed assertion: reserved == 0', apps/src/1090.rs:101:25

Parse error: id = 4 on enum `ADSBVersion`

thread 'main' panicked at '[E] Parse error: Could not match enum variant id = 4 on enum `ADSBVersion`', apps/src/1090.rs:72:21

Caused by

96A4D01FF900210600493075E234

Could not match enum variant id = 0 on enum `ME`

I have to run for much longer before I hit any decode error now.

8DA90A6E000000000000005CAB8B
thread 'main' panicked at '[E] Parse error: Could not match enum variant id = 0 on enum `ME`', apps/src/1090.rs:71:21

Possible position mis-decode

8da353c65881360d90a7bc9b1858
 Extended Squitter Airborne position (barometric altitude)
  Address:       a353c6 (Mode S / ADS-B)
  Air/Ground:    airborne
  Altitude:      24675 ft barometric
  CPR type:      Airborne
  CPR odd flag:  odd
  CPR latitude:  (67272)
  CPR longitude: (42940)
a353c6: (Position { latitude: 33.64013671875, longitude: -125.04295349121094 }, 22625)

But that aircraft was closer to longitude -117 (screenshot may have been a few minutes after the decode above):
Screen Shot 2021-10-28 at 7 41 38 PM

Add trace feature

For an actively seen aircraft, show its trace behind the plain (places in which the plane was seen before).

Add test for clap inputs

This should be less important if i wasn't using rc version of clap, but it would be good to make sure that the input to the programs remain the same from version to version.

Parse Error: `AirborneVelocitySubType`

911c059d9805a452cf109f64924f
thread 'main' panicked at '[E] Parse error: Could not match enum variant id = 0 on enum `AirborneVelocitySubType`', apps/src/1090.rs:87:21

Parse Error: Extended Squitter (Non-Transponder) No position information (airborne or surface) (0)

adsb_deku

92ef92b301154cb9ab09466702c6
thread 'main' panicked at '[E] Parse error: Could not match enum variant id = 0 on enum `ME`', apps/src/1090.rs:74:21

dump1090-fa

*92ef92b301154cb9ab09466702c6;
CRC: 000000
RSSI: -25.0 dBFS
Score: 24 (DF18_UNKNOWN)
Time: 10550018865.25us
DF:18 AA:EF92B3 CF:2 ME:01154CB9AB0946
 Extended Squitter (Non-Transponder) No position information (airborne or surface) (0) (reliable)
  Other Address: EF92B3 (TIS-B, Mode A code and track file number)
  Air/Ground:    airborne?
  Baro altitude: 3100 ft
  NACp:          0
  SIL:           0 (p > 0.1%, unknown type)

Add `deku_write` feature for serialization

This isn't the primary point of this library, but I want to offer serialization as a feature since deku already adds this without development cost from us with the DekuWrite Derive macro.

This would add tests, and derive under the feature deku_write.

Panic: Not enough data, need 8 bits

thread 'main' panicked at '[E] Not enough data, need 8 bits (or 1 bytes)', apps/src/1090.rs:47:23

Caused by this frame:

96A082FB213B1CF2113820D6EDDF

Airplane selection follows aircraft

Instead of just changing the location when selecting an aircraft, keep moving lat/long along with aircraft until user uses: Enter, Left, Up, Down, Right keys.

Parse error: id=5 on enum ControlField

Running 1090 on my local feed, I've run into this:

thread 'main' panicked at '[E] Parse error: Could not match enum variant id = 5 on enum `ControlField`', apps/src/1090.rs:47:23

An actual sample frame that caused this error:

95298FCA680946499671468C7ACA

I wasn't sure if you had access to real data frames of the types not handled by the parser, since things like TIS-B may not be used in all regions. Here in Los Angeles we see a lot of data that might be rare in other places. I'll open a few other issues for parse errors with frame specimens, but if you don't care or don't find it useful, feel free to close these.

Add Settings screen

  • gpsd daemon socket connection (ip, port)
  • gpsd usb port (/dev/ttyUSB0)?
  • ADS-B server connection (ip, port)

Add Heatmap to Coverage display

This would not only display where a plane was seen, but how often a plane was seen in that location by changing the color of the display.

Large altitude error: Extended Squitter Airborne position (barometric altitude)

8DAB92A2593E0664204C69D8FE84
 Extended Squitter Airborne position (barometric altitude)
  Address:       ab92a2 (Mode S / ADS-B)
  Air/Ground:    airborne
  Altitude:      195200 ft barometric
  CPR type:      Airborne
  CPR odd flag:  odd
  CPR latitude:  (78352)
  CPR longitude: (19561)

I think this aircraft was actually flying at about 10600 feet at the time:
Screen Shot 2021-10-25 at 4 26 19 PM

Here's the message history for that aircraft leading up to that decode (the Short Air-Air Surveillance message decoding as being on the ground seems potentially suspicious?):

8DAB92A299105E93001486608C6D
 Extended Squitter Airborne velocity over ground, subsonic
  Address:       ab92a2 (Mode S / ADS-B)
  Air/Ground:    airborne
  GNSS delta:    -125 ft
  Heading:       149
  Speed:         177 kt groundspeed
  Vertical rate: 256 ft/min barometric

020007A0D08FF4
 Short Air-Air Surveillance
  ICAO Address:  ab92a2 (Mode S / ADS-B)
  Air/Ground:    ground

5DAB92A2B04912
 All Call Reply
  ICAO Address:  ab92a2 (Mode S / ADS-B)
  Air/Ground:    airborne

8DAB92A2593E0664204C69D8FE84
 Extended Squitter Airborne position (barometric altitude)
  Address:       ab92a2 (Mode S / ADS-B)
  Air/Ground:    airborne
  Altitude:      195200 ft barometric
  CPR type:      Airborne
  CPR odd flag:  odd
  CPR latitude:  (78352)
  CPR longitude: (19561)

Panic: fmt::Display not implemented

fmt::Display not implemented

Caused by

96A6C24699141E0E8018074AA959
Frame {
    df: TisB {
        cf: TISB_DF17(
            ADSB {
                capability: AG_AIRBORNE,
                icao: ICAO(
                    [
                        54,
                        18,
                        52,
                    ],
                ),
                me: Reserved,
                pi: 15769800,
            },
        ),
        pi: ICAO(
            [
                116,
                0,
                192,
            ],
        ),
    },
    crc: 0,
}


Frame { df: TisB { cf: TISB_DF17(ADSB { capability: AG_AIRBORNE, icao: ICAO([54, 18, 52]), me: Reserved, pi: 15769800 }), pi: ICAO([116, 0, 192]) }, crc: 0 }

Parse Error: `OperationStatus`

92479249fcb22e16fbdc3bac5b56
thread 'main' panicked at '[E] Parse error: Could not match enum variant id = 4 on enum `OperationStatus`', apps/src/1090.rs:100:25

Parse error: id=2 on enum ControlField

thread 'main' panicked at '[E] Parse error: Could not match enum variant id = 2 on enum `ControlField`', apps/src/1090.rs:47:23

Caused by

92A24528993C238900062053CDEF

Incorrect Capability Classes

readsb

28547   │ *8dace839f8132006005ab84f2dfa;
28548   │ hex:  ace839   CRC: 000000 fixed bits: 0 decode: ok
28549   │ RSSI: -3.0 dBFS
28550   │ Score: 1800
28551   │ receiverTime: 14406049.00us
28552   │ systemTime: 1637757645.129s      07:40:45
28553   │ DF:17 AA:ACE839 CA:5 ME:F8132006005AB8
28554   │  Extended Squitter Aircraft operational status (airborne) (31/0)
28555   │   ICAO Address:  ACE839 (adsb_icao)
28556   │   Air/Ground:    airborne
28557   │   NIC-A:         1
28558   │   NIC-baro:      1
28559   │   NACp:          10
28560   │   GVA:           2
28561   │   SIL:           3 (p <= 0.00001%, per flight hour)
28562   │   SDA:           2
28563   │   Aircraft Operational Status:
28564   │     Version:            2
28565   │     Capability classes: 1090IN ARV TS UATIN
28566   │     Operational modes:  SAF
28567   │     Heading ref dir:    True heading

adsb_deku

11671   │ 8dace839f8132006005ab84f2dfa
11672   │ Frame {
11673   │     df: ADSB(
11674   │         ADSB {
11675   │             capability: AG_AIRBORNE,
11676   │             icao: ICAO(
11677   │                 [
11678   │                     172,
11679   │                     232,
11680   │                     57,
11681   │                 ],
11682   │             ),
11683   │             me: AircraftOperationStatus(
11684   │                 Airborne(
11685   │                     OperationStatusAirborne {
11686   │                         capability_class: CapabilityClassAirborne {
11687   │                             reserved0: 0,
11688   │                             acas: 0,
11689   │                             cdti: 1,
11690   │                             reserved1: 0,
11691   │                             arv: 1,
11692   │                             ts: 1,
11693   │                             tc: 0,
11694   │                             reserved2: 32,
11695   │                         },
11696   │                         operational_mode: OperationalMode {
11697   │                             reserved: 0,
11698   │                             tcas_ra_active: false,
11699   │                             ident_switch_active: false,
11700   │                             reserved_recv_atc_service: false,
11701   │                             single_antenna_flag: true,
11702   │                             system_design_assurance: 2,
11703   │                         },
11704   │                         reserved: 0,
11705   │                         version_number: DOC9871AppendixC,
11706   │                         nic_supplement_a: 1,
11707   │                         navigational_accuracy_category: 10,
11708   │                         geometric_vertical_accuracy: 2,
11709   │                         source_integrity_level: 3,
11710   │                         barometric_altitude_integrity: 1,
11711   │                         horizontal_reference_direction: 0,
11712   │                         sil_supplement: 0,
11713   │                         reserved1: 0,
11714   │                     },
11715   │                 ),
11716   │             ),
11717   │             pi: ICAO(
11718   │                 [
11719   │                     79,
11720   │                     45,
11721   │                     250,
11722   │                 ],
11723   │             ),
11724   │         },
11725   │     ),
11726   │     crc: 0,
11727   │ }
11728   │  Extended Squitter Aircraft operational status (airborne)
11729   │   Address:       ace839 (Mode S / ADS-B)
11730   │   Air/Ground:    airborne
11731   │   Aircraft Operational Status:
11732   │    Version:            2
11733   │    Capability classes: CDTI ARV TS
11734   │    Operational modes:  SAF SDA=2
11735   │    NIC-A:              1
11736   │    NACp:               10
11737   │    GVA:                2
11738   │    SIL:                3 (per hour)
11739   │    NICbaro:            1
11740   │    Heading reference:  true north

Add BDS2,0 Aircraft Identification

A0001910204D7075D35820C25C0C
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Invalid altitude"', src/lib.rs:456:46
stack backtrace:
   0: rust_begin_unwind
             at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa/library/std/src/panicking.rs:517:5
   1: core::panicking::panic_fmt
             at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa/library/core/src/panicking.rs:101:14
   2: core::result::unwrap_failed
             at /rustc/09c42c45858d5f3aedfa670698275303a3d19afa/library/core/src/result.rs:1617:5
   3: adsb_deku::Altitude::read
   4: <adsb_deku::DF as deku::DekuRead>::read
   5: <adsb_deku::Frame as deku::DekuContainerRead>::from_bytes
   6: _1090::main

By the way, amazing work and it's awesome how quickly you're improving this code.

Enable Mouse Control

  • Move on map by dragging mouse
  • Zoom In/Out on map with scroll wheel
  • Select Tab
  • Click on Airplane on Airplane tab, double click to select(same as enter currently)
  • Scroll through airplanes on Airplanes Tab
  • Reset view (same as "Enter" key) in the top right corner

Add BDS1,0 Altitude Reply

Example 01:

dump1090-fa:

*a00017b010030a80f60000a0fc1e;
CRC: a6c756
RSSI: -9.4 dBFS
Score: 12 (UNRELIABLE_KNOWN)
Time: 50236182.08us
DF:20 addr:A6C756 FS:0 DR:0 UM:0 AC:6064 MB:10030A80F60000
 Comm-B, Altitude Reply
 Comm-B format: BDS1,0 Datalink capabilities
 ICAO Address:  A6C756 (Mode S / ADS-B)
 Air/Ground:    airborne?
 Baro altitude: 37000 ft

adsb_deku:

a00017b010030a80f60000a0fc1e
Frame {
    df: CommBAltitudeReply {
        flight_status: NoAlertNoSPIAirborne,
        dr: None,
        um: UtilityMessage {
            iis: 0,
            ids: NoInformation,
        },
        alt: 36800,
        mb: [
            8,
            1,
            133,
            64,
            123,
            0,
            0,
        ],
        parity: ICAO(
            [
                80,
                126,
                15,
            ],
        ),
    },
    crc: 10930006,
}
 Comm-B Altitude Reply
  data: [8, 1, 85, 40, 7b, 0, 0]
  ICAO Address: 507e0f (Mode S / ADS-B)

Example 02:

*a000179f0000000000000019a524;
CRC: a6c756
RSSI: -9.9 dBFS
Score: 12 (UNRELIABLE_KNOWN)
Time: 54835314.25us
DF:20 addr:A6C756 FS:0 DR:0 UM:0 AC:6047 MB:00000000000000
 Comm-B, Altitude Reply
  Comm-B format: empty response
  ICAO Address:  A6C756 (Mode S / ADS-B)
  Air/Ground:    airborne?
  Baro altitude: 36975 ft

Example 03:

*a020133810020a80f000007707ca;
CRC: a5fd2d
RSSI: -7.3 dBFS
Score: 12 (UNRELIABLE_KNOWN)
Time: 76604277.67us
DF:20 addr:A5FD2D FS:0 DR:4 UM:0 AC:4920 MB:10020A80F00000
 Comm-B, Altitude Reply
  Comm-B format: unknown format
  ICAO Address:  A5FD2D (Mode S / ADS-B)
  Air/Ground:    airborne?
  Baro altitude: 30000 ft

`TargetStateAndStatusInformation` support new subtype

9689294eed4a82444cd8f7a933ab
thread 'main' panicked at '[E] Assertion error: field subtype failed assertion: subtype == 1', apps/src/1090.rs:103:25
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Parse error: id = 1 on enum ControlField

thread 'main' panicked at '[E] Parse error: Could not match enum variant id = 1 on enum `ControlField`', apps/src/1090.rs:47:23

Caused by

91ADF9CEC11C0524407F11538EE5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.