mirror of
https://github.com/smittix/intercept.git
synced 2026-07-09 01:58:13 -07:00
Add debug output for ADS-B JSON polling thread
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+6
-3
@@ -12078,6 +12078,7 @@ def parse_adsb_output(process):
|
|||||||
'http://localhost:8080/dump1090/data/aircraft.json'
|
'http://localhost:8080/dump1090/data/aircraft.json'
|
||||||
]
|
]
|
||||||
working_url = None
|
working_url = None
|
||||||
|
print("[ADS-B] JSON polling thread started")
|
||||||
|
|
||||||
while process and process.poll() is None:
|
while process and process.poll() is None:
|
||||||
try:
|
try:
|
||||||
@@ -12087,6 +12088,8 @@ def parse_adsb_output(process):
|
|||||||
try:
|
try:
|
||||||
with urllib.request.urlopen(url, timeout=2) as response:
|
with urllib.request.urlopen(url, timeout=2) as response:
|
||||||
data = json_lib.loads(response.read().decode())
|
data = json_lib.loads(response.read().decode())
|
||||||
|
if not working_url:
|
||||||
|
print(f"[ADS-B] JSON: Connected to {url}")
|
||||||
working_url = url
|
working_url = url
|
||||||
|
|
||||||
aircraft_list = data.get('aircraft', [])
|
aircraft_list = data.get('aircraft', [])
|
||||||
@@ -12117,10 +12120,10 @@ def parse_adsb_output(process):
|
|||||||
**aircraft
|
**aircraft
|
||||||
})
|
})
|
||||||
break
|
break
|
||||||
except:
|
except Exception as url_err:
|
||||||
continue
|
continue # Try next URL
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
print(f"[ADS-B] JSON error: {e}")
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
# Start JSON polling thread
|
# Start JSON polling thread
|
||||||
|
|||||||
Reference in New Issue
Block a user