Standalone ADS-B / Mode S demodulator in Zig with an optional web map (Leaflet + /aircraft.json) and dump1090-style TCP feeds. RTL-SDR IQ uses librtlsdr with a small ring buffer.
License: MIT.
-
Zig: 0.15.0 or newer.
-
RTL-SDR drivers and librtlsdr dev package:
-
Linux (Debian/Ubuntu):
sudo apt-get update sudo apt-get install -y librtlsdr-dev libusb-1.0-0-dev
-
macOS (Homebrew):
brew update brew install librtlsdr
-
Windows (example: vcpkg):
git clone https://github.com/microsoft/vcpkg.git .\vcpkg\bootstrap-vcpkg.bat .\vcpkg\vcpkg install rtlsdr:x64-windows
Point Zig at the installed include/lib paths if needed (e.g.
INCLUDE/LIBon Windows).
-
cd zig1090
zig buildDefaults: center 1090e6 Hz, sample rate 2.0e6 Hz. Optional positionals override center and rate.
zig build runzig build run -- --lat 39.528 --lon -119.815zig build run -- --http 8080 --lat 39.528 --lon -119.815Open http://127.0.0.1:8080/.
Default listen ports match FlightAware dump1090 (applyNetDefaults):
| Port | Role |
|---|---|
| 30002 | Raw: *<hex>;\n |
| 30003 | BaseStation (SBS) |
| 30005 | Beast cooked binary |
zig build run -- --net --lat 39.528 --lon -119.815--net-bind-address <ip>— default0.0.0.0.--net-ro-port,--net-sbs-port,--net-bo-port— overrides (any of these enables--net).--net-heartbeat <seconds>— keepalives (default60,0= off).
Beast cooked skips 2-bit CRC–repaired frames. Raw input (30001), Beast input (30004), and Stratux output are not implemented yet.
- ZigRadio —
src/rtl_iq.zigfollows its RTL-SDR IQ scaling and device setup (upstream: Ivan A. Sergeev). - ICAO ADS-B / Mode S — CPR math in
src/adsb/cpr_decode.zigfollows the published standard. - dump1090 / readsb — de-facto Mode S message layout and CRC behavior for interoperability.
- Maps — OpenStreetMap & CARTO tiles; Leaflet.
- This codebase is an independent Zig implementation of publicly documented ADS-B / Mode S behavior (ICAO Annex 10 and DO-260 family conventions).
- References to dump1090/readsb are interoperability notes and naming comparisons, not copied source.
- See
THIRD_PARTY_NOTICES.mdfor third-party attribution and bundled-asset licensing notes.
- ADS-B on 1090 MHz is public signaling; “decoding” here means parsing the ME field.
- Sample rates from ~
1.8e6Hz work for Manchester timing;2.0e6,2.4e6,4.0e6are common RTL-SDR choices.