From 3dfd8613dea62d8b1c7c0be7a3f27abc48265a5b Mon Sep 17 00:00:00 2001 From: John Klug Date: Tue, 2 Mar 2021 09:38:27 -0600 Subject: Reset U-Blox serial port when resetting the U-Blox --- recipes-navigation/gpsd/gpsd/gpsd-default | 11 ++++++++++- recipes-navigation/gpsd/gpsd_3.20.bb | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/recipes-navigation/gpsd/gpsd/gpsd-default b/recipes-navigation/gpsd/gpsd/gpsd-default index 1e52546..4389c6c 100755 --- a/recipes-navigation/gpsd/gpsd/gpsd-default +++ b/recipes-navigation/gpsd/gpsd/gpsd-default @@ -67,9 +67,12 @@ if [[ $(cat /run/config/gpstype) == u-blox ]] ; then ((maxtries--)) if ((maxtries == 5)) ; then # Not going well, so reset the GPS. + logger -s -t 'gpsd info' -p daemon.alert "u-blox is unresponsive, so reset it" mts-io-sysfs store gnss-reset 0 usleep 50 mts-io-sysfs store gnss-reset 1 + # Reset terminal to defaults + stty -F "$GPS_LINE" '500:5:cbd:8a3b:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0' sleep 5 fi # Reset at maxtries == 5 @@ -110,7 +113,13 @@ if [[ $(cat /run/config/gpstype) == u-blox ]] ; then logger -s -t 'gpsd info' -p daemon.alert "gpsctl -T 2 -f $GPS_LINE" logger -s -t 'gpsd info' -p daemon.alert "$GPS_LINE: $(stty -F $GPS_LINE speed) baud" logger -s -t 'gpsd info' -p daemon.alert "$result" - fi # If out of loop with maxtries exhausted, print error + elif [[ $(mts-io-sysfs show hw-version) =~ ^MTHS- ]] ; then + if gpsctl -t 'u-blox' -D 5 -x '\x06\x41\x00\x00\x03\x1F\x90\x47\x4F\xB1\xFF\xFF\xEA\xFF' $GPS_LINE ; then + logger -s -t 'gpsd info' -p daemon.info "GPS LNA set high" + else + logger -s -t 'gpsd info' -p daemon.alert "ERROR: GPS LNA not set" + fi + fi # fi # If U-Blox GPS type } diff --git a/recipes-navigation/gpsd/gpsd_3.20.bb b/recipes-navigation/gpsd/gpsd_3.20.bb index 2176924..ba1b33e 100644 --- a/recipes-navigation/gpsd/gpsd_3.20.bb +++ b/recipes-navigation/gpsd/gpsd_3.20.bb @@ -4,7 +4,7 @@ LICENSE = "BSD" LIC_FILES_CHKSUM = "file://COPYING;md5=01764c35ae34d9521944bb6ab312af53" DEPENDS = "dbus dbus-glib ncurses python3 libusb1 chrpath-replacement-native pps-tools" PROVIDES = "virtual/gpsd" -PR="m5" +PR="m6" #TODO #the recipe generates python2 pygps package for Atmel based devices and python3 pygps package for TI based devices. -- cgit v1.2.3