### Nix Platform - Installation Source: https://github.com/xoolive/rs1090/blob/master/readme.md Instructions for installing the project executables using Nix. ```APIDOC ## Nix platform This repository provides a Nix flake configuration for building and managing this project. You may run the following to get the `jet1090` and `decode1090` executables in your PATH ```sh nix profile install ``` ``` -------------------------------- ### Python Bindings Installation Source: https://github.com/xoolive/rs1090/blob/master/readme.md Install the rs1090 Python bindings using pip. ```APIDOC ## Python Bindings Installation You may install the bindings compiled for most Python versions with: ```sh pip install rs1090 ``` ``` -------------------------------- ### Redis Pub/Sub Integration for Real-time Messaging Source: https://context7.com/xoolive/rs1090/llms.txt This example shows how to configure and run jet1090 to publish decoded ADS-B messages to a Redis channel. It includes instructions for starting a Redis server using Docker and subscribing to the messages using the Redis CLI for real-time consumption by other applications. ```bash # Start Redis server (Docker/Podman) docker run -d --rm --name redis -p 6379:6379 -p 8001:8001 redis/redis-stack:latest # Start jet1090 with Redis output jet1090 --redis-url redis://localhost:6379 --redis-topic adsb rtlsdr:// # Subscribe to messages using Redis CLI redis-cli PSUBSCRIBE adsb ``` -------------------------------- ### Install Project Executables with Nix Source: https://github.com/xoolive/rs1090/blob/master/readme.md Installs the jet1090 and decode1090 executables into your system's PATH using Nix. ```sh nix profile install ``` -------------------------------- ### Start jet1090 with various data sources Source: https://context7.com/xoolive/rs1090/llms.txt Demonstrates how to initialize jet1090 using different input protocols such as UDP, WebSocket, RTL-SDR, TCP, and file-based IQ playback. ```bash jet1090 --verbose udp://:5678 jet1090 --verbose ws://192.168.0.20:9876/receiver1 jet1090 --verbose rtlsdr://@EHAM tcp://192.168.0.20:10003@LFBO jet1090 --serve-port 8080 tcp://192.168.0.20:10003 jet1090 --redis-url redis://localhost:6379 --redis-topic adsb tcp://192.168.0.20:10003 jet1090 --verbose "file://~/recordings/adsb.iq?format=cu8" ``` -------------------------------- ### Manage Project with Nix Source: https://github.com/xoolive/rs1090/blob/master/crates/rs1090/readme.md Commands for installing the project via Nix profile and managing the development environment. ```shell nix profile install nix develop nix build nix run ``` -------------------------------- ### Run Redis server for pub/sub Source: https://github.com/xoolive/rs1090/blob/master/docs/output.md Commands to start a Redis server instance using Docker or Podman for message distribution. ```bash docker run -d --rm --name redis -p 6379:6379 -p 8001:8001 redis/redis-stack:latest ``` ```bash podman run -d --rm --name redis -p 6379:6379 -p 8001:8001 redis/redis-stack:latest ``` -------------------------------- ### Build and Serve MkDocs Documentation Source: https://github.com/xoolive/rs1090/blob/master/agents.md Commands to build a static MkDocs site or serve it locally for preview. It uses 'uvx' to manage Python environments and installs the 'mkdocs-material' theme with imaging support. ```shell uvx --with "mkdocs-material[imaging]" mkdocs serve # Local preview ``` ```shell uvx --with "mkdocs-material[imaging]" mkdocs build -d site # Build static site ``` -------------------------------- ### Install rs1090-wasm via NPM Source: https://github.com/xoolive/rs1090/blob/master/crates/rs1090-wasm/readme.md Standard installation command for the rs1090-wasm package using the npm package manager. ```shell npm install rs1090-wasm ``` -------------------------------- ### Run jet1090 with SoapySDR Devices Source: https://github.com/xoolive/rs1090/blob/master/docs/sources.md Examples of how to start decoding Mode S messages using SoapySDR devices with jet1090. The driver for the specific device (e.g., rtlsdr, hackrf, plutosdr) must be specified. ```sh jet1090 --verbose soapy://driver=rtlsdr jet1090 --verbose soapy://driver=hackrf jet1090 --verbose soapy://driver=plutosdr ``` -------------------------------- ### Install rs1090 Python Package Source: https://github.com/xoolive/rs1090/blob/master/python/readme.md Installs the rs1090 library using pip. This is the primary method for obtaining the library for use in Python projects. ```shell pip install rs1090 ``` -------------------------------- ### Command-Line IQ File Decoding Source: https://github.com/xoolive/rs1090/blob/master/docs/config.md Examples of how to use the `jet1090` command-line tool to decode IQ files. It demonstrates specifying absolute paths, using tilde expansion, omitting the optional format parameter, and including location context. ```bash # With absolute path jet1090 "file:///home/user/adsb.iq?format=cu8" ``` ```bash # With tilde expansion jet1090 "file://~/recordings/adsb.iq?format=cu8" ``` ```bash # Default format (cu8) - format parameter optional jet1090 "file:///path/to/file.iq" ``` ```bash # With location context jet1090 "file://~/adsb.iq?format=cu8&LFBO" ``` -------------------------------- ### Start WebSocket broadcaster with wsbroad Source: https://github.com/xoolive/rs1090/blob/master/docs/sources.md Initiates a WebSocket broadcast server on all network interfaces (0.0.0.0) on port 9876. This acts as a central point to redistribute data feeds. ```sh wsbroad 0.0.0.0:9876 ``` -------------------------------- ### Install decode1090 using Cargo Source: https://github.com/xoolive/rs1090/blob/master/crates/decode1090/readme.md Installs the decode1090 application using the Cargo package manager. This command fetches the latest version from crates.io and compiles it locally. ```sh cargo install decode1090 ``` -------------------------------- ### Run jet1090 with Airspy Device Source: https://github.com/xoolive/rs1090/blob/master/docs/sources.md Commands to start decoding Mode S messages using an Airspy device. Examples show how to use the default device, a specific device index, or a device identified by its serial number. ```sh # Default device (index 0) jet1090 --verbose airspy:// # Explicit device index jet1090 --verbose airspy://1 # By serial jet1090 --verbose airspy://serial=0x35AC63DC2D8C7A4F ``` -------------------------------- ### Install rs1090 using Cargo Source: https://github.com/xoolive/rs1090/blob/master/readme.md This command-line instruction shows how to add the rs1090 crate to your Rust project using the Cargo package manager. This is the recommended way to include the library in your project. ```sh cargo add rs1090 ``` -------------------------------- ### RTL-SDR Command-Line Usage Examples Source: https://github.com/xoolive/rs1090/blob/master/docs/config.md Control RTL-SDR devices from the command line using various formats. Options include selection by index or serial number, setting gain, enabling bias-tee, and specifying location. ```bash # By device index jet1090 rtlsdr://0 jet1090 rtlsdr://1 ``` ```bash # By serial number jet1090 rtlsdr://serial=00000001 ``` ```bash # Default device (device 0) jet1090 rtlsdr:// ``` ```bash # With custom gain jet1090 rtlsdr://0?gain=40 ``` ```bash # With bias-tee enabled jet1090 rtlsdr://0?bias_tee=true ``` ```bash # With location (airport code) - using ? or @ syntax jet1090 rtlsdr://0?LFBO jet1090 rtlsdr://0@LFBO ``` ```bash # Combining gain and location jet1090 rtlsdr://0?LFBO&gain=42.5 jet1090 rtlsdr://0@LFBO&gain=42.5 ``` ```bash # Combining all parameters jet1090 rtlsdr://0?LFBO&gain=42.5&bias_tee=true ``` -------------------------------- ### Install rs1090 Library with Cargo Source: https://github.com/xoolive/rs1090/blob/master/crates/rs1090/readme.md This snippet shows how to add the rs1090 Rust library to your project using the Cargo package manager. It demonstrates both the `cargo add` command and the direct TOML file modification. ```sh cargo add rs1090 ``` ```toml rs1090 = "1.0.0" # check for the latest version, we are not there yet ``` -------------------------------- ### GET /all Source: https://context7.com/xoolive/rs1090/llms.txt Retrieves the current state vectors for all tracked aircraft. ```APIDOC ## GET /all ### Description Returns the current state vectors including position, altitude, and velocity for all tracked aircraft. ### Method GET ### Endpoint /all ### Response #### Success Response (200) - **state_vectors** (array of objects) - List of aircraft state objects. #### Response Example [{"icao24":"484175","callsign":"AFR123","latitude":48.856,"longitude":2.352,"altitude":35000,"groundspeed":450,"track":127.5,"vertical_rate":-512}] ``` -------------------------------- ### Airspy Command-Line Usage Examples Source: https://github.com/xoolive/rs1090/blob/master/docs/config.md Control Airspy devices from the command line. Devices can be selected by index or serial number. ```bash jet1090 airspy:// jet1090 airspy://1 jet1090 airspy://serial=0x35AC63DC2D8C7A4F ``` -------------------------------- ### Rust Example: Decode ADS-B Message to JSON Source: https://github.com/xoolive/rs1090/blob/master/crates/rs1090/readme.md An example demonstrating how to use the rs1090 library in Rust to decode an ADS-B message from a byte array and serialize it into a JSON string. It utilizes the `hexlit` crate for easy hex string parsing and `serde_json` for JSON conversion. ```rust use hexlit::hex; use rs1090::prelude::*; fn main() { let bytes: [u8; 14] = hex!("8c4841753a9a153237aef0f275be"); // ADS-B decoding if let Ok(msg) = Message::try_from(bytes.as_slice()) { // JSON output let json = serde_json::to_string(&msg).expect("JSON error"); println!("{}", json); } } ``` -------------------------------- ### Systemd user service for wsbroad Source: https://github.com/xoolive/rs1090/blob/master/docs/sources.md A systemd user service configuration file to manage the `wsbroad` process. It ensures the WebSocket broadcast server starts automatically and restarts if it fails. ```service [Unit] Description=WebSocket broadcast at 9876 [Service] Type=simple ExecStart=/home/user/.local/bin/wsbroad 0.0.0.0:9876 Restart=always RestartSec=3 [Install] WantedBy=multi-user.target ``` -------------------------------- ### Consume JSONL data in Python, Rust, JavaScript, and R Source: https://github.com/xoolive/rs1090/blob/master/docs/output.md Examples of how to read newline-delimited JSON (JSONL) files generated by rs1090 using common data processing libraries. ```python import pandas as pd df = pd.read_json("output.jsonl", lines=True) ``` ```python import polars as pl df = pl.read_ndjson("output.jsonl") ``` ```rust use polars::prelude::*; let df = LazyFrame::scan_ndjson("output.jsonl", ScanArgsNdJson::default())?.collect()?; ``` ```javascript data = fetch("output.jsonl").then(response => response.text()).then(text => text.split("\n").filter(line => line.trim() !== "").map(JSON.parse)); ``` ```r library(ndjson) df <- ndjson::stream_in("output.jsonl") ``` -------------------------------- ### GET /track Source: https://context7.com/xoolive/rs1090/llms.txt Retrieves the trajectory history for a specific aircraft. ```APIDOC ## GET /track ### Description Fetches the recorded trajectory for a specific aircraft identified by its ICAO24 address. ### Method GET ### Endpoint /track ### Parameters #### Query Parameters - **icao24** (string) - Required - The ICAO24 address of the aircraft. - **since** (integer) - Optional - Unix timestamp to filter trajectory data from. ### Response #### Success Response (200) - **trajectory** (array of objects) - List of historical position frames. #### Response Example [{"timestamp":1735082050.88,"frame":"8d4841753a9a153237aef0f275be"}] ``` -------------------------------- ### GET / Source: https://context7.com/xoolive/rs1090/llms.txt Retrieves a list of all currently visible ICAO24 aircraft addresses. ```APIDOC ## GET / ### Description Returns a list of all ICAO24 addresses currently visible to the receiver. ### Method GET ### Endpoint / ### Response #### Success Response (200) - **addresses** (array of strings) - List of ICAO24 hex codes. #### Response Example ["484175","4400eb","34768d","3c66e6"] ``` -------------------------------- ### Define Movement Corner Case Tests Source: https://github.com/xoolive/rs1090/blob/master/docs/contribute.md Example structure for testing movement codes in Rust, covering boundary values and specific ranges to ensure robustness. ```rust // Code 0: No information available test_movement_no_info() // Code 1: Stopped (0.0 kt) test_movement_stopped() // Code 13-38: Verify 0.5 kt steps (validates bug fix) test_movement_2_15kt_range() // Code 124: Maximum (175+ kt) test_movement_175kt_plus() ``` -------------------------------- ### WebAssembly Mode S Decoding with rs1090-wasm Source: https://context7.com/xoolive/rs1090/llms.txt Demonstrates how to initialize and use the rs1090-wasm module for decoding Mode S messages in JavaScript. It covers basic decoding, decoding with reference position, retrieving aircraft and airport information, and decoding specific BDS message types. Installation is done via npm. ```javascript import init, { decode, aircraft_information, airport_information } from 'rs1090-wasm'; await init(); // Decode a single message const result = decode("8d4841753a9a153237aef0f275be"); console.log(result); // {df: "17", icao24: "484175", bds: "06", NUCp: 7, groundspeed: 17.0, ...} // Decode with reference position for CPR resolution const resultWithPos = decode("8d4841753a9a153237aef0f275be", [48.856, 2.352]); console.log(resultWithPos.latitude, resultWithPos.longitude); // Get aircraft information from ICAO24 address const aircraftInfo = aircraft_information("484175"); console.log(aircraftInfo); // {registration: "F-GKXS", typecode: "A320", ...} // Search airports const airports = airport_information("paris"); console.log(airports); // [{icao: "LFPG", iata: "CDG", name: "Charles de Gaulle", ...}, ...] // Observable notebook usage rs1090 = { let module = await import("https://unpkg.com/rs1090-wasm/web/rs1090_wasm.js"); await module.default("https://unpkg.com/rs1090-wasm/web/rs1090_wasm_bg.wasm"); module.run(); return module; } // Decode specific BDS types const bds05 = rs1090.decode_bds05("8d4841753a9a153237aef0f275be"); // Airborne position const bds09 = rs1090.decode_bds09("8d3c66e699086a919838884331c7"); // Airborne velocity const bds20 = rs1090.decode_bds20("a000139381dc1906200046a97993"); // Aircraft identification const bds40 = rs1090.decode_bds40("a80004aa88210c0880400000bdcb"); // Selected altitude const bds50 = rs1090.decode_bds50("a000139381dc1906200046a97993"); // Track and turn const bds60 = rs1090.decode_bds60("a800148b888fc8ac9040000076e4"); // Heading and speed ``` -------------------------------- ### Specify Reference Location for RTL-SDR Source: https://github.com/xoolive/rs1090/blob/master/docs/sources.md Examples of how to specify a reference location (airport code or lat/lon) when running jet1090 with an RTL-SDR dongle. This improves decoding of ground messages. ```sh jet1090 --verbose rtlsdr://@EHAM # Amsterdam Schiphol airport (NL) jet1090 --verbose rtlsdr://@LHR # London Heathrow airport (UK) ``` -------------------------------- ### Run jet1090 with RTL-SDR Dongle Source: https://github.com/xoolive/rs1090/blob/master/docs/sources.md Command to start decoding Mode S messages using an RTL-SDR dongle. The --verbose option provides detailed output for troubleshooting. It shows detected tuners and decoded JSON messages. ```sh $ jet1090 --verbose rtlsdr:// Found Rafael Micro R820T tuner [INFO] Opening Generic RTL2832U OEM :: 00000001... Found Rafael Micro R820T tuner [INFO] Using format CS16. Allocating 15 zero-copy buffers {"timestamp":1735082050.8826132,"frame":"8d34768d58b524b5986843dfee26","df":"17","icao24":"34768d","bds":"05","tc":11,"NUCp":7,"NICb":0,"altitude":35050,"source":"barometric","parity":"odd","lat_cpr":23244,"lon_cpr":26691,"metadata":[{"system_timestamp":1735082050.8826132,"rssi":-28.450745,"serial":14924845721654670821,"name":"rtlsdr"}]} {"timestamp":1735082051.040175,"frame":"8d34768de11200000000002919db","df":"17","icao24":"34768d","bds":"61","subtype":"emergency_priority","emergency_state":"none","squawk":"2010","metadata":[{"system_timestamp":1735082051.040175,"rssi":-29.93521,"serial":14924845721654670821,"name":"rtlsdr"}]} ``` -------------------------------- ### Configure jet1090 via TOML Source: https://context7.com/xoolive/rs1090/llms.txt A sample configuration file demonstrating how to set global parameters and define multiple data sources including RTL-SDR, TCP, WebSocket, and SoapySDR. ```toml interactive = false verbose = true serve_port = 8080 [[sources]] name = "home-receiver" rtlsdr = { device = 0 } gain = 49.6 [[sources]] name = "radarcape-remote" tcp = "192.168.0.20:10003" [[sources]] websocket = "ws://192.168.0.30:8765/zurich" ``` -------------------------------- ### Nix Platform - Available Packages Source: https://github.com/xoolive/rs1090/blob/master/readme.md List of available packages that can be built with Nix. ```APIDOC ### Available packages ```sh nix build .#jet1090 # build the jet1090 executable (same as default) ``` ``` -------------------------------- ### Format Nix Files with Nix Source: https://github.com/xoolive/rs1090/blob/master/readme.md Formats all Nix files in the project using nixpkgs-fmt. ```sh nix fmt ``` -------------------------------- ### GET /airport Source: https://context7.com/xoolive/rs1090/llms.txt Searches for airport information based on a query string. ```APIDOC ## GET /airport ### Description Searches for airports by name, city, or code. ### Method GET ### Endpoint /airport ### Parameters #### Query Parameters - **q** (string) - Required - Search query string. ### Response #### Success Response (200) - **airports** (array of objects) - List of matching airport records. #### Response Example [{"icao":"LFPG","iata":"CDG","name":"Charles de Gaulle","city":"Paris"}] ``` -------------------------------- ### Run Project Benchmarks Source: https://github.com/xoolive/rs1090/blob/master/docs/contribute.md Commands to execute performance benchmarks for the Rust and Python implementations to track efficiency. ```bash cargo bench ``` ```bash cd python/examples && python benchmark.py ``` -------------------------------- ### Build and Open Rust API Documentation Source: https://github.com/xoolive/rs1090/blob/master/agents.md Command to generate Rust API documentation for all features of the crate, excluding dependencies, and automatically open it in the default web browser. ```shell cargo doc --all-features --no-deps --open ``` -------------------------------- ### Nix Platform - Development Commands Source: https://github.com/xoolive/rs1090/blob/master/readme.md Common development commands using Nix. ```APIDOC ### Development commands ```sh nix develop # open a shell with the proper environment to compile rs1090 nix build # build the jet1090 executable (default package) nix run # run the jet1090 executable directly ``` ``` -------------------------------- ### Load rs1090-wasm in Observable Source: https://github.com/xoolive/rs1090/blob/master/crates/rs1090-wasm/readme.md Demonstrates how to asynchronously import and initialize the WASM module within the Observable platform environment. ```javascript rs1090 = { let module = await import("https://unpkg.com/rs1090-wasm/web/rs1090_wasm.js"); await module.default("https://unpkg.com/rs1090-wasm/web/rs1090_wasm_bg.wasm"); module.run(); return module; } ``` -------------------------------- ### WebAssembly Bindings Source: https://github.com/xoolive/rs1090/blob/master/readme.md Information on using the WebAssembly bindings. ```APIDOC ## WebAssembly Bindings Usage is documented on [https://observablehq.com/@xoolive/rs1090](https://observablehq.com/@xoolive/rs1090). ``` -------------------------------- ### Query jet1090 REST API Source: https://context7.com/xoolive/rs1090/llms.txt Examples of using curl to interact with the jet1090 REST API to retrieve aircraft state vectors, trajectories, and airport information. ```bash curl http://localhost:8080/ curl http://localhost:8080/all curl "http://localhost:8080/track?icao24=484175" curl "http://localhost:8080/track?icao24=484175&since=1735082000" curl "http://localhost:8080/airport?q=paris" ``` -------------------------------- ### Develop with Nix Shell Source: https://github.com/xoolive/rs1090/blob/master/readme.md Opens a development shell with the necessary environment to compile rs1090 using Nix. ```sh nix develop ``` -------------------------------- ### Run All Checks with Nix Source: https://github.com/xoolive/rs1090/blob/master/readme.md Executes all defined checks for the project, including formatting, linting, and testing, using Nix. ```sh nix flake check ``` -------------------------------- ### Generate and Check Rust Documentation with Nix Source: https://github.com/xoolive/rs1090/blob/master/readme.md Generates and checks the Rust documentation using cargo doc via Nix. ```sh nix run .#checks.rustdoc ``` -------------------------------- ### Run jet1090 on UDP endpoint Source: https://github.com/xoolive/rs1090/blob/master/docs/sources.md Starts the jet1090 application to listen for and process data from a specified UDP port. This is typically used on a remote machine receiving redirected feeds. ```sh jet1090 --verbose udp://:5678 ``` -------------------------------- ### Nix Platform - Code Quality and Testing Source: https://github.com/xoolive/rs1090/blob/master/readme.md Commands for checking code quality, linting, and running tests with Nix. ```APIDOC ### Code quality and testing The flake provides several checks that you can run individually: ```sh # Format checking and fixing nix fmt # format Nix files with nixpkgs-fmt nix run .#checks.fmt # check Rust code formatting with rustfmt # Linting and static analysis nix run .#checks.clippy-check # run Clippy lints with warnings as errors nix run .#checks.rustdoc # generate and check documentation # Testing nix run .#checks.test-check # run tests with cargo-nextest # Run all checks at once nix flake check # run all defined checks ``` ``` -------------------------------- ### Configure SeRo Systems Data Input Source: https://github.com/xoolive/rs1090/blob/master/docs/config.md This TOML configuration demonstrates how to integrate with SeRo Systems by providing an API token. It also includes optional filters for data frames (DF) and aircraft (ICAO24) to manage bandwidth. ```toml [[sources]] sero.token = "" sero.df_filter = [17, 18, 20, 21] # (default: no filter) # sero.aircraft_filter = [] # list of integer values corresponding to icao24 addresses (default: no filter) ``` -------------------------------- ### Run Quality Assurance and Tests with Nix Source: https://github.com/xoolive/rs1090/blob/master/crates/rs1090/readme.md Commands to run code formatting, linting, and test suites using the project's Nix flake configuration. ```shell nix fmt nix run .#checks.fmt nix run .#checks.clippy-check nix run .#checks.rustdoc nix run .#checks.test-check nix flake check ``` -------------------------------- ### Decoded ADS-B Message JSON Output Source: https://github.com/xoolive/rs1090/blob/master/docs/index.md Example of a flattened JSON object representing a decoded ADS-B message. It includes decoded fields like altitude, position, and metadata from multiple receiver sources. ```json { "timestamp": 1734990395.4640563, "frame": "8d4400eb58c7d45c48e257428292", "df": "17", "icao24": "4400eb", "bds": "05", "tc": 11, "NUCp": 7, "NICb": 0, "altitude": 38925, "source": "barometric", "parity": "odd", "lat_cpr": 11812, "lon_cpr": 57943, "latitude": 49.36343435513771, "longitude": 4.188031648334704, "metadata": [ { "system_timestamp": 1734990395.4640563, "gnss_timestamp": 1734990395.4026532, "nanoseconds": 84176392945664, "rssi": -12.567779, "serial": 9467850719808063263 }, { "system_timestamp": 1734990395.6401641, "gnss_timestamp": 1734990395.539131, "nanoseconds": 84176529423429, "rssi": -24.048405, "serial": 4075562207768597288 } ] } ``` -------------------------------- ### Build jet1090 Executable with Nix Source: https://github.com/xoolive/rs1090/blob/master/readme.md Builds the jet1090 executable using the Nix flake configuration. ```sh nix build ``` ```sh nix build .#jet1090 ``` -------------------------------- ### Run Clippy Lints with Nix Source: https://github.com/xoolive/rs1090/blob/master/readme.md Runs Clippy lints on the Rust code, treating warnings as errors, using Nix. ```sh nix run .#checks.clippy-check ``` -------------------------------- ### Configure IQ File Decoding with TOML Source: https://github.com/xoolive/rs1090/blob/master/docs/config.md This TOML configuration snippet shows how to specify an IQ file for offline decoding. It includes options for the file path, IQ format, and metadata like airport and name. Tilde expansion is supported for file paths. ```toml [[sources]] file = "/path/to/recording.iq" iq_format = "cu8" # Optional, defaults to "cu8" name = "Recording 2024-01-19" airport = "LFBO" ``` ```toml [[sources]] file = "~/adsb-recordings/flight-2024-01-19.iq" iq_format = "cu8" name = "Historical Flight" latitude = 43.5993189 longitude = 1.4362472 ``` -------------------------------- ### Run Tests with Nix Source: https://github.com/xoolive/rs1090/blob/master/readme.md Runs all project tests using cargo-nextest via Nix. ```sh nix run .#checks.test-check ``` -------------------------------- ### Decode Beast Format Data from TCP Source: https://github.com/xoolive/rs1090/blob/master/docs/sources.md Command to decode Mode S messages in Beast binary format received over TCP. Examples show connecting to a single receiver or multiple receivers, optionally specifying an ICAO location code. ```sh jet1090 --verbose tcp://192.168.0.20:10003 jet1090 --verbose tcp://192.168.0.20:10003@LFBO tcp://192.168.0.30:10003@LFPO ``` -------------------------------- ### Run Project Tests Source: https://github.com/xoolive/rs1090/blob/master/docs/contribute.md Commands to execute the test suites for both Rust and Python environments. These commands ensure that the workspace and specific modules are verified against current requirements. ```bash # Run all workspace tests cargo test --workspace --all-features --all-targets # Run tests for specific crate cargo test -p rs1090 --all-features ``` ```bash cd python uv run pytest ``` -------------------------------- ### Access decode1090 CLI Help Source: https://github.com/xoolive/rs1090/blob/master/crates/rs1090/readme.md Displays the help menu for the decode1090 command-line utility. ```shell decode1090 --help ``` -------------------------------- ### Check Rust Code Formatting with Nix Source: https://github.com/xoolive/rs1090/blob/master/readme.md Checks the formatting of Rust code using rustfmt via Nix. ```sh nix run .#checks.fmt ``` -------------------------------- ### Import rs1090 library Source: https://github.com/xoolive/rs1090/blob/master/crates/rs1090-wasm/readme.md Standard ES module import syntax for the rs1090 library. ```javascript import { rs1090 } from "@xoolive/rs1090"; ``` -------------------------------- ### Run Quality Assurance Checks Source: https://github.com/xoolive/rs1090/blob/master/docs/contribute.md Commands to perform linting, formatting, and type checking for Rust and Python codebases to maintain project standards. ```bash cargo clippy --workspace --all-targets --all-features -- -D warnings cargo fmt --all --check ``` ```bash cd python uv run ruff check uv run ruff format --check ``` -------------------------------- ### Create GitHub Issue Source: https://github.com/xoolive/rs1090/blob/master/agents.md Command to create a new GitHub issue. It requires explicit user acknowledgement before execution and takes a title and body as arguments. ```shell # Never open issues without user acknowledgement gh issue create --title "Title" --body "Description" ``` -------------------------------- ### Redirect UDP to WebSocket using websocat Source: https://github.com/xoolive/rs1090/blob/master/docs/sources.md Connects to a local UDP listener on 127.0.0.1:5678 and forwards the data to a WebSocket server running on 0.0.0.0:9876, appending the port number to the path. The -b and -u flags ensure binary and UDP modes respectively. ```sh websocat -b -u udp-l:127.0.0.1:5678 ws://0.0.0.0:9876/5678 ``` -------------------------------- ### Rust Library: Basic Message Decoding Source: https://context7.com/xoolive/rs1090/llms.txt Demonstrates how to decode individual ADS-B/Mode S messages from hexadecimal strings or raw bytes using the rs1090 library. ```APIDOC ## POST /decode/message ### Description Decodes a single raw ADS-B or Mode S message provided as a hexadecimal string. ### Method POST ### Endpoint /decode/message ### Parameters #### Request Body - **hex_string** (string) - Required - The hexadecimal representation of the 14-byte ADS-B message. ### Request Example { "hex_string": "8d4841753a9a153237aef0f275be" } ### Response #### Success Response (200) - **df** (string) - Downlink Format - **icao24** (string) - Aircraft ICAO address - **bds** (string) - Comm-B Data Selector - **data** (object) - Decoded message fields #### Response Example { "df": "17", "icao24": "484175", "bds": "06", "data": { "groundspeed": 17.0, "track": 92.8125 } } ``` -------------------------------- ### Configure Beast Format Network Sources Source: https://github.com/xoolive/rs1090/blob/master/docs/config.md TOML configurations for connecting to external ADS-B data sources using the Beast format via TCP, UDP, or WebSocket. These snippets show how to specify the network address, port, and optional location metadata. ```toml [[sources]] name = "Toulouse" tcp = "123.45.67.89:10003" latitude = 43.5993189 longitude = 1.4362472 ``` ```toml [[sources]] websocket = "ws://123.45.67.89:8765/zurich" airport = "LSZH" ``` -------------------------------- ### Select Specific RTL-SDR Dongles by Serial Source: https://github.com/xoolive/rs1090/blob/master/docs/sources.md Command to run jet1090 and select specific RTL-SDR dongles based on their serial numbers. This allows targeting individual dongles connected to different antennas. ```sh jet1090 rtlsdr://serial=00000001 rtlsdr://serial=00000002 ``` -------------------------------- ### Run jet1090 Executable with Nix Source: https://github.com/xoolive/rs1090/blob/master/readme.md Runs the jet1090 executable directly using Nix. ```sh nix run ``` -------------------------------- ### Configure SoapySDR Devices in TOML Source: https://github.com/xoolive/rs1090/blob/master/docs/config.md Configure SoapySDR devices by specifying the driver and any necessary arguments. This includes options for RTL-SDR, HackRF, and PlutoSDR, along with custom gain and bias-tee settings. ```toml [[sources]] name = "soapy-rtlsdr" soapy = "driver=rtlsdr" airport = "LFBO" ``` ```toml [[sources]] name = "soapy-rtlsdr-with-lna" soapy = "driver=rtlsdr" gain = 42.5 bias_tee = true airport = "LFBO" ``` ```toml [[sources]] name = "soapy-hackrf" soapy = "driver=hackrf" latitude = 51.4706 longitude = -0.4619 ``` ```toml [[sources]] name = "soapy-pluto" soapy = "driver=plutosdr" airport = "LFBO" ``` -------------------------------- ### Live ADS-B Decoding via jet1090 CLI Source: https://context7.com/xoolive/rs1090/llms.txt Use the jet1090 command-line interface to decode live data from RTL-SDR dongles. Supports verbose JSON output, TUI interactive mode, and custom gain settings. ```bash jet1090 --verbose rtlsdr:// jet1090 --verbose rtlsdr://@EHAM jet1090 --interactive rtlsdr:// jet1090 --output ~/adsb_data.jsonl rtlsdr:// ``` -------------------------------- ### Configure Airspy Device Selection in TOML Source: https://github.com/xoolive/rs1090/blob/master/docs/config.md Configure Airspy devices by index or serial number. The sample rate can also be specified, which is crucial for optimal performance. ```toml [[sources]] name = "airspy-default" airspy = { device = 0 } sample_rate = 6.0e6 airport = "LFBO" ``` ```toml [[sources]] name = "airspy-by-serial" airspy = { serial = "0x35AC63DC2D8C7A4F" } sample_rate = 6.0e6 airport = "LFBO" ``` -------------------------------- ### View GitHub Issue Source: https://github.com/xoolive/rs1090/blob/master/agents.md Commands to view a specific GitHub issue and its comments. It's crucial to read all comments before planning any actions related to the issue. ```shell # Always read ALL comments before planning gh issue view 123 ``` ```shell gh issue view 123 --comments ``` -------------------------------- ### Systemd user service for websocat UDP to WebSocket redirection Source: https://github.com/xoolive/rs1090/blob/master/docs/sources.md A systemd user service template for `websocat` that redirects a specified UDP port (%i) to a WebSocket endpoint. This allows multiple independent redirection services to be managed. ```service [Unit] Description=Redirect UDP %i streaming to WebSocket [Service] Type=simple ExecStart=/home/user/.local/bin/websocat -b -u udp-l:0.0.0.0:%i ws://0.0.0.0:9876/%i RestartSec=3 [Install] WantedBy=multi-user.target ``` -------------------------------- ### decode1090 Command-Line Tool Source: https://github.com/xoolive/rs1090/blob/master/readme.md Information on obtaining and using the `decode1090` command-line executable. ```APIDOC ## decode1090 Prebuilt binaries are available on the [Releases page](https://github.com/xoolive/jet1090/releases?q=decode1090). Usage is available with the help command. ```sh decode1090 --help ``` ``` -------------------------------- ### Configure RTL-SDR Device Selection in TOML Source: https://github.com/xoolive/rs1090/blob/master/docs/config.md Configure RTL-SDR devices by index, serial number, or a combination of filters like manufacturer and product. This allows for precise device selection when multiple SDRs are connected. ```toml [[sources]] name = "rtl-sdr-first" rtlsdr = { device = 0 } airport = "LFBO" ``` ```toml [[sources]] name = "rtl-sdr-by-serial" rtlsdr = { serial = "00000001" } airport = "LFBO" ``` ```toml [[sources]] name = "rtl-sdr-filtered" rtlsdr = { serial = "00000001", manufacturer = "Realtek", product = "RTL2838UHIDIR" } airport = "EHAM" ``` -------------------------------- ### Decode ADS-B Messages with Python Source: https://context7.com/xoolive/rs1090/llms.txt Demonstrates how to decode individual ADS-B messages and extract flight parameters like altitude, position, and groundspeed using the rs1090 library. ```python import rs1090 messages = [ "8d4841753a9a153237aef0f275be", "8d4400eb58c7d45c48e257428292", "8d34768d58b524b5986843dfee26", ] for msg in messages: decoded = rs1090.decode(msg) print(f"Aircraft {decoded['icao24']}: BDS {decoded['bds']}") if 'latitude' in decoded: print(f" Position: {decoded['latitude']}, {decoded['longitude']}") ``` -------------------------------- ### Record IQ Files with rtl_sdr Source: https://github.com/xoolive/rs1090/blob/master/docs/config.md This bash command uses `rtl_sdr` to record 60 seconds of ADS-B data at 1090 MHz. The output file is in `cu8` format, which is directly compatible with `jet1090` for offline decoding. ```bash # Record 60 seconds at 1090 MHz with 2.4 MS/s sample rate rtl_sdr -f 1090M -s 2.4M -g 49.6 -n 288000000 adsb.iq ``` -------------------------------- ### Configure RTL-SDR Source in TOML Source: https://github.com/xoolive/rs1090/blob/master/changelog.md Defines the configuration structure for an RTL-SDR source, including device identification, gain settings, and bias-tee activation. ```toml [[sources.rtlsdr]] device_id = 0 gain = 49.6 bias_tee = true ``` -------------------------------- ### Create GitHub Pull Request Source: https://github.com/xoolive/rs1090/blob/master/agents.md Command to create a new GitHub pull request. It requires explicit user acknowledgement and can optionally link to a specific issue using the 'Fixes #issue-number' format in the body. ```shell # Never open PR without user acknowledgement gh pr create --title "Title" --body "Description" ``` ```shell # Link to issue gh pr create --title "Fix altitude bug" --body "Fixes #123" ```