Commit Graph

1485 Commits

Author SHA1 Message Date
James Smith
03f639b79f Update README with new features and UI improvements
- ADS-B: full-screen dashboard, trails, range rings, filtering,
  clustering, reception stats, observer location, audio alerts
- Satellite: full-screen dashboard, polar plot, ground track map,
  telemetry panel, improved pass prediction workflow
- UI: mode-specific header stats, UTC clock, active mode indicator,
  panel styling with indicator dots, consistent design

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 23:16:53 +00:00
James Smith
9742c269cb Fix Show Radar Display checkbox not working in Aircraft tab
Added toggleAircraftRadar() function and onchange handler to the
checkbox. Also updated switchMode() to respect the checkbox state
when switching to aircraft mode.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 23:14:33 +00:00
James Smith
ddbed245e1 Fix Ctrl+C not stopping application gracefully
The signal handler was intercepting SIGINT but not exiting, causing
the application to continue running. Now re-raises KeyboardInterrupt
so Flask can handle shutdown properly.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 22:55:04 +00:00
James Smith
0547086e4c Apply consistent UI patterns across all dashboards
- Satellite dashboard: Add header stat badges, bottom controls bar,
  streamlined sidebar with countdown/telemetry/pass list panels
- Main dashboard: Add UTC clock, mode-specific header stats with
  real-time syncing, active mode indicator with pulse animation
- Controls bar: Reorganize into logical groups (Mode, Export),
  gradient background, styled status indicator
- Panel styling: Gradient backgrounds, indicator dots on headers,
  Orbitron font for titles, rounded corners throughout

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 22:53:34 +00:00
James Smith
11c65448f5 Add aircraft trails, radar scope, and UI overhaul to ADS-B dashboard
- Aircraft Trails: altitude-based color gradient with fading opacity
- Virtual Radar Scope (PPI): canvas-based with sweep animation, range rings, compass rose
- UI Overhaul: controls bar at bottom, compact stats in header, MAP/RADAR view toggle
- Range selector syncs with both map rings and radar scope
- Click-to-select aircraft works in both map and radar views

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 21:14:40 +00:00
James Smith
5c895144bc Fix ADS-B start error: convert gain to string for subprocess
The validation now returns an integer, but subprocess command
arguments must be strings.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 19:31:30 +00:00
James Smith
1398a5dedd Major security and code quality improvements
Security:
- Add input validation for all API endpoints (frequency, lat/lon, device, gain, ppm)
- Add HTML escaping utility to prevent XSS attacks
- Add path traversal protection for log file configuration
- Add proper HTTP status codes for error responses (400, 409, 503)

Performance:
- Reduce SSE keepalive overhead (30s interval instead of 1s)
- Add centralized SSE stream utility with optimized keepalive
- Add DataStore class for thread-safe data with automatic cleanup

New Features:
- Add data export endpoints (/export/aircraft, /export/wifi, /export/bluetooth)
- Support for both JSON and CSV export formats
- Add process cleanup on application exit (atexit handlers)
- Label Iridium module as demo mode with clear warnings

Code Quality:
- Create utils/validation.py for centralized input validation
- Create utils/sse.py for SSE stream utilities
- Create utils/cleanup.py for memory management
- Add safe_terminate() and register_process() for process management
- Improve error handling with proper logging throughout routes

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 19:24:40 +00:00
James Smith
b44546af53 Add manual location input for non-HTTPS environments
GPS geolocation only works on HTTPS or localhost. Added manual lat/lon
input fields so users can enter their coordinates directly when
accessing the app over HTTP on a local network.

- Added latitude/longitude input fields to both ADS-B tab and dashboard
- GPS button now checks for secure context before attempting geolocation
- Shows helpful error message directing users to use manual input
- Input fields update observer location and redraw range rings on change

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 19:01:37 +00:00
James Smith
2736c0c107 Add ADS-B range rings, statistics, geolocation, and reception stats
New features for both ADS-B tab and dashboard:

1. Range Rings - Concentric circles at 25, 50, 100, 150, 200nm showing
   distance from observer location with dashed styling and labels

2. Statistics Panel - Tracks:
   - Max range achieved (with aircraft that achieved it)
   - Total unique aircraft seen this session
   - Messages per second rate
   - Busiest hour of tracking

3. Geolocation Button - Gets user's actual GPS location to:
   - Center the map on their position
   - Calculate accurate distances for range statistics
   - Position range rings correctly

