A powerful web-based spectrum analyzer for HackRF One with real-time visualization, advanced filtering, and signal analysis capabilities.
- High-Resolution Display: 8,192 data points for detailed spectrum visualization
- Full Frequency Range: Proper 88-108MHz FM band coverage (or custom ranges)
- Live WebSocket Streaming: Stable, crash-resistant data acquisition
- Interactive Tooltips: Hover for precise frequency and power readings
- dB Range Filtering: Highlight signals within specific power ranges when paused
- Visual Signal Highlighting: Red overlay for filtered signals with dimmed background
- Click-to-Analyze: Click any filtered point for detailed frequency/power information
- Real-Time Filter Feedback: Live count of filtered signals
- Spectrum Analyzer: Traditional line chart with Chart.js
- Waterfall Display: Time-based spectrum visualization
- Dark Theme UI: Professional interface optimized for long analysis sessions
- Gain Management: Separate LNA and VGA gain controls
- Frequency Range: Configurable start/stop frequencies
- Device Safety: Automatic device detection and crash prevention
- Resource Management: Clean shutdown and device release
- SDRStreamer: Dedicated threading architecture preventing HackRF crashes
- Queue Management: Optimized data flow with overflow protection
- Error Recovery: Automatic reconnection and device reset capabilities
- Cross-Platform: Windows (WSL2), macOS, and Linux support
- Python 3.8+ with SoapySDR support
- Node.js 16+ for React frontend
- HackRF One with proper drivers
- Web browser with WebSocket support
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install -y soapysdr-tools python3-soapysdr python3-venv hackrf
# macOS
brew install soapysdr hackrf
# Windows: Install SoapySDR and HackRF drivers from official sourcesAttach HackRF to WSL2:
# In PowerShell as Administrator
usbipd list # Find HackRF bus ID
usbipd bind --busid <BUS_ID> # One-time setup
usbipd attach --wsl --busid <BUS_ID> # Attach to WSL2Verify in WSL2:
hackrf_info # Should show device information# Clone and enter directory
git clone <repository-url>
cd hackrf_webui_windows
# Create Python environment with system packages
python3 -m venv venv --system-site-packages
source venv/bin/activate # Linux/macOS
# venv\Scripts\activate # Windows
# Install Python dependencies
pip install -r requirements.txt
# Setup frontend
cd frontend
npm install
cd ..# Option 1: Start both services
./run.py
# Option 2: Start manually
# Terminal 1 - Backend
python3 -m backend.main
# Terminal 2 - Frontend
cd frontend && npm startAccess at: http://localhost:3000
- Connect HackRF: Ensure device is recognized with
hackrf_info - Set Frequency Range: Configure start/stop frequencies (default: 88-108 MHz FM band)
- Adjust Gains: Set LNA (0-40dB) and VGA (0-62dB) for optimal reception
- Start Scanning: Click "Start" to begin real-time spectrum analysis
- Pause for Analysis: Click "Stop" to pause and enable filtering features
- Enable dB Filtering: Toggle the "Enable dB Filter" switch when paused
- Set Filter Range: Use sliders to define power range (e.g., -60dB to -40dB for strong signals)
- Analyze Signals: Red highlighted points show signals matching your criteria
- Click for Details: Click any red point to see exact frequency and power
- Export Data: Copy frequency/power values for documentation
- Spectrum View: Real-time line chart with filtering capabilities
- Waterfall View: Time-based heatmap showing signal activity over time
# Common frequency bands
FM_RADIO = (88e6, 108e6) # 88-108 MHz
AIRCRAFT = (118e6, 137e6) # 118-137 MHz
HAM_2M = (144e6, 148e6) # 144-148 MHz
WEATHER = (162e6, 163e6) # 162-163 MHz# In backend/main.py
SAMPLE_RATE = 20e6 # 20 MHz sample rate
BUFFER_SIZE = 256 * 1024 # 256KB buffer
QUEUE_SIZE = 20 # Internal queue size
DECIMATION = 4 # Data decimation factor# Check HackRF connection
hackrf_info
# Reset HackRF if frozen
hackrf_reset
# Check USB permissions (Linux)
sudo usermod -a -G plugdev $USER# Verify SoapySDR installation
python3 -c "import SoapySDR; print(SoapySDR.Device.enumerate())"
# Recreate environment if needed
rm -rf venv
python3 -m venv venv --system-site-packages
source venv/bin/activate
pip install -r requirements.txt| Error | Solution |
|---|---|
| "Device busy" | Run hackrf_reset or restart application |
| "No devices found" | Check USB connection and drivers |
| "SoapySDR not found" | Reinstall with --system-site-packages |
| "Queue overflow" | Normal during heavy processing, data still flows |
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β HackRF One ββββββ SDRStreamer ββββββ WebSocket β
β β β (Threading) β β (AsyncIO) β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β
ββββββββΌβββββββ
β Data Queue β
β Processing β
βββββββββββββββ
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β ControlPanel ββββββ App.tsx ββββββ SpectrumDisplay β
β β β (WebSocket) β β (Filtering) β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β
ββββββββΌβββββββ
β WaterfallDisplayβ
β β
βββββββββββββββ
POST /api/sweep/start- Start spectrum analysisPOST /api/sweep/stop- Stop spectrum analysisPOST /api/gains- Set LNA/VGA gainsGET /api/gains- Get current gain settings
ws://localhost:8000/ws/spectrum- Real-time spectrum data stream
// Spectrum Data
{
"type": "spectrum",
"frequencies": [88000000, 88001000, ...], // Hz
"magnitudes": [-45.2, -67.8, ...], // dB
"timestamp": 1623456789000, // ms
"center_freq": 98000000 // Hz
}- Signal Bookmarking: Save interesting frequencies with notes
- Peak Detection: Automatic identification of signal peaks
- Export Functionality: Save spectrum data as CSV/JSON
- Frequency Presets: Quick selection for common bands (FM, HAM, Aircraft)
- Signal Strength History: Time-based power level tracking
- Audio Demodulation: FM/AM/SSB demodulation with web audio
- Advanced Triggering: Start recording based on signal thresholds
- Spectrum Comparison: Overlay multiple spectrum captures
- Band Plan Integration: Show frequency allocations and band names
- Signal Classification: Automatic signal type detection (FM, digital, etc.)
- Machine Learning: AI-powered interference detection
- Record & Playback: Save/replay IQ data for analysis
- Collaborative Features: Share spectrum data between users
- Mobile Interface: Responsive design for tablets/phones
- Digital Signal Analysis: APRS, ADS-B, LoRa decoders
- Automated Monitoring: 24/7 spectrum monitoring with alerts
- Database Integration: Store long-term spectrum data
- Real-time Analytics: Statistical analysis of spectrum usage
- SDR Cloud: Connect to remote SDR servers worldwide
- Contest Logging: Integration with amateur radio logging software
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
# Install development dependencies
pip install black pylint pytest
npm install --dev
# Format code
black backend/
npm run format
# Run tests
pytest
npm testMIT License - see LICENSE file for details
- SoapySDR - Cross-platform SDR abstraction layer
- Chart.js - Powerful charting library
- React - User interface framework
- FastAPI - Modern Python web framework
- HackRF Community - Hardware and driver support
Built with β€οΈ for the SDR and amateur radio community
