Files
trx-rs/trx-rs.toml.example
T
sjgandClaude Opus 5 dbab4c5b99
CI / lint (pull_request) Successful in 2m23s
CI / test (pull_request) Successful in 9m35s
CI / frontend (pull_request) Successful in 4m34s
CI / reuse (pull_request) Successful in 6s
[feat](trx-rs): make spectrum affordable over a slow link
Spectrum dominates the server↔client connection, and all three things that
govern its cost were working against a poor link.

**It was polled, one round trip per frame.** The client asked for a frame every
50 ms on a dedicated connection and waited for the reply, so the frame rate was
capped at 1/RTT — on a 200 ms link, five frames a second no matter what was
configured.  Add SubscribeSpectrum alongside the existing SubscribeMeter: the
server pushes frames from a per-rig broadcast that rig_task fills only while
somebody is subscribed.  A server too old to know the command answers with an
error and leaves the connection usable, so the client falls back to polling on
the same connection without reconnecting.

**Bins were JSON floats.** 1024 bins spelled out as decimal text is around
10 KB a frame, ~200 KB/s at full rate — while the very next hop, client to
browser, already sends the same information as base64 i8 in about 1.4 KB.  Bins
now travel base64-encoded whole dBFS, the resolution the display draws at
anyway.  Decoding still accepts the old array form.

**Nothing was tunable.** [sdr].spectrum_fft_size and [sdr].spectrum_interval_ms
replace the compile-time FFT size and cadence; [[remotes]].spectrum_interval_ms
lets the client ask for less.  512 bins at 5 frames/s is roughly 3.5 KB/s
against roughly 200 KB/s before.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyX26FCpMQxiBoC7r5K1A7
Signed-off-by: Stan Grams <sjg@haxx.space>
2026-08-06 23:58:26 +02:00

145 lines
2.7 KiB
TOML

[trx-server]
rigs = []
[trx-server.general]
callsign = "N0CALL"
log_level = "info"
latitude = 52.2297
longitude = 21.0122
[trx-server.rig]
model = "ft817"
initial_freq_hz = 144300000
initial_mode = "USB"
[trx-server.rig.access]
type = "serial"
port = "/dev/ttyUSB0"
baud = 9600
[trx-server.behavior]
poll_interval_ms = 500
poll_interval_tx_ms = 100
max_retries = 3
retry_base_delay_ms = 100
[trx-server.listen]
enabled = true
listen = "127.0.0.1"
port = 4530
[trx-server.listen.auth]
tokens = []
[trx-server.audio]
enabled = true
listen = "127.0.0.1"
port = 4531
rx_enabled = true
tx_enabled = true
sample_rate = 48000
channels = 2
frame_duration_ms = 20
bitrate_bps = 256000
[trx-server.pskreporter]
enabled = false
host = "report.pskreporter.info"
port = 4739
[trx-server.aprsfi]
enabled = false
host = "rotate.aprs.net"
port = 14580
passcode = -1
[trx-server.decode_logs]
enabled = false
dir = "/path/to/log/dir"
aprs_file = "TRXRS-APRS-%YYYY%-%MM%-%DD%.log"
cw_file = "TRXRS-CW-%YYYY%-%MM%-%DD%.log"
ft8_file = "TRXRS-FT8-%YYYY%-%MM%-%DD%.log"
wspr_file = "TRXRS-WSPR-%YYYY%-%MM%-%DD%.log"
[trx-server.sdr]
sample_rate = 1920000
spectrum_fft_size = 1024
spectrum_interval_ms = 50
bandwidth = 1500000
wfm_deemphasis_us = 50
center_offset_hz = 100000
channels = []
max_virtual_channels = 4
[trx-server.sdr.gain]
mode = "auto"
value = 30.0
[trx-server.sdr.squelch]
enabled = false
threshold_db = -65.0
hysteresis_db = 3.0
tail_ms = 180
[trx-client.general]
callsign = "N0CALL"
website_url = "https://haxx.space"
website_name = "haxx.space"
ais_vessel_url_base = "https://www.vesselfinder.com/?mmsi="
log_level = "info"
[trx-client.remote]
url = "192.168.1.100:9000"
rig_id = "hf"
poll_interval_ms = 750
spectrum_interval_ms = 50
[trx-client.remote.auth]
token = "my-token"
[trx-client.frontends.http]
enabled = true
listen = "127.0.0.1"
port = 8080
default_rig_id = "hf"
initial_map_zoom = 10
spectrum_coverage_margin_hz = 50000
spectrum_usable_span_ratio = 0.9200000166893005
show_sdr_gain_control = true
[trx-client.frontends.http.auth]
enabled = false
rx_passphrase = "rx-passphrase-example"
control_passphrase = "control-passphrase-example"
tx_access_control_enabled = true
session_ttl_min = 480
cookie_secure = false
cookie_same_site = "Lax"
[trx-client.frontends.rigctl]
enabled = false
listen = "127.0.0.1"
port = 4532
[trx-client.frontends.rigctl.rig_ports]
[trx-client.frontends.http_json]
enabled = true
listen = "127.0.0.1"
port = 0
[trx-client.frontends.http_json.auth]
tokens = []
[trx-client.frontends.audio]
enabled = true
server_port = 4531
[trx-client.frontends.audio.rig_ports]
[trx-client.frontends.audio.bridge]
enabled = false
bitrate_bps = 192000
rx_gain = 1.0
tx_gain = 1.0