4. Reception Statistics - Real-time msg/sec counter to monitor
   receiver performance

All features work on both the ADS-B tab and full-screen dashboard.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 18:58:10 +00:00
James Smith
bde977c73d Fix overly broad military ICAO ranges causing false positives
The UK range 0x400000-0x43FFFF was the entire UK allocation, not just
military - this incorrectly flagged civilian airlines like EasyJet
(EZY callsign) as military aircraft.

Fixed ranges:
- Removed broad UK range, kept only RAF sub-range 0x43C000-0x43CFFF
- Narrowed France range to actual military 0x3F4000-0x3F7FFF
- Fixed Germany to correct Luftwaffe range 0x3D0000-0x3DFFFF
- Fixed typo in US range (0xADFFFFF -> 0xADFFFF)

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 18:34:30 +00:00
James Smith
4cf2fa9fe5 Fix duplicate audioContext declaration breaking disclaimer popup
Renamed ADS-B audio context to avoid conflict with existing audio
system. The duplicate 'let audioContext' declaration was causing
a JavaScript syntax error that prevented the rest of the script
from loading, including the acceptDisclaimer function.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 18:19:40 +00:00
James Smith
d1b10d55bd Add audio alerts for military aircraft and emergency squawk codes
Features:
- Audio alert plays when military aircraft or emergency squawk code
  (7500/7600/7700) is first detected
- Different tones: two-tone urgent alert for emergencies, single tone
  for military aircraft
- Visual banner notification appears at top of screen for 5 seconds
- Toggle checkbox to enable/disable audio alerts
- Alerts only trigger once per aircraft to avoid spam
- Implemented on both ADS-B tab and full-screen dashboard

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 17:31:15 +00:00
James Smith
fb7a3860ea Fix ADS-B tracking state not reset on kill all processes
The /killall endpoint was not resetting the ADS-B tracking state:
- Added dump1090 to the list of processes to kill
- Reset adsb_process to None
- Reset adsb_using_service flag to False

This fixes the "ADS-B tracking already active" error after using
kill all processes and trying to start tracking again.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 17:09:31 +00:00
James Smith
b1ced5daf7 Fix orbit track splitting to only occur at true antimeridian crossings
The previous logic split the track whenever longitude jumped by more
than 180°, which could happen in cases other than actual antimeridian
crossings, causing gaps in the middle of the orbit track.

New logic only splits when one longitude is > 90° and the other is
< -90°, which specifically identifies crossings of the ±180° line.

Also changed segment minimum from 2 to 1 point to preserve all data.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 15:59:48 +00:00
James Smith
0966b6aeca Fix satellite dashboard: preserve visible pass line and improve styling
- Keep trackLine (visible pass trajectory) when drawing orbit track
- Make visible pass line solid (weight 4, full opacity) vs orbit track
  (dashed, weight 2, 60% opacity) for clear visual distinction
- Only fit bounds on initial pass selection, not periodic updates
- Prevents map from re-zooming every 5 seconds

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 15:55:33 +00:00
James Smith
58f3acb484 Fix satellite dashboard orbit track visibility
The orbit track was being added correctly but wasn't visible because
the map was zoomed to the pass ground track (a small arc). Now the map
fits bounds to include the full orbit track plus observer location
after adding the orbit layer.

Also removed debug console.log statements.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 15:50:43 +00:00
James Smith
5990119db3 Add more debug logging to track orbit rendering
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 15:45:07 +00:00
James Smith
ac7e3e15f3 Add debug logging to satellite dashboard
Temporary logging to diagnose why dashboard isn't showing satellite
position and orbit track like the tab does.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 15:40:44 +00:00
James Smith
1e58812f50 Fix dashboard satellite change timing issue
- Remove duplicate updateRealTimePositions() call from onSatelliteChange()
  since calculatePasses() already calls selectPass() which triggers it
- Clear passes and selectedPass when changing satellites to prevent
  using stale data
- Clear map layers when changing satellites

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 15:37:04 +00:00
James Smith
43ff1a8b74 Fix satellite marker disappearing when changing passes
When removing map layers, set references to null so new markers get
created properly on position updates. Also clear orbit track lines
when changing passes.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 15:35:49 +00:00
James Smith
fc5a4b1b6b Fix groundTrackLine.getBounds error in satellite tab
Same fix as dashboard: LayerGroup doesn't have getBounds(), so collect
all coordinates and create bounds manually using L.latLngBounds().

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 15:31:41 +00:00
James Smith
13be9c189e Fix satellite tab to redraw polar plot with trajectory on position update
The polar plot now redraws the pass trajectory before overlaying the
current position indicator, matching the dashboard behavior.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 15:28:37 +00:00
James Smith
ebe0bf9431 Fix orbit track to use selected pass's satellite, not dropdown
Bug: Both files were fetching orbit data for the dropdown-selected
satellite instead of the satellite from the selected pass.

