Commit Graph

6 Commits

Author SHA1 Message Date
leetcrypt f7329df581 feat: benchmark suite + scoring calibration - iteration 4/5
Implements comprehensive benchmarking infrastructure and tunes scoring weights
based on empirical accuracy measurements.

New Components:
- tests/benchmark/test_data_generator.py: Synthetic signal generator for 12 protocols
- scripts/benchmark.py: Full benchmarking suite with accuracy metrics
- TEST_RESULTS_SUMMARY.md: Detailed benchmark results and per-protocol analysis

Benchmark Results:
- Total Tests: 12 synthetic signals across 10 protocols
- Top-1 Accuracy: 33.3% (4/12 correct)
- Top-3 Accuracy: 33.3%
- Confidence Distribution: 66.7% high (>80%), 25% medium (50-80%), 8.3% low (<50%)
- Avg Processing Time: 144.6ms per signal

Scoring Weight Tuning:
BEFORE: Timing(30%) + Frequency(25%) + BitCount(20%) + Preamble(15%) + Stats(10%)
AFTER:  Timing(35%) + Preamble(25%) + BitCount(20%) + Frequency(15%) + Stats(5%)

Rationale:
- Increased Preamble weight (15% → 25%): Highly discriminative for protocol identification
- Increased Timing weight (30% → 35%): Core identification feature
- Decreased Frequency weight (25% → 15%): Many protocols share same ISM band
- Decreased Stats weight (10% → 5%): Less discriminative in practice

Confidence Thresholds:
- High: >80% (reliable identification)
- Medium: 50-80% (possible match, needs verification)
- Low: <50% (uncertain, likely incorrect)

Protocol Performance:
✓ Excellent (100%): LaCrosse TX141-BV2, Oregon Scientific v2.1, Schrader TPMS
✗ Needs Improvement (0%): Acurite 609TXC, Princeton, PT2262, Nexus, Toyota TPMS

Key Findings:
- Preamble detection critical for discrimination (alternating patterns work well)
- Timing analysis robust to 15% noise
- 315 MHz protocols underrepresented in database
- Generic protocols difficult to distinguish without more specific signatures

Next Steps (Future Iterations):
- Expand 315 MHz protocol coverage
- Add protocol-specific heuristics for Princeton, PT2262
- Improve bit pattern matching for similar timing protocols

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-15 07:44:10 -08:00
leetcrypt f8042c3dca feat: preamble detection + frequency fingerprinting - iteration 3/5
Implements multi-factor scoring pipeline for improved RF device identification:
- Score = Timing(30%) + Frequency(25%) + BitCount(20%) + Preamble(15%) + Stats(10%)

New Components:
- src/matcher/preamble_detector.py: Detects 4 pattern types (long_burst, alternating, sync_word, custom)
- src/matcher/frequency_fingerprint.py: ISM band classification (315/433/868/915 MHz) for protocol filtering
- Integration: Updated pattern_decoder.py with multi-factor scoring

Features:
- Preamble detection with 4 methods (long burst, alternating, sync word, repetition)
- Frequency-based protocol filtering (reduces search space from 299 to ~20-30 candidates)
- Multi-factor confidence scoring combining timing, frequency, bit count, preamble, and statistics
- Sorted sync word matching (longest first to avoid substring matches)

Test Coverage:
- 15 new tests for preamble detection and frequency fingerprinting
- Total: 56 tests passing (41 existing + 15 new)

Results:
- Improved matching accuracy through multi-factor scoring
- Reduced protocol search space via frequency pre-filtering
- Better handling of noisy signals through preamble validation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-02-15 07:38:09 -08:00
leetcrypt af9942f822 feat: robust timing analyzer for RF device identification - iteration 2/5
- Implemented multi-method timing extraction (K-means, histogram, percentile)
- Added intelligent outlier removal with IQR method (2.5x threshold)
- Integrated timing analyzer into pattern_decoder.py
- Created comprehensive scoring system against protocol signatures
- Handles noisy/imperfect captures with tolerance windows

Components:
  - RobustTimingAnalyzer: Multi-strategy timing extraction
  - TimingCharacteristics: Extracted pulse/gap/ratio data
  - TimingScore: Similarity scoring with weighted components
  - TimingMatchStrategy: Integration with engine.py

