From 1ec5672e6a4b5307a34f69c2b8384d85187e3827 Mon Sep 17 00:00:00 2001 From: Gaston Gonzalez Date: Fri, 11 Oct 2024 12:38:04 -0700 Subject: [PATCH] GPS - Replaced 3D fix with lat/lon --- overlay/opt/emcomm-tools/bin/et-system-info | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/overlay/opt/emcomm-tools/bin/et-system-info b/overlay/opt/emcomm-tools/bin/et-system-info index 9140e07..ee9cd4a 100755 --- a/overlay/opt/emcomm-tools/bin/et-system-info +++ b/overlay/opt/emcomm-tools/bin/et-system-info @@ -66,8 +66,9 @@ case $1 in if [ $? -eq 0 ]; then # 3. Obtain the current GPS mode - GPS_MODE=$(gpspipe -w -n 10 | grep -m 1 TPV | jq --exit-status -r .mode) + GPS_JSON=$(gpspipe -w -n 10 | grep -m 1 TPV) if [ $? -eq 0 ]; then + GPS_MODE=$(echo $GPS_JSON | jq --exit-status -r .mode) case $GPS_MODE in 1) @@ -77,7 +78,9 @@ case $1 in echo "2D fix" ;; 3) - echo "3D fix" + LAT=$(echo $GPS_JSON | jq -r .lat) + LON=$(echo $GPS_JSON | jq -r .lon) + printf "%.5f,%.5f\n" $LAT $LON ;; *) echo "Unknown mode"