Fixes:
- satellite_dashboard.html: updateRealTimePositions() now uses
  passes[selectedPass].satellite instead of selectedSatellite
- index.html: updateRealTimePosition() now ensures the selected
  pass's satellite is included in the position request, and added
  includeTrack: true to get orbit data

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 15:26:23 +00:00
James Smith
0f6f642fd9 Fix satellite dashboard to fetch full orbit immediately on pass select
Added updateRealTimePositions() call to selectPass() so the full orbit
track is fetched immediately when a pass is selected, not just on the
5-second interval.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 15:22:22 +00:00
James Smith
f1e55fc44c Fix trackLine.getBounds error in satellite dashboard
LayerGroup doesn't have getBounds() like polyline does. Collect all
coordinates and create bounds manually using L.latLngBounds().

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 15:18:10 +00:00
James Smith
22791b6c3b Fix satellite ground track to show full orbit
- Fix property name mismatch: backend returns 'track' but index.html
  expected 'orbitTrack'
- Start position updates when a pass is selected (was never called)
- Fetch position immediately on pass selection for instant orbit display
- Dashboard: always show full orbit track, not just when no pass selected

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 15:16:36 +00:00
James Smith
0cf9360fce Fix satellite tracker polar plot and ground track issues
- Fix polar plot trajectory not displaying: backend returns 'el'/'az'
  properties but code expected 'elevation'/'azimuth'. Updated both
  drawPolarPlot() and drawPolarPlotPopout() to handle both formats.
- Fix ground track lines crossing entire map: added antimeridian
  crossing detection to split orbit tracks into segments, preventing
  lines from drawing across the map when crossing 180° longitude.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 15:10:13 +00:00
James Smith
7c215cf08c Add aircraft filtering and fix icon rotation
- Add aircraft filter dropdown (All/Military/Civil/Emergency) to both
  main dashboard and full-screen ADS-B dashboard
- Military detection uses ICAO hex ranges and callsign prefixes
- Military aircraft display olive drab markers and MIL badges
- Fix aircraft icon rotation in adsb_dashboard.html by replacing
  emoji (✈) with SVG icon - emoji had inconsistent orientation
  across platforms causing incorrect heading display

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-30 14:55:16 +00:00
James Smith
31b70140d6 Fix ground track map to fill its container
Use flexbox to make map expand to fill available space in container
2025-12-29 22:21:57 +00:00
James Smith
7309cf0565 Revert "Improve satellite tab layout for better screen space usage"
This reverts commit 170f5dac36.
2025-12-29 22:21:04 +00:00
James Smith
170f5dac36 Improve satellite tab layout for better screen space usage
- Make polar plot and ground track map taller (350px min)
- Combine countdown and pass list into full-width bottom section
- Side-by-side layout: compact countdown left, scrollable pass list right
- Responsive: stacks vertically on narrow screens
- Increase ground track map height to 280px
2025-12-29 22:18:57 +00:00
James Smith
61543b8b34 Fix JavaScript errors: variable hoisting and renamed function
- Move isWifiRunning and isBtRunning declarations to top of script
  to fix 'Cannot access before initialization' errors
- Update handleWifiNetwork hook to use renamed handleWifiNetworkImmediate
- Remove duplicate variable declarations
2025-12-29 22:13:43 +00:00
James Smith
ec988dd35b Fix ground track line crossing antimeridian
Split pass ground track at 180° longitude crossings to prevent
lines being drawn across the entire map.
2025-12-29 22:09:59 +00:00
James Smith
3e09140b0a Fix satellite pass track being overwritten and improve pass list
- Preserve selected pass ground track when updateRealTimePositions runs
- Only show real-time orbit track when no pass is selected
- Draw pass trajectory on polar plot with current position overlay
- Add drawCurrentPositionOnPolar helper for position marker
- Increase pass list height (250px → 400px max) to show more passes
- Add pass count to header (e.g., "UPCOMING PASSES (7)")
- Make pass items slightly more compact
2025-12-29 22:06:02 +00:00
James Smith
32a4c096b2 Add CLI arguments and streamline documentation
- Add argparse with -p/--port, -H/--host, -d/--debug options
- Add --check-deps flag to verify tool availability
- Make host and port configurable via command line
- Consolidate README with Quick Start section
- Simplify installation into side-by-side table format
- Add Configuration section for environment variables
- Remove verbose API Endpoints and Stats Bar sections

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 21:56:59 +00:00
James Smith
f7a08f890d Fix browser freeze in WiFi/Bluetooth modes and add dashboard links
- Add requestAnimationFrame batching to WiFi SSE handler to prevent
  freeze with many access points