Features:
  - Separates HIGH/LOW pulses before outlier removal (preserves alternating pattern)
  - Multi-method ensemble: tries K-means → histogram → percentile
  - Confidence scoring based on clustering quality
  - Timing ratios (short/long pulse ratios) for better matching
  - Duty cycle calculation
  - Configurable tolerance windows (default ±25%)

Test Coverage:
  - 15 new unit tests in tests/unit/test_timing_analyzer.py
  - All 41 tests passing (26 original + 15 new)
  - Coverage: clean signals, noisy signals, outliers, multi-level, scoring, real-world LaCrosse

Expected Impact:
  - Improved single-transmission accuracy (20% → 55% projected)
  - Better noise tolerance for Flipper Zero captures
  - More accurate protocol matching with 299 signatures
2026-02-14 19:06:13 -08:00
Trilltechnician 8560fb5002 feat: Complete RTL_433 integration (Phases 1-8)
Implemented full RTL_433 decoder integration for automatic IoT device identification:

## Phase 1-6: Core Implementation
- RTL_433 binary integration (v23.11, 244 protocols)
- Pulse data converter (RAW_Data → am.s16 format)
- Subprocess decoder wrapper with JSON parsing
- RTL433DecoderStrategy for matcher pipeline
- Comprehensive test suite (all tests passing)

## Phase 8: API Integration (this commit)
- GET /api/rtl433/status - Check decoder availability
- GET /api/rtl433/protocols - List 244 supported protocols
- GET /rtl433/protocols/{id} - Get protocol info
- POST /api/v1/captures/upload - Updated with RTL_433 decoding

## Files Added
- src/parser/rtl433_converter.py (~300 lines)
- src/matcher/rtl433_decoder.py (~400 lines)
- src/matcher/strategies.py (RTL433DecoderStrategy)
- docs/RTL433_INTEGRATION_PLAN.md
- docs/RTL433_IMPLEMENTATION_STATUS.md
- docs/RTL433_API_ENDPOINTS.md
- docs/PHASE8_COMPLETE.md
- tests/test_rtl433_integration.py
- tests/test_rtl433_api.sh

## Files Modified
- src/api/main_simple.py - Added RTL_433 decoding to upload
- src/api/routes/hardware.py - Added RTL_433 endpoints

## Performance
- Decode time: <0.05s per file
- 244 protocols supported
- 0.95 confidence for successful decodes

## Testing
- All integration tests passing
- All API endpoint tests passing
- ~3,600+ lines of code & documentation

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-14 17:59:43 -08:00
Trilltechnician 48fcb00241 Phase 3 Complete: Web Interface MVP
Major Achievements:
-  Full web interface (1,520+ lines of frontend code)
-  Interactive Leaflet.js map with marker clustering
-  Drag-and-drop upload system with GPS input
-  Search & filter UI with multi-criteria
-  Statistics dashboard with Chart.js
-  Responsive mobile-friendly design

Backend:
-  FastAPI static file serving
-  Simplified server mode (main_simple.py)
-  Improved startup script with port auto-selection
-  PostgreSQL schema ready (requires setup)

Database:
-  SQLite populated with 85 Flipper Zero signatures
-  Device matching system operational
-  Frequency-based search working

Documentation:
-  PHASE_3_COMPLETE.md - Technical summary
-  WEB_INTERFACE_README.md - User guide
-  WEBAPP_STARTUP_GUIDE.md - Troubleshooting
-  POSTGRESQL_SETUP_EXPLANATION.md - DB setup guide
-  DATABASE_POPULATION_SUCCESS.md - Import report
-  DEVICE_IDENTIFICATION_REPORT.md - Matching analysis

Files Created:
- templates/index.html (260 lines)
- static/css/main.css (500 lines)
- static/js/*.js (760 lines total)
- src/api/main_simple.py (simplified server)
- start_web.sh (auto port selection)

Status: Production MVP Ready
Next: Phase 4 - API & Integration

🛰️ Generated with Claude Code
https://claude.com/claude-code

Co-Authored-By: Claude <noreply@anthropic.com>
2026-01-12 18:21:11 -08:00
Trilltechnician 64ce279a2e Add comprehensive testing infrastructure
- Testing strategy document
- Unit tests for GPS validator
- Integration test conftest with fixtures
- Sample .sub files and manifests
- Comprehensive Termux testing guide
- Test directory structure
2026-01-12 11:25:13 -08:00