8000 GitHub - blentz/quanshnoop · GitHub
[go: up one dir, main page]

Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

Quanshnoop

Web-based spectrum analyzer and control interface for Quansheng UV-K5(8) handheld radio.

Overview

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.

Features

  • 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

Hardware Requirements

  • Quansheng UV-K5(8) radio with quansheng-dock-fw v0.32.21q firmware
  • USB programming cable (CH340 chip, typically appears as /dev/ttyUSB0)

Quick Start

Using uv (recommended)

# Install dependencies
uv sync

# Run the web server
uv run quanshnoop serve development.ini

Using pip

# Install in development mode
pip install -e ".[dev]"

# Run the web server
quanshnoop serve development.ini

Using Docker/Podman

# Build container
podman build -t quanshnoop .

# Run with USB passthrough
podman run --device=/dev/ttyUSB0:/dev/ttyUSB0 -p 6543:6543 -p 5006:5006 quanshnoop

Access the web interface at http://localhost:6543

CLI Usage

Start Web Server

quanshnoop serve development.ini
quanshnoop serve development.ini --host 0.0.0.0 --port 8080
quanshnoop serve development.ini --no-bokeh  # Development mode without Bokeh

Headless Band Scan

quanshnoop scan
quanshnoop scan --threshold 15 --port /dev/ttyUSB1
quanshnoop scan --step 12500 --quiet

Development

Requirements

  • Python 3.11+
  • uv package manager (recommended)

Setup

# Clone repository
git clone <repository-url>
cd quanshnoop

# Install in development mode
uv sync

Testing

# 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"

Code Quality

# Format code
uv run black src/ tests/

# Lint
uv run ruff check src/ tests/

# Type checking
uv run mypy src/

Architecture

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)

Configuration

Edit development.ini to configure:

  • Serial port: /dev/ttyUSB0 at 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

Key Settings

[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

References

License

GNU Affero General Public License v3.0 - See LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0