Web-based spectrum analyzer and control interface for Quansheng UV-K5(8) handheld radio.
Quanshnoop is a Python application inspired by QuanshengDock that provides a graphical interface for operating a Quansheng UV-K5(8) radio connected via USB programming cable. It features real-time spectrum visualization, frequency scanning, channel memory management, and activity logging.
- Survey Mode: Systematic band scanning with signal detection and logging
- Monitor Mode: Real-time spectrum display with waterfall visualization
- Memories Panel: Read and manage radio channel memories
- Activity Logging: SQLite database for historical signal tracking
- Web Interface: Bokeh-powered visualization accessible via browser
- CLI Tools: Headless scanning and server management
- Quansheng UV-K5(8) radio with quansheng-dock-fw v0.32.21q firmware
- USB programming cable (CH340 chip, typically appears as
/dev/ttyUSB0)
# Install dependencies
uv sync
# Run the web server
uv run quanshnoop serve development.ini# Install in development mode
pip install -e ".[dev]"
# Run the web server
quanshnoop serve development.ini# Build container
podman build -t quanshnoop .
# Run with USB passthrough
podman run --device=/dev/ttyUSB0:/dev/ttyUSB0 -p 6543:6543 -p 5006:5006 quanshnoopAccess the web interface at http://localhost:6543
quanshnoop serve development.ini
quanshnoop serve development.ini --host 0.0.0.0 --port 8080
quanshnoop serve development.ini --no-bokeh # Development mode without Bokehquanshnoop scan
quanshnoop scan --threshold 15 --port /dev/ttyUSB1
quanshnoop scan --step 12500 --quiet- Python 3.11+
- uv package manager (recommended)
# Clone repository
git clone <repository-url>
cd quanshnoop
# Install in development mode
uv sync# Run all tests
uv run pytest
# Run with coverage (90% minimum required)
uv run pytest --cov=src/quanshnoop --cov-report=html
# Skip hardware integration tests
uv run pytest -m "not integration"# Format code
uv run black src/ tests/
# Lint
uv run ruff check src/ tests/
# Type checking
uv run mypy src/quanshnoop/
├── src/quanshnoop/
│ ├── radio/ # Serial communication with UV-K5
│ ├── analyzer/ # Spectrum scanning and signal detection
│ ├── models/ # SQLAlchemy database models
│ ├── views/ # Pyramid web views
│ ├── ui/ # Bokeh UI panels (Survey, Monitor, Memories)
│ ├── audio/ # Audio passthrough functionality
│ ├── static/ # CSS, JavaScript, images
│ ├── templates/ # Jinja2 HTML templates
│ ├── cli.py # Command-line interface
│ └── bokeh_server.py # Bokeh application server
└── tests/ # Test suite (90%+ coverage)
Edit development.ini to configure:
- Serial port:
/dev/ttyUSB0at 38400 baud (default) - Frequency range: 50-600 MHz (configurable per session)
- Signal detection: -90 dBm threshold, 1s minimum duration
- Database: SQLite at
./quanshnoop.db - Bokeh server: Port 5006 with WebSocket origin
localhost:6543
[app:main]
# Radio connection
radio.port = /dev/ttyUSB0
radio.baudrate = 38400
# Spectrum analyzer defaults
spectrum.min_frequency = 50000000
spectrum.max_frequency = 600000000
spectrum.step_size = 25000
# Activity detection
activity.min_signal_strength = -90
activity.min_duration = 1.0- QuanshengDock - Original Windows application
- quansheng-dock-fw - Required firmware
- k5prog - Flash programmer
- uv-k5-firmware-custom - Firmware base
GNU Affero General Public License v3.0 - See LICENSE file for details.