Commit Graph

411 Commits

Author SHA1 Message Date
Smittix
096763ad40 Reorganize TSCM menu with logical groupings
- Consolidate sweep config and scan sources into one section
- Group baseline recording and meeting window under "Advanced"
- Create 2x2 grid layout for tool buttons
- Use visual dividers instead of separate sections
- Keep all functionality and IDs intact

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 17:08:42 +00:00
Smittix
6354911c54 Revert TSCM menu changes - restore original layout
The simplified layout was causing display issues. Reverting to
the original working version.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 17:05:38 +00:00
Smittix
a8bb56a109 Fix TSCM menu - remove collapsible sections
Show all controls directly instead of hiding them in collapsed
sections which was causing confusion.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 17:03:47 +00:00
Smittix
5047fee431 Simplify TSCM menu for better UX
Redesign the sidebar to be more minimal with collapsible sections
for Settings and Advanced options. Primary sweep action is now
prominently displayed, with tool buttons condensed to compact icons.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 17:01:29 +00:00
Smittix
b63c7ab0fe Fix WiFi detection on modern macOS
The airport utility path doesn't exist on newer macOS versions.
Added fallback methods using networksetup and ifconfig to detect
WiFi availability.
2026-01-16 16:51:53 +00:00
Smittix
c0c86ef601 Fix type comparison errors in TSCM detector
Signal/RSSI values from WiFi scans can be strings. Added safe
int conversion with try/except to prevent type comparison errors.
2026-01-16 16:50:07 +00:00
Smittix
69c765d44a Change TSCM disclaimer text color to white 2026-01-16 16:44:31 +00:00
Smittix
617ba859fb Fix known devices API: send 'protocol' instead of 'device_type'
The endpoint expects 'protocol' field but JS was sending 'device_type'

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 16:42:48 +00:00
Smittix
62db171ed6 Fix capabilities display and add 'Add to Known Devices' button
- Fix tscmShowCapabilities to parse nested API response structure
- Build can/cannot detect lists dynamically from actual capabilities
- Display system info, limitations, and disclaimer
- Add 'Add to Known Devices' button in device detail modal
- New tscmAddToKnownDevices function with custom name prompt

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 16:31:19 +00:00
Smittix
66b2f59ca0 Fix playbooks endpoint to return array format
- Change /tscm/playbooks to return array instead of dict
- Add id, name, category fields to each playbook for JS compatibility
- Fix tscmViewPlaybook JS to use correct field names (action/details/safety_note)
- Display when_to_escalate and documentation_required sections

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 16:23:09 +00:00
Smittix
6dbf2fda01 Add TSCM advanced features UI
- Add meeting window controls (start/end tracked meetings)
- Add quick actions: capabilities, known devices, cases, playbooks
- Add export options for PDF and JSON/CSV reports
- Add JavaScript functions to connect UI to backend API endpoints
- Add CSS for capabilities grid, modal headers, playbook styles

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 16:20:47 +00:00
Smittix
234f254f4f Add comprehensive TSCM advanced features
Implement 9 major TSCM feature enhancements:

1. Capability & Coverage Reality Panel - Exposes what sweeps can/cannot
   detect based on OS, privileges, adapters, and SDR limits

2. Baseline Diff & Health - Shows changes vs baseline with health scoring
   (healthy/noisy/stale) based on age and device churn

3. Per-Device Timelines - Time-bucketed observations with RSSI stability,
   movement patterns, and meeting correlation

4. Whitelist/Known-Good Registry + Case Grouping - Global and per-location
   device registry with case management for sweeps/threats/notes

5. Meeting-Window Summary Enhancements - Tracks devices first seen during
   meetings with scoring modifiers

6. Client-Ready PDF Report + Technical Annex - Executive summary, findings
   by risk tier, JSON/CSV annex export

7. WiFi Advanced Indicators - Evil twin detection, probe request tracking,
   deauth burst detection (auto-disables without monitor mode)

8. Bluetooth Risk Explainability - Proximity estimates, tracker brand
   explanations, human-readable risk descriptions

9. Operator Playbooks - Procedural guidance by risk level with steps,
   safety notes, and documentation requirements

