mirror of
https://github.com/smittix/intercept.git
synced 2026-07-05 16:18:12 -07:00
Fix ADS-B process reference bug and add debug output
- Fix poll_dump1090_json using wrong process reference - Add debug output for ADS-B decoder selection - Add debug output for JSON and raw aircraft detection 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+8
-2
@@ -11998,8 +11998,10 @@ def start_adsb():
|
|||||||
|
|
||||||
if dump1090_path:
|
if dump1090_path:
|
||||||
cmd = [dump1090_path, '--raw', '--net', f'--gain', gain, f'--device-index', str(device)]
|
cmd = [dump1090_path, '--raw', '--net', f'--gain', gain, f'--device-index', str(device)]
|
||||||
|
print(f"[ADS-B] Using dump1090: {dump1090_path}")
|
||||||
elif shutil.which('rtl_adsb'):
|
elif shutil.which('rtl_adsb'):
|
||||||
cmd = ['rtl_adsb', '-g', gain, '-d', str(device)]
|
cmd = ['rtl_adsb', '-g', gain, '-d', str(device)]
|
||||||
|
print("[ADS-B] Using rtl_adsb (no JSON endpoint available)")
|
||||||
else:
|
else:
|
||||||
return jsonify({'status': 'error', 'message': 'No ADS-B decoder found (install dump1090 or rtl_adsb)'})
|
return jsonify({'status': 'error', 'message': 'No ADS-B decoder found (install dump1090 or rtl_adsb)'})
|
||||||
|
|
||||||
@@ -12075,7 +12077,7 @@ def parse_adsb_output(process):
|
|||||||
]
|
]
|
||||||
working_url = None
|
working_url = None
|
||||||
|
|
||||||
while adsb_process and adsb_process.poll() is None:
|
while process and process.poll() is None:
|
||||||
try:
|
try:
|
||||||
# Find working URL on first success
|
# Find working URL on first success
|
||||||
urls_to_try = [working_url] if working_url else json_urls
|
urls_to_try = [working_url] if working_url else json_urls
|
||||||
@@ -12085,7 +12087,10 @@ def parse_adsb_output(process):
|
|||||||
data = json_lib.loads(response.read().decode())
|
data = json_lib.loads(response.read().decode())
|
||||||
working_url = url
|
working_url = url
|
||||||
|
|
||||||
for ac in data.get('aircraft', []):
|
aircraft_list = data.get('aircraft', [])
|
||||||
|
if aircraft_list:
|
||||||
|
print(f"[ADS-B] JSON: Found {len(aircraft_list)} aircraft")
|
||||||
|
for ac in aircraft_list:
|
||||||
icao = ac.get('hex', '').upper()
|
icao = ac.get('hex', '').upper()
|
||||||
if not icao:
|
if not icao:
|
||||||
continue
|
continue
|
||||||
@@ -12136,6 +12141,7 @@ def parse_adsb_output(process):
|
|||||||
|
|
||||||
# Create placeholder if not seen via JSON yet
|
# Create placeholder if not seen via JSON yet
|
||||||
if icao not in adsb_aircraft:
|
if icao not in adsb_aircraft:
|
||||||
|
print(f"[ADS-B] Raw: New aircraft {icao}")
|
||||||
aircraft = {
|
aircraft = {
|
||||||
'icao': icao,
|
'icao': icao,
|
||||||
'callsign': None,
|
'callsign': None,
|
||||||
|
|||||||
Reference in New Issue
Block a user