GopherTrunk: A Pure‑Go Cluster Radio Scanner Supporting All Major Protocols (P25, DMR, TETRA, NXDN)

GopherTrunk is an open‑source, pure‑Go cluster radio scanner that decodes control channels for ten major digital trunking protocols—including P25, DMR, TETRA, NXDN—and amateur modes, offering zero‑dependency binaries, cross‑platform support, multiple UI options, and advanced DSP pipelines for physical‑penetration testing and radio security research.

Black & White Path
Black & White Path
Black & White Path
GopherTrunk: A Pure‑Go Cluster Radio Scanner Supporting All Major Protocols (P25, DMR, TETRA, NXDN)
Overview A single pure‑Go scanner (~10 MB static binary, zero CGO) can capture IQ from an RTL‑SDR, decode control channels of ten digital trunked‑radio protocols plus D‑STAR and YSF, and synthesize voice without external libraries.

Cluster Radio Protocol Panorama

Digital trunked radio systems serve public‑safety, transportation, energy and government networks. Each protocol uses distinct modulation, air‑interface and voice codec.

Mainstream protocols

APCO Project 25 (P25 Phase 1/2) – North‑American public safety – IMBE/AMBE+2

Digital Mobile Radio (DMR Tier II/III) – Commercial, public safety, amateur – AMBE+2

Terrestrial Trunked Radio (TETRA TMO) – European public safety – ACELP

NXDN – Japan/Asia commercial – AMBE+2

Motorola Type II SmartZone – North‑American commercial/public safety – IMBE

EDACS / GE‑Marc – Traditional commercial trunking

Logic Trunked Radio (LTR) – Commercial trunking

MPT 1327 – Global commercial/government

dPMR Mode 3 – Commercial narrow‑band digital

D‑STAR – Amateur radio – AMBE

Yaesu System Fusion (YSF) – Amateur radio – C4FM

GopherTrunk decodes control channels for all ten listed protocols plus D‑STAR and YSF, making it one of the most protocol‑comprehensive open‑source scanners.

Protocol Decoding Deep Dive

2.1 P25 Phase 1 + Phase 2

RS(24,16,9) outer cyclic redundancy (TIA‑102.BAAA‑A §5.9)

PN44 LFSR scrambling (TIA‑102.BBAC‑1 §7.2.5) with blind detection across 12 timeslot offsets

Seed derivation from the WACN/SystemID/NAC triple

Super‑frame‑aware burst‑offset tracking

Processing runs in /scanner/ccdecoder using a per‑protocol FEC chain.

2.2 DMR Tier II + Tier III

Support for trunking (Tier III) and conventional repeaters (Tier II)

Full BPTC(196,96) + RS(12,9) CSBK CRC

Tier II pulse‑density calibration (class‑3 dibit 21.4 % vs Tier III 5.1 %) achieved by lowering ClockGain from 0.025 to 0.015 to keep the Mueller‑Müller clock PLL locked

2.3 TETRA TMO

Implements ETSI EN 300 392‑2 §8.3.1 link: descramble → deinterleave → depuncture → Viterbi decode → CRC‑16 check

Air‑interface error‑correction depth (Viterbi) requires real‑world sample validation

2.4 NXDN

ViterbiSpec mode – complete §4.5.1.1 link

Per‑system nxdn_deviation_hz knob (default 1800 Hz) resolves double‑peak dibit distribution when the transmitter deviates from spec

Pure‑Go Voice Path

Both IMBE (P25 Phase 1) and AMBE+2 (P25 Phase 2, DMR, NXDN) codecs are implemented entirely in Go, eliminating external DVSI hardware or the mbelib library.

Codec table

IMBE – Improved Multi‑Band Excitation – used for P25 Phase 1

AMBE+2 – Advanced Multi‑Band Excitation +2 – used for P25 Phase 2, DMR, NXDN

Each call produces a WAV file and a side‑car of raw frames while streaming PCM via ALSA, WASAPI or CoreAudio in real time, all without CGO.

DSP signal‑processing pipeline

Channelizer : Polyphase channelizer + CIC + Half‑band filter

FIR designer : Kaiser, RRC, Gaussian window functions

Demodulators : FM, C4FM, GFSK, FFSK, DQPSK, π/4‑DQPSK, π/8‑H‑DQPSK

Clock recovery : Mueller‑Müller and Gardner algorithms

Equalizer : LMS + CMA blind equalization

Diversity combining : Selection + maximal‑ratio combining