All features include mandatory disclaimers, preserve existing architecture,
and follow TSCM best practices (no packet capture, no surveillance claims).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 16:06:18 +00:00
Smittix
3210fc0d20 Move time, theme, deps, and help to nav bar
Relocate header utilities (UTC clock, theme toggle, dependencies
button, help button) to the navigation bar. Elements are grouped
logically with the clock on its own and tool buttons together,
all aligned to the far right of the nav bar.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 15:27:52 +00:00
Smittix
ac68e26c70 Use OpenStreetMap tiles for APRS map
Switch from CartoDB dark tiles to standard OpenStreetMap tiles
which show roads and more detail for tracking APRS stations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 14:49:02 +00:00
Smittix
ce0f581938 Add GPSD integration to APRS section
- Add GPS indicator to APRS function bar
- Add user location marker on APRS map (yellow dot)
- Calculate and display distance to APRS stations in miles
- Show distance in station list and marker popups
- Center map on GPS location when available
- Update distances dynamically as GPS position changes

Uses same gpsd auto-connect mechanism as ADS-B section.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 13:59:06 +00:00
Smittix
fc48ff7d9f Add comprehensive APRS packet parsing support
- Add Mic-E position decoding (destination field encoding)
- Add compressed position format parsing (Base-91)
- Add complete telemetry parsing with analog/digital values
- Add telemetry definition messages (PARM, UNIT, EQNS, BITS)
- Add message ACK/REJ parsing and sequence numbers
- Add weather data parsing in position packets
- Add PHG (Power/Height/Gain/Directivity) parsing
- Add Direction Finding (DF) report parsing
- Add timestamp extraction from position packets
- Add third-party traffic, NMEA, user-defined format parsing
- Add bulletin, NWS alert, query, and capabilities parsing
- Expand weather fields (luminosity, snow, radiation, etc.)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 13:50:32 +00:00
Smittix
af39d40847 Add APRS function bar similar to ADS-B stats strip
Move SDR configuration controls from sidebar to a horizontal function bar
above the map display for better visibility and accessibility. The bar
includes frequency/station/packet stats, region and gain controls, tool
status indicators, and start/stop buttons.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 12:55:19 +00:00
Smittix
fb23766ed3 Fix APRS object and item position decoding
Objects (;) and items ()) were identified but position data was never
extracted, causing them to appear without location on the map. Added
parse_object() and parse_item() functions to properly extract name,
status, and coordinates.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 12:39:15 +00:00
Smittix
bcb3147d1e Revert ISMS Listening Station implementation
Remove all ISMS (Intelligent Spectrum Monitoring Station) code including:
- GSM cell scanning with gr-gsm
- Spectrum monitoring via rtl_power
- OpenCelliD tower integration
- Baseline recording and comparison
- Setup script changes for gr-gsm/libosmocore

Reverts to pre-ISMS state (commit 4c1690d).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 12:24:16 +00:00
Smittix
940a43747b Use velichkov gr-gsm fork for GNU Radio 3.10+
The bkerler fork still uses SWIG. The velichkov fork has a
dedicated maint-3.10 branch with proper GNU Radio 3.10 support.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:56:48 +00:00
Smittix
16c74d10db Fix gr-gsm build for GNU Radio 3.10+
Use bkerler fork with pybind11 support for GNU Radio 3.10+ since
the original gr-gsm repo uses GrSwig which was removed in 3.10.

- Detect GNU Radio version and select appropriate fork
- Add pybind11-dev and python3-pybind11 to build dependencies
- Add python3-numpy to build dependencies
- Set CMAKE_PREFIX_PATH to find source-built libosmocore

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:55:23 +00:00
Smittix
a99c3e3894 Force remove broken RTL-SDR packages, skip stock rtl-sdr
Use dpkg --force-remove-reinstreq to remove broken packages.
Skip stock rtl-sdr package entirely - RTL-SDR Blog drivers are
better and will be built from source instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:49:44 +00:00
Smittix
e621647768 Fix broken packages before RTL-SDR installation
Run apt --fix-broken install and dpkg --configure -a to resolve
any lingering package conflicts before proceeding.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:49:21 +00:00
Smittix
5992156356 Fix RTL-SDR package conflicts in setup.sh
Remove conflicting librtlsdr packages before installing to avoid
dpkg errors when RTL-SDR Blog drivers conflict with stock packages.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:30:57 +00:00
Smittix
bed0c5fb8d Build libosmocore from source if packages unavailable
Ubuntu 24.04 and newer don't have Osmocom packages in repos.
This builds libosmocore from source as a fallback.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:27:28 +00:00
Smittix
0362a1b4ea Add Osmocom repository for libosmocore packages
libosmocore packages are not in standard Ubuntu repos.
This adds the Osmocom repository before installing gr-gsm deps.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:25:44 +00:00
Smittix
cf7c94f9d8 Improve gr-gsm installation error reporting in setup.sh
- Remove output suppression so errors are visible
- Add clearer error messages at each step
- Fix subshell isolation that was swallowing errors

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:24:21 +00:00
Smittix
c044ecfba2 Improve GSM scan error handling when gr-gsm not installed
- Return 503 instead of 500 when grgsm_scanner not found
- Show clearer error message in UI when gr-gsm unavailable
- Update status display to show "Not Available" state

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:21:57 +00:00
Smittix
23a79a7ac5 Fix recursive showNotification call in ISMS module
Renamed local notification helper to ismsNotify to avoid
infinite recursion with global showNotification from audio.js.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:17:51 +00:00
Smittix
795dd3f235 Add ISMS mode card to landing page menu
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:14:36 +00:00
Smittix
35d138175e Add ISMS Listening Station with GSM cell detection
- Add spectrum monitoring via rtl_power with configurable presets
- Add OpenCelliD tower integration with Leaflet map display
- Add grgsm_scanner integration for passive GSM cell detection (alpha)
- Add rules engine for anomaly detection and findings
- Add baseline recording and comparison system
- Add setup.sh support for gr-gsm installation on Debian/Ubuntu

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 11:12:09 +00:00
Smittix
4c1690dd28 Fix false emergency alerts and ACARS compatibility
- Fix emergency alerts triggering for non-emergency squawk codes (VFR 1200/7000, etc.)
  by checking squawkInfo.type === 'emergency' before alerting
- Fix emergency filter to only show actual emergency squawk codes
- Add acarsdec version detection to support both -j (newer) and -o 4 (older) JSON flags

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-16 08:57:21 +00:00
Smittix
407d5c1d25 Add 8.33 kHz step option to listening post scanner
Add European airband 8.33 kHz channel spacing to the step selector
in the main listening post interface.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 23:12:23 +00:00
Smittix
f46681fdbc Fix duplicate log messages and suppress SBS reconnection spam
- Add propagate=False to prevent child loggers from duplicating
  messages through parent handler
- Only log SBS connection errors once until successful reconnect

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 23:11:47 +00:00
Smittix
95e0309c63 Add configurable 8.33 kHz channel spacing for airband
When using custom frequency, a spacing selector appears allowing
choice between 25 kHz (standard) and 8.33 kHz (European) channel
spacing. The frequency step adjusts accordingly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 23:02:52 +00:00
Smittix
819944cccf Change airband squelch default to 0 in ADS-B dashboard
Set squelch slider default from 20 to 0 for more sensitive airband
reception out of the box.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 22:59:21 +00:00
Smittix
c595450310 Fix audio stream race condition with process reference
Capture local reference to audio_process at generator start to prevent
'NoneType' object has no attribute 'stdout' error when stop is called
concurrently from another request.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 22:29:15 +00:00
Smittix
4af61c8cb9 Add RTL-SDR Blog driver installation for V4 support
Build and install RTL-SDR Blog fork drivers during setup to provide
proper support for RTL-SDR Blog V4 devices (R828D tuner). These
drivers are backward compatible with V3 and other RTL-SDR devices.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 22:24:13 +00:00
Smittix
9f391527c2 Fix RTL-SDR device conflicts when running ADS-B and airband simultaneously
Problems fixed:
1. Added start_new_session=True to dump1090 Popen - creates proper process
   group for clean shutdown
2. Use os.killpg() to kill entire process group when stopping ADS-B -
   ensures child processes are terminated and device is released
3. Track active device index in adsb_active_device for debugging
4. Add device info to /adsb/status endpoint
5. Add logging when starting/stopping ADS-B with device info

These changes ensure the RTL-SDR device is properly released when ADS-B
stops, allowing another process (e.g., airband) to use a different device.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 22:13:30 +00:00
Smittix
cd168da760 Add graphical signal meter for APRS decoding
Backend changes (routes/aprs.py):
- Remove -q h flag from direwolf to enable audio level output
- Add parse_audio_level() to extract levels from direwolf output
- Add rate-limiting (max 10 updates/sec, min 2-level change)
- Push meter events to SSE queue as type='meter'

Frontend changes:
- Add signal meter widget to APRS sidebar
- Horizontal bar gauge with gradient (green->cyan->yellow->red)
- Numeric level display (0-100)
- "BURST" indicator for levels >70
- Status text (weak/moderate/strong signal)
- "No RF activity" state after 5 seconds of silence
- CSS styles in static/css/modes/aprs.css

Also added UK region to dropdown (same freq as Europe: 144.800)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 22:03:08 +00:00
Smittix
f4282cb608 Robust APRS decoder with deadlock fixes and spectrum scanning
Major improvements to APRS decoding reliability:

Process piping fixes (prevent deadlocks):
- rtl_fm stderr -> DEVNULL (was blocking on unbuffered stderr)
- decoder stderr -> STDOUT (merged, single stream to read)
- decoder uses text=True, bufsize=1 for line-buffered reading
- Proper EOF detection in stream thread

rtl_fm command improvements:
- Use -M nfm (narrowband FM) for APRS
- Add -E dc (DC blocking filter) for cleaner audio
- Add -A fast (fast AGC) for packet bursts
- Sample rate 22050 Hz matches direwolf -r 22050

Parsing robustness:
- Strip direwolf bracket prefixes like "[0.4] " before parsing
- Handle multimon-ng "AFSK1200:" prefix
- Better error handling for early process exit

New /aprs/spectrum endpoint:
- Runs rtl_power to scan around APRS frequency
- Returns peak detection, noise floor, signal analysis
- Provides advice for antenna/signal debugging
- Supports region selection and custom frequency

Also added UK to region list (same freq as Europe: 144.800 MHz)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 21:47:24 +00:00
Smittix
073134d6d3 Add direwolf config file for APRS decoding
Direwolf requires a config file to run. Create a minimal receive-only
config at startup that configures stdin input with AFSK1200 modem.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 21:10:27 +00:00
Smittix
4baefa61ac Fix direwolf not outputting decoded APRS packets
Changed -q d to -q h flag. The -q d option was suppressing APRS packet
descriptions (the decoded output we need), while -q h only suppresses
the audio level heard line.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 21:04:49 +00:00
Smittix
0d6d81fb69 Add direwolf installation to setup.sh
Adds direwolf (APRS decoder) installation for both Debian and macOS
platforms to support the APRS mode functionality.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 20:57:08 +00:00
Smittix
c96a3ade6b Fix APRS direwolf command flags
- Change direwolf flags from -D 1 to correct flags for stdin input
- Add -n 1 (mono), -b 16 (16-bit), -t 0 (no PTT), -q d (quiet)
- Add -M fm for explicit FM demodulation in rtl_fm
- Add explicit stdout output (-) to rtl_fm command

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 20:24:09 +00:00
Smittix
81c9dd84b2 Merge pull request #61 from nechry/patch-1 2026-01-15 19:02:41 +00:00
Smittix
fe67461f88 Add selectable ACARS frequencies
- Add checkboxes for each ACARS frequency in the selected region
- Users can now select one or multiple frequencies instead of all
- Frequencies stay checked when switching regions if they exist in both
- Falls back to all region frequencies if none selected

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 17:54:41 +00:00
Smittix
aae60e2037 Add real-time squelch control and clean up diagnostic logging
- Add updateAirbandSquelch() to restart audio when squelch slider changes
- Remove verbose diagnostic logging from audio streaming
- Remove tee diagnostic for raw rtl_fm output
- Keep error logging for troubleshooting
- Simplify audio stream generator

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 17:17:15 +00:00
Smittix
97d5ec6b33 Add DVB driver conflict detection and auto-fix feature
- Add /settings/rtlsdr/driver-status endpoint to check for loaded DVB modules
- Add /settings/rtlsdr/blacklist-drivers endpoint to unload modules and create blacklist
- Show warning banner on dashboard when DVB conflict detected
- Provide "Fix Now" button to automatically resolve the issue
- Warn users that their RTL-SDR devices may not work until drivers are blacklisted

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 17:06:18 +00:00
Smittix
459bf2d8cd Add explicit stdout output flag to rtl_fm command
- Add '-' flag to explicitly specify stdout output
- Some rtl_fm versions/devices require this explicitly

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-15 16:56:05 +00:00