- Add requestAnimationFrame batching to Bluetooth SSE handler to
  prevent freeze with many devices
- Move channel graph updates to batched frame instead of per-network
- Throttle probe analysis updates to every 2 seconds
- Optimize aircraft tracking in main page with marker state caching,
  150 marker limit, and throttled auto-fit bounds
- Add "Full Screen Dashboard" links to aircraft and satellite modes
- Add "Main Dashboard" links to ADSB and satellite dashboards

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-29 21:55:48 +00:00
James Smith
ef66929848 Fix browser freeze with many aircraft by batching UI updates
Use requestAnimationFrame to throttle expensive rendering operations.
Previously every SSE message triggered full UI re-renders causing
browser unresponsiveness with 50+ aircraft.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-25 08:47:16 +00:00
James Smith
3ee9f5e749 Fix duplicate aircraft cards in console output
Now updates existing cards instead of creating duplicates when
receiving updates for the same ICAO.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 12:52:23 +00:00
James Smith
f661efc9ae Fix altitude field name mismatch
Backend was sending 'alt' but frontend expected 'altitude'.
Standardized on 'altitude' throughout.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 12:51:34 +00:00
James Smith
c6f994938f Show full aircraft data in status endpoint
Helps debug what fields are being received from dump1090.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 12:42:08 +00:00
James Smith
d0b2a868c8 Add /adsb/status endpoint for debugging data flow
Tracks connection state, message counts, and aircraft data
to help diagnose why data might not be flowing.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 12:40:59 +00:00
James Smith
ee9a4fceef Fix status response to match frontend expectations
Frontend expects status='started' but backend was returning 'success'.
This caused the frontend to show "Error: ADS-B tracking started".

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 12:37:58 +00:00
James Smith
0c22564e31 Connect to existing dump1090 instead of failing
If dump1090 is already running (e.g., user started it manually),
detect it via port 30003 and connect instead of reporting an error.
Also cleans up stale process state before starting.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-24 12:35:31 +00:00
James Smith
bb7a9c53a2 Check common paths for dump1090 when not in PATH
Flask apps may run with a restricted PATH that doesn't include
/usr/local/bin. Now explicitly checks common installation locations.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 22:57:15 +00:00
James Smith
8c31e7f9d0 Add support for FlightAware dump1090-fa binary
Users building dump1090-fa from source (e.g., on Debian Trixie where
dump1090-mutability is unavailable) can now use it with ADS-B tracking.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 22:35:18 +00:00
James Smith
ddeff002c9 Refactor into modular structure with improvements
- Split monolithic intercept.py (15k lines) into modular structure:
  - routes/ - Flask blueprints for each feature
  - templates/ - Jinja2 HTML templates
  - data/ - OUI database, satellite TLEs, detection patterns
  - utils/ - dependencies, process management, logging
  - config.py - centralized configuration with env var support

- Add type hints to function signatures
- Replace bare except clauses with specific exceptions
- Add proper logging module (replaces print statements)
- Add environment variable support (INTERCEPT_* prefix)
- Add test suite with pytest
- Add Dockerfile for containerized deployment
- Add pyproject.toml with ruff/black/mypy config
- Add requirements-dev.txt for development dependencies

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 16:28:48 +00:00
Smittix
b0bc7e6e91 Update README.md 2025-12-22 18:09:57 +00:00
James Smith
6b915ed86e Remove accidental file 2025-12-22 18:00:44 +00:00
James Smith
583288fafc Fix polar plot trajectory to only show during active passes
The trajectory line now only appears when the satellite is currently
making the selected pass, fixing the confusing mismatch between the
predicted path and real-time position.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 18:00:20 +00:00
James Smith
d7db623fc4 Fix satellite orbit track crossing antimeridian
Split orbit track into segments when longitude jumps > 180° to prevent
Leaflet from drawing lines across the entire map at the antimeridian.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-22 17:33:33 +00:00