Station file
One xng process can run the whole receiving site: several modes on several radios, sharing one feed, one set of outputs and one metrics endpoint.
xng station /etc/xng/station.toml
The installer and Airwaves OS write this file for you. To write it yourself:
station-id = "XX-KSEA"
# station-uuid = "…" # the station's UUID on Airframes; keeps its history when renamed
[outputs]
http = "0.0.0.0:8080" # live web dashboard
metrics = "0.0.0.0:9090" # Prometheus
jsonl = "/var/log/xng/messages.jsonl"
[outputs.airframes]
enabled = true
auto-suffix = true # XX-KSEA-ACARS, XX-KSEA-VDL2, XX-KSEA-AIS, ...
transport = "quic" # one connection for every feed (optional)
[[session]]
sdr = "driver=rtlsdr,serial=00000001"
gain = 40
mode = "acars"
sample-rate = 2400000
center = "130.500M"
channels = ["130.025", "130.425", "130.450", "131.125"]
[[session]]
sdr = "driver=rtlsdr,serial=00000002"
mode = "vdl2" # rate, center and channels from the mode's plan
[[session]]
sdr = "driver=rtlsdr,serial=00000003"
mode = "ais"
- A session without
sample-rate,centerorchannelstakes them from the mode's built-in plan: as many channels as fit the radio. receiver-pos = "47.62,-122.35"on a session (or at the top) gives the station's position, which ADS-B surface positions, ATC matching and the sonde station need.feed = falseon a session decodes it locally without feeding it;airframes-station-idgives one session its own ident.- Sessions can replay recordings:
file = "night.cf32"instead ofsdr =.
[outputs] feed-airframes = true on its own (the older form) feeds ACARS only, with the station id as written. Use the [outputs.airframes] block to feed every mode.
Several modes on one radio
Sessions that name the same sdr share it: xng opens the radio once, at a rate and center that hold every session's channels, and hands each decoder the same samples.
[[session]]
sdr = "driver=airspy"
mode = "acars"
channels = ["131.525", "131.725", "131.825"]
[[session]]
sdr = "driver=airspy" # the same radio: one 10 MS/s capture
mode = "vdl2" # plan channels that fit beside ACARS
- ACARS and VDL2 fit one Airspy R2 (10 MS/s holds 131.5 to 137 MHz).
- AIS and VDES, or ADS-L and Meshtastic in Europe, fit one RTL-SDR.
- Radiosondes scan whatever part of 400–406 MHz the capture holds, so they can share too.
- ADS-B and UAT use the whole capture and can't share.
An RTL-SDR is held to 2.4 MS/s, where it stops dropping samples. xng stops with a clear message when the sessions don't fit the radio. The sessions share one gain, and a session that can't keep up misses samples without holding the others back. The dashboard's radio panel (and /api/radios) shows each radio's dropped samples and each mode's CPU.
Run it as a service
xng ships a hardened systemd unit, contrib/xng-station.service. It runs xng as an xng user in the plugdev group (which can open the SDRs) and logs to /var/log/xng, so create those first:
curl -fsSLo xng-station.service https://raw.githubusercontent.com/airframesio/xng/master/contrib/xng-station.service
sudo useradd --system --no-create-home --groups plugdev xng
sudo install -d -o xng -g plugdev /var/log/xng
# The .deb installs /usr/bin/xng; the unit expects /usr/local/bin/xng
[ -x /usr/local/bin/xng ] || sed -i 's#/usr/local/bin/xng#/usr/bin/xng#' xng-station.service
sudo cp xng-station.service /etc/systemd/system/
sudo systemctl enable --now xng-station
xng status # live per-radio table from the running station
XX-KSEA up 3h12m 41 aircraft · 7 vessels
┌────────┬────────┬─────────┬─────────────────────┬───────────────────────────────────┐
│ SDR │ Serial │ Mode │ Tuning │ Status │
├────────┼────────┼─────────┼─────────────────────┼───────────────────────────────────┤
│ rtlsdr │ 001 │ ACARS │ 11 ch @ 130.940 MHz │ decoding · 4218 msgs · last now │
│ rtlsdr │ 002 │ VDL2 │ 4 ch @ 136.850 MHz │ decoding · 86 msgs · last 12s ago │
│ rtlsdr │ 003 │ AIS │ 2 ch @ 162.000 MHz │ decoding · 9304 msgs · last now │
└────────┴────────┴─────────┴─────────────────────┴───────────────────────────────────┘