SDR Hardware Layer

RTL‑SDR driver

Linux – USBDEVFS

Windows – WinUSB (used with Zadig)

macOS – IOKit

Supports tuner chips R820T, R820T2, R828D, E4000, FC0012, FC0013, FC2580. The driver is a wire‑level Go port of osmocom librtlsdr, preserving initialization bursts, EPIPE hot‑reset, LNA + Mixer gain balancing, and the same rtlsdr_open detection order.

Multi‑device pool

Up to four RTL‑SDR sticks can be pooled, each with independent gain, PPM correction and bias‑tee settings. I²C bridge calls occur once per public method, reducing USB control traffic by roughly tenfold.

User Interfaces – Choose One

Terminal TUI (Bubbletea)

Active call list

Scanner status (control‑channel hunters, FM scanner)

System / site / talkgroup management

Inline editable settings with hot‑reload

Import panel supporting PDF/CSV uploads

Press f to enter manual VFO tuning and type a frequency in MHz

Browser Web Console

React/Tailwind single‑page app mirroring the TUI features: dashboard, active calls, history, systems, talkgroups, devices, events, tones, metrics, scanner, settings. Suitable for remote access on Raspberry Pi.

Headless daemon

Run with the -headless flag for long‑term monitoring. Exposed APIs:

gRPC AudioService : real‑time PCM stream with device‑serial and talkgroup filters

REST API : /api/v1/scanner, /api/v1/settings, /api/v1/import, …

Prometheus /metrics : built‑in monitoring

SQLite log : pure‑Go call log

Configuration Import

GopherTrunk parses RadioReference.com PDF exports and CSV bundles to generate a config.yaml configuration.

# Parse RadioReference PDF + CSV, preview interactively, then write config
./gophertrunk import-pdf -pdf system.pdf -csv talkgroups.csv

# CI/script mode – skip TUI, force write
./gophertrunk import-pdf -pdf system.pdf -no-tui -force

# Interactive configuration wizard
./gophertrunk -wizard

Import merges atomically (memory validation → temporary file → rename) so a failed parse never corrupts existing configuration.

Physical‑Security Research Perspective

Reconnaissance

Signal mapping: scan P25/DMR/TETRA to map cluster coverage of a target area

System fingerprinting: decode control channels to obtain SystemID, NAC, WACN and identify the operator

Talkgroup enumeration: extract all talkgroups from config files to infer organizational structure

Monitoring & Analysis

Live voice monitoring: IMBE/AMBE+2 audio output for real‑time listening

DTMF / alarm tone detection: built‑in Goertzel algorithm distinguishes sub‑audio tones

gRPC audio forwarding: stream live audio to remote analysis nodes

Testing & Validation

Signal‑strength monitoring: Prometheus metric gophertrunk_sdr_iq_power_dbfs shows idle ≈‑45 dBFS, normal signal ≈‑25 dBFS

Multi‑device spatial diversity: using multiple antennas and SDRs improves decoding success in urban environments

Limitations & Future Directions

Current shortcomings

NXDN interleaver/depuncture still under verification

TETRA air‑recovery tolerance needs real‑world sample calibration for Viterbi error depth

AMBE+2 patent notice displayed at startup; users must understand licensing

DVSI USB‑3000 / AMBE‑3003 hardware acceleration remains in development

Installation & Quick Start

# Download pre‑compiled release
VERSION=v0.1.7
curl -L -o gophertrunk.tar.gz \
  https://github.com/MattCheramie/GopherTrunk/releases/download/${VERSION}/gophertrunk-${VERSION}-linux-amd64.tar.gz
tar xzf gophertrunk.tar.gz && cd gophertrunk-${VERSION}-linux-amd64

# Copy example configuration
cp config.example.yaml config.yaml

# Verify installation
./gophertrunk version

# Start (auto‑selects TUI/Web/Headless)
./gophertrunk -config config.yaml

Hardware requirement: 1–4 RTL‑SDR USB sticks (recommended RTL‑SDR Blog V3) on a USB 3.0 port; supported on Linux, macOS, Windows and Raspberry Pi.

Project References

Website: gophertrunk.org

GitHub repository: github.com/MattCheramie/GopherTrunk

Download page: gophertrunk.org/downloads

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

GoOpen SourceDSPSDRdigital trunkingradio security
Black & White Path
Written by

Black & White Path

We are the beacon of the cyber world, a stepping stone on the road to security.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.