|
|
4 дні тому | |
|---|---|---|
| cmd/sdrd | 4 дні тому | |
| internal | 4 дні тому | |
| web | 4 дні тому | |
| .gitignore | 4 дні тому | |
| README.md | 4 дні тому | |
| config.yaml | 4 дні тому | |
| go.mod | 4 дні тому | |
| go.sum | 4 дні тому | |
Go-based SDRplay RSP1b live spectrum + waterfall visualizer with a minimal event recorder.
data/events.jsonl)/api/events?limit=...&since=...)# From repo root
go run ./cmd/sdrd --mock
Open http://localhost:8080.
This project uses the SDRplay API via cgo (sdrplay_api.h). Ensure the SDRplay API is installed.
$env:CGO_CFLAGS='-IC:\Program Files\SDRplay\API\inc'
$env:CGO_LDFLAGS='-LC:\Program Files\SDRplay\API\x64 -lsdrplay_api'
go build -tags sdrplay ./cmd/sdrd
.\sdrd.exe -config config.yaml
export CGO_CFLAGS='-I/opt/sdrplay_api/include'
export CGO_LDFLAGS='-L/opt/sdrplay_api/lib -lsdrplay_api'
go build -tags sdrplay ./cmd/sdrd
./cmd/sdrd/sdrd -config config.yaml
Edit config.yaml:
bands: list of band rangescenter_hz: center frequencysample_rate: sample ratefft_size: FFT sizegain_db: device gain (gain reduction)tuner_bw_khz: tuner bandwidth (200/300/600/1536/5000/6000/7000/8000)agc: enable automatic gain controldc_block: enable DC blocking filteriq_balance: enable basic IQ imbalance correctiondetector.threshold_db: power threshold in dBdetector.min_duration_ms, detector.hold_ms: debounce/mergeThe UI is served from web/ and connects to /ws for spectrum frames.
Use the right-side controls to adjust center frequency, span (zoom), sample rate, tuner bandwidth, FFT size, gain, AGC, DC block, IQ balance, and detector threshold. Preset buttons provide quick jumps to 40m/20m/17m.
GET /api/config: returns the current runtime configuration.POST /api/config: updates center_hz, sample_rate, fft_size, gain_db, and detector.threshold_db at runtime.POST /api/sdr/settings: updates agc, dc_block, and iq_balance at runtime./api/events reads from the JSONL event log and returns the most recent events:
limit (optional): max number of events (default 200, max 2000)since (optional): Unix milliseconds or RFC3339 timestampExample:
curl "http://localhost:8080/api/events?limit=100&since=1700000000000"
go test ./...
sdrplay support not built, rebuild with -tags sdrplay.CGO_CFLAGS and CGO_LDFLAGS point to the API headers and library.--mock to run without hardware.