mirror of
https://github.com/smittix/intercept.git
synced 2026-07-10 18:48:12 -07:00
Add GPS debug endpoint for troubleshooting
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
+25
-1
@@ -189,10 +189,34 @@ def get_position():
|
|||||||
else:
|
else:
|
||||||
return jsonify({
|
return jsonify({
|
||||||
'status': 'waiting',
|
'status': 'waiting',
|
||||||
'message': 'Waiting for GPS fix'
|
'message': 'Waiting for GPS fix - ensure GPS has clear view of sky'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
@gps_bp.route('/debug')
|
||||||
|
def debug_gps():
|
||||||
|
"""Debug endpoint showing GPS reader state."""
|
||||||
|
reader = get_gps_reader()
|
||||||
|
|
||||||
|
if not reader:
|
||||||
|
return jsonify({
|
||||||
|
'reader': None,
|
||||||
|
'message': 'No GPS reader initialized'
|
||||||
|
})
|
||||||
|
|
||||||
|
position = reader.position
|
||||||
|
return jsonify({
|
||||||
|
'running': reader.is_running,
|
||||||
|
'device': reader.device_path,
|
||||||
|
'baudrate': reader.baudrate,
|
||||||
|
'has_position': position is not None,
|
||||||
|
'position': position.to_dict() if position else None,
|
||||||
|
'last_update': reader.last_update.isoformat() if reader.last_update else None,
|
||||||
|
'error': reader.error,
|
||||||
|
'callbacks_registered': len(reader._callbacks),
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
@gps_bp.route('/stream')
|
@gps_bp.route('/stream')
|
||||||
def stream_gps():
|
def stream_gps():
|
||||||
"""SSE stream of GPS position updates."""
|
"""SSE stream of GPS position updates."""
|
||||||
|
|||||||
Reference in New Issue
Block a user