Something went wrong. Try again.
A port of FlightAware's dump1090, a Mode S and ADS-B decoder for software defined radios, to Zig 0.16.
Something went wrong. Try again.
4.3 kB 122 lines
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123// SPDX-FileCopyrightText: © 2026 Jeffrey C. Ollie <jeff@ocjtech.us>// SPDX-License-Identifier: GPL-2.0-or-later
// An example configuration for zig-dump1090.//// Every setting is optional: what is left out keeps the program's default,// so a real configuration is usually much shorter than this. Pass it with// `dump1090 --config /etc/dump1090.zon`; anything given on the command line// overrides what is written here..{ // Where the antenna is. Needed before a position can be resolved from a // single message, and used to sanity-check the ones that are. .receiver = .{ .lat = 41.5868, .lon = -93.6250, // The furthest an aircraft can plausibly be, in nautical miles. .max_range_nm = 300, },
.sdr = .{ .device = .rtlsdr, // .serial = "00000001",
// .max is the highest fixed gain, .tuner_agc hands control to the // tuner, or name one: .{ .db = 25.4 } .gain = .max, .frequency = 1090000000, .ppm = 0,
// Let the receiver find its own gain. Worth having where the noise // floor moves, or where the maximum gain overloads the front end. .adaptive = .{ .range = true, .range_target_db = 30,
// The controllers' tuning has sensible defaults; these are here // so a difficult site can be adjusted without a rebuild. // .range_percentile = 40, // .range_change_delay_s = 10, // .burst_loud_rate = 5.0, }, },
.decode = .{ // .none, .one or .two bit errors corrected. .fix = .one, .modeac = false, },
// Ports to listen on. A port left out is not listened on at all. .outputs = .{ .beast = 30005, .raw = 30002, .sbs = 30003, // .stratux = 30006, // .fatsv = 30007,
// Listen only on the loopback interface unless something remote // genuinely needs to reach these. .bind = "127.0.0.1", },
// Ports to accept frames from other receivers on. .inputs = .{ .beast = 30004, .raw = 30001, },
// Feeds to push to, rather than wait to be asked. Take the host, port // and protocol from the aggregator's own instructions. .connectors = .{ // .{ // .host = "feed.example.org", // .port = 30004, // .protocol = .beast_reduce_plus_out, // .uuid = "00000000-0000-0000-0000-000000000000", // }, },
// Feed FlightAware directly, without PiAware. // // PiAware is a small protocol client wrapped in a machine manager: it // runs a decoder as a child process, restarts services, rewrites network // configuration, reboots, and accepts commands from FlightAware to // update software on this machine. This speaks the same uplink and does // none of that. // // .flightaware = .{ // // Required, and there is no sensible default to invent. It is // // not what identifies a site, though: that is the feeder id // // below. Two logins from one MAC with no id were given two. // .mac = "00:11:22:33:44:55", // // // Where to keep the identifier FlightAware issues, written as // // soon as it arrives and offered at the next login. // // // // Not optional in practice. The login says where the identifier // // is kept as well as what it is, and FlightAware refuses to // // create a site for a client that has nowhere to keep one -- // // "requires a newer PiAware client that supports feeder IDs". // // A directory the receiver's own user can write, and one that // // survives a reboot: losing this file does not mean "log in // // again", it means "make me another site". // .feeder_id_file = "/var/lib/dump1090/feeder_id", // },
// The files a map polls. .json = .{ // .dir = "/run/dump1090", .interval_s = 1, .stats_interval_s = 60, // How precisely to publish the receiver's own position: // .none, .approximate or .exact .location_accuracy = .approximate, },
.stats = .{ .at_exit = false, // .every_s = 3600, .range_histogram = false, },}