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:
James Smith
2025-12-22 12:17:48 +00:00
parent 62fc3a8f2c
commit e2f8361974

View File

@@ -11998,8 +11998,10 @@ def start_adsb():
if dump1090_path:
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'):
cmd = ['rtl_adsb', '-g', gain, '-d', str(device)]
print("[ADS-B] Using rtl_adsb (no JSON endpoint available)")
else:
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
while adsb_process and adsb_process.poll() is None:
while process and process.poll() is None:
try:
# Find working URL on first success
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())
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()
if not icao:
continue
@@ -12136,6 +12141,7 @@ def parse_adsb_output(process):
# Create placeholder if not seen via JSON yet
if icao not in adsb_aircraft:
print(f"[ADS-B] Raw: New aircraft {icao}")
aircraft = {
'icao': icao,
'callsign': None,