mirror of
https://github.com/smittix/intercept.git
synced 2026-06-13 00:03:33 -07:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8adfb3a40a | |||
| 9a9b1e9856 | |||
| 8aeb52380e | |||
| 05141b9a1b |
@@ -2,6 +2,34 @@
|
||||
|
||||
All notable changes to iNTERCEPT will be documented in this file.
|
||||
|
||||
## [2.26.10] - 2026-03-14
|
||||
|
||||
### Fixed
|
||||
- **APRS stop timeout and inverted SDR device status** — The APRS stop endpoint terminated two processes sequentially (up to 4s) while the frontend timed out at 2.2s, causing console errors and the SDR status panel to show stale state (active after stop, idle during use). Now releases the SDR device immediately and terminates processes in a background thread so the response returns instantly. (#194)
|
||||
|
||||
---
|
||||
|
||||
## [2.26.9] - 2026-03-14
|
||||
|
||||
### Fixed
|
||||
- **ADS-B bias-t support for RTL-SDR Blog V4** — When dump1090 lacks native `--enable-biast` support, the system now falls back to `rtl_biast` (from RTL-SDR Blog drivers) to enable bias-t power before starting dump1090. The Blog V4's built-in LNA requires bias-t to receive ADS-B signals. (#195)
|
||||
|
||||
---
|
||||
|
||||
## [2.26.8] - 2026-03-14
|
||||
|
||||
### Fixed
|
||||
- **acarsdec build failure on macOS** — `HOST_NAME_MAX` is Linux-specific (`<limits.h>`) and undefined on macOS, causing 3 compile errors in `acarsdec.c`. Now patched with `#define HOST_NAME_MAX 255` before building. Also fixed deprecated `-Ofast` flag warning on all macOS architectures (was only patched for arm64). (#187)
|
||||
|
||||
---
|
||||
|
||||
## [2.26.7] - 2026-03-14
|
||||
|
||||
### Fixed
|
||||
- **Health check SDR detection on macOS** — `timeout` (GNU coreutils) is not available on macOS, causing `rtl_test` to silently fail and report "No RTL-SDR device found" even when one is connected. Now tries `timeout`, then `gtimeout` (Homebrew coreutils), then falls back to a background process with manual kill. (#188)
|
||||
|
||||
---
|
||||
|
||||
## [2.26.6] - 2026-03-14
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -7,10 +7,31 @@ import os
|
||||
import sys
|
||||
|
||||
# Application version
|
||||
VERSION = "2.26.6"
|
||||
VERSION = "2.26.10"
|
||||
|
||||
# Changelog - latest release notes (shown on welcome screen)
|
||||
CHANGELOG = [
|
||||
{
|
||||
"version": "2.26.10",
|
||||
"date": "March 2026",
|
||||
"highlights": [
|
||||
"Fix APRS stop timeout and inverted SDR device status",
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.26.8",
|
||||
"date": "March 2026",
|
||||
"highlights": [
|
||||
"Fix acarsdec build failure on macOS (HOST_NAME_MAX undefined)",
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.26.7",
|
||||
"date": "March 2026",
|
||||
"highlights": [
|
||||
"Fix health check SDR detection on macOS (timeout command not available)",
|
||||
]
|
||||
},
|
||||
{
|
||||
"version": "2.26.6",
|
||||
"date": "March 2026",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "intercept"
|
||||
version = "2.26.6"
|
||||
version = "2.26.10"
|
||||
description = "Signal Intelligence Platform - Pager/433MHz/ADS-B/Satellite/WiFi/Bluetooth"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.9"
|
||||
|
||||
+30
-16
@@ -1924,7 +1924,13 @@ def start_aprs() -> Response:
|
||||
|
||||
@aprs_bp.route('/stop', methods=['POST'])
|
||||
def stop_aprs() -> Response:
|
||||
"""Stop APRS decoder."""
|
||||
"""Stop APRS decoder.
|
||||
|
||||
Releases the SDR device immediately so the status panel updates
|
||||
without waiting for process termination. Process cleanup runs in a
|
||||
background thread to avoid blocking the HTTP response (which caused
|
||||
frontend timeout errors when two processes each took up to 2s to die).
|
||||
"""
|
||||
global aprs_active_device, aprs_active_sdr_type
|
||||
|
||||
with app_module.aprs_lock:
|
||||
@@ -1939,6 +1945,28 @@ def stop_aprs() -> Response:
|
||||
if not processes_to_stop:
|
||||
return api_error('APRS decoder not running', 400)
|
||||
|
||||
# Release SDR device immediately so status panel reflects the
|
||||
# change without waiting for process termination.
|
||||
if aprs_active_device is not None:
|
||||
app_module.release_sdr_device(aprs_active_device, aprs_active_sdr_type or 'rtlsdr')
|
||||
aprs_active_device = None
|
||||
aprs_active_sdr_type = None
|
||||
|
||||
# Capture refs to clear before releasing the lock
|
||||
master_fd = getattr(app_module, 'aprs_master_fd', None)
|
||||
app_module.aprs_process = None
|
||||
if hasattr(app_module, 'aprs_rtl_process'):
|
||||
app_module.aprs_rtl_process = None
|
||||
app_module.aprs_master_fd = None
|
||||
|
||||
# Terminate processes in background so the response returns fast.
|
||||
# Each proc.wait() can block up to PROCESS_TERMINATE_TIMEOUT (2s),
|
||||
# which previously caused the frontend 2200ms fetch to abort.
|
||||
def _cleanup():
|
||||
# Close PTY master fd first — this unblocks the stream thread
|
||||
if master_fd is not None:
|
||||
with contextlib.suppress(OSError):
|
||||
os.close(master_fd)
|
||||
for proc in processes_to_stop:
|
||||
try:
|
||||
proc.terminate()
|
||||
@@ -1948,21 +1976,7 @@ def stop_aprs() -> Response:
|
||||
except Exception as e:
|
||||
logger.error(f"Error stopping APRS process: {e}")
|
||||
|
||||
# Close PTY master fd
|
||||
if hasattr(app_module, 'aprs_master_fd') and app_module.aprs_master_fd is not None:
|
||||
with contextlib.suppress(OSError):
|
||||
os.close(app_module.aprs_master_fd)
|
||||
app_module.aprs_master_fd = None
|
||||
|
||||
app_module.aprs_process = None
|
||||
if hasattr(app_module, 'aprs_rtl_process'):
|
||||
app_module.aprs_rtl_process = None
|
||||
|
||||
# Release SDR device
|
||||
if aprs_active_device is not None:
|
||||
app_module.release_sdr_device(aprs_active_device, aprs_active_sdr_type or 'rtlsdr')
|
||||
aprs_active_device = None
|
||||
aprs_active_sdr_type = None
|
||||
threading.Thread(target=_cleanup, daemon=True).start()
|
||||
|
||||
return jsonify({'status': 'stopped'})
|
||||
|
||||
|
||||
@@ -751,9 +751,26 @@ install_acarsdec_from_source_macos() {
|
||||
|
||||
cd "$tmp_dir/acarsdec"
|
||||
|
||||
# Replace deprecated -Ofast (all macOS, not just arm64)
|
||||
if grep -q '\-Ofast' CMakeLists.txt 2>/dev/null; then
|
||||
sed -i '' 's/-Ofast/-O3 -ffast-math/g' CMakeLists.txt
|
||||
info "Patched deprecated -Ofast flag"
|
||||
fi
|
||||
|
||||
# macOS doesn't have -march=native on arm64
|
||||
if [[ "$(uname -m)" == "arm64" ]]; then
|
||||
sed -i '' 's/-Ofast -march=native/-O3 -ffast-math/g' CMakeLists.txt
|
||||
info "Patched compiler flags for Apple Silicon (arm64)"
|
||||
sed -i '' 's/ -march=native//g' CMakeLists.txt
|
||||
info "Removed -march=native for Apple Silicon"
|
||||
fi
|
||||
|
||||
# HOST_NAME_MAX is Linux-specific; macOS uses _POSIX_HOST_NAME_MAX
|
||||
if grep -q 'HOST_NAME_MAX' acarsdec.c 2>/dev/null; then
|
||||
sed -i '' '1i\
|
||||
#ifndef HOST_NAME_MAX\
|
||||
#define HOST_NAME_MAX 255\
|
||||
#endif
|
||||
' acarsdec.c
|
||||
info "Patched HOST_NAME_MAX for macOS compatibility"
|
||||
fi
|
||||
|
||||
if grep -q 'pthread_tryjoin_np' rtl.c 2>/dev/null; then
|
||||
@@ -1924,7 +1941,18 @@ do_health_check() {
|
||||
info "SDR device detection..."
|
||||
if cmd_exists rtl_test; then
|
||||
local rtl_output
|
||||
rtl_output=$(timeout 3 rtl_test -d 0 2>&1 || true)
|
||||
if cmd_exists timeout; then
|
||||
rtl_output=$(timeout 3 rtl_test -d 0 2>&1 || true)
|
||||
elif cmd_exists gtimeout; then
|
||||
rtl_output=$(gtimeout 3 rtl_test -d 0 2>&1 || true)
|
||||
else
|
||||
# No timeout command (common on macOS) — run with background kill
|
||||
rtl_test -d 0 > /tmp/.rtl_test_out 2>&1 & local rtl_pid=$!
|
||||
sleep 2
|
||||
kill "$rtl_pid" 2>/dev/null; wait "$rtl_pid" 2>/dev/null
|
||||
rtl_output=$(cat /tmp/.rtl_test_out 2>/dev/null || true)
|
||||
rm -f /tmp/.rtl_test_out
|
||||
fi
|
||||
if echo "$rtl_output" | grep -q "Found\|Using device"; then
|
||||
ok "RTL-SDR device detected"
|
||||
((pass++)) || true
|
||||
|
||||
+36
-4
@@ -46,6 +46,35 @@ def _rtl_tool_supports_bias_t(tool_path: str) -> bool:
|
||||
return False
|
||||
|
||||
|
||||
def enable_bias_t_via_rtl_biast(device_index: int = 0) -> bool:
|
||||
"""Enable bias-t power using rtl_biast (RTL-SDR Blog drivers).
|
||||
|
||||
Runs rtl_biast to set the bias-t register on the device, then exits.
|
||||
The setting persists across device opens until the device is reset.
|
||||
|
||||
Returns True if bias-t was enabled successfully.
|
||||
"""
|
||||
rtl_biast_path = get_tool_path('rtl_biast') or 'rtl_biast'
|
||||
try:
|
||||
result = subprocess.run(
|
||||
[rtl_biast_path, '-b', '1', '-d', str(device_index)],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
timeout=5
|
||||
)
|
||||
if result.returncode == 0:
|
||||
logger.info(f"Bias-t enabled via rtl_biast on device {device_index}")
|
||||
return True
|
||||
logger.warning(f"rtl_biast failed (exit {result.returncode}): {result.stderr.strip()}")
|
||||
return False
|
||||
except FileNotFoundError:
|
||||
logger.warning("rtl_biast not found — install RTL-SDR Blog drivers for bias-t support")
|
||||
return False
|
||||
except Exception as e:
|
||||
logger.warning(f"Failed to enable bias-t via rtl_biast: {e}")
|
||||
return False
|
||||
|
||||
|
||||
def _get_dump1090_bias_t_flag(dump1090_path: str) -> str | None:
|
||||
"""Detect the correct bias-t flag for the installed dump1090 variant.
|
||||
|
||||
@@ -197,10 +226,13 @@ class RTLSDRCommandBuilder(CommandBuilder):
|
||||
if bias_t_flag:
|
||||
cmd.append(bias_t_flag)
|
||||
else:
|
||||
logger.warning(
|
||||
f"Bias-t requested but {dump1090_path} does not support it. "
|
||||
"Consider using dump1090-fa or readsb for bias-t support."
|
||||
)
|
||||
# Fallback: use rtl_biast to set bias-t before starting dump1090
|
||||
if not enable_bias_t_via_rtl_biast(device.index):
|
||||
logger.warning(
|
||||
f"Bias-t requested but {dump1090_path} does not support it "
|
||||
"and rtl_biast is not available. Install RTL-SDR Blog drivers "
|
||||
"or use dump1090-fa/readsb for bias-t support."
|
||||
)
|
||||
|
||||
return cmd
|
||||
|
||||
|
||||
Reference in New Issue
Block a user