diff options
author | John Klug <john.klug@multitech.com> | 2019-04-01 18:46:43 -0500 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2019-07-03 17:08:20 -0500 |
commit | c1c6acfae3a36aa3f6dc2edf016a7bfd6e6d1654 (patch) | |
tree | f5d5a1572ebed2b5bb7d64c2e58818a90075c79d /recipes-navigation/gpsd | |
parent | d79d6ec2d98b7b002e24c98d1a200b505d7b78b7 (diff) | |
download | meta-mlinux-c1c6acfae3a36aa3f6dc2edf016a7bfd6e6d1654.tar.gz meta-mlinux-c1c6acfae3a36aa3f6dc2edf016a7bfd6e6d1654.tar.bz2 meta-mlinux-c1c6acfae3a36aa3f6dc2edf016a7bfd6e6d1654.zip |
Errors are due to wrong speed on EXAR TTY, which can happen with a no reset reboot.
Diffstat (limited to 'recipes-navigation/gpsd')
-rw-r--r-- | recipes-navigation/gpsd/gpsd/gpsd-default | 72 | ||||
-rw-r--r-- | recipes-navigation/gpsd/gpsd_3.18.1.bb | 2 |
2 files changed, 56 insertions, 18 deletions
diff --git a/recipes-navigation/gpsd/gpsd/gpsd-default b/recipes-navigation/gpsd/gpsd/gpsd-default index 3450731..46c64a3 100644 --- a/recipes-navigation/gpsd/gpsd/gpsd-default +++ b/recipes-navigation/gpsd/gpsd/gpsd-default @@ -51,24 +51,62 @@ GPSFIX="3" # function SET_GPS_SPEED { if [[ $(cat /run/config/gpstype) == u-blox ]] ; then - logger -st gpsd -p daemon.info "Attempting to set baud rate to ${GPS_BAUD}" - if ! gpsctl -T 20 -t u-blox -s $GPS_BAUD -b -f $GPS_LINE ; then - logger -st gpsd -p daemon.warning "Unable to set GPS serial port speed." - stty -F $GPS_LINE 9600 - sleep 1 - if ! gpsctl -T 20 -t u-blox -s $GPS_BAUD -b -f $GPS_LINE ; then - logger -st gpsd -p daemon.warning "Unable to set GPS serial port speed." - stty -F $GPS_LINE $GPS_BAUD - sleep 1 - if ! gpsctl -T 20 -t u-blox -s $GPS_BAUD -b -f $GPS_LINE ; then - logger -st gpsd -p daemon.warning "Unable to set GPS serial port speed -- giving up!" + logger -st gpsd -p daemon.info "Attempting to set baud rate to ${GPS_BAUD}" + out=$(gpsctl -T 20 -t u-blox -s $GPS_BAUD -b -f $GPS_LINE) + rslt=$? + if ((rslt == 0)) && [[ $out =~ ${GPS_BAUD}[[:space:]]baud\. ]] ; then + logger -st gpsd -p daemon.info "GPS serial port speed is $GPS_BAUD." + return 0 + fi + + if ((rslt != 0)) ; then + logger -st gpsd -p daemon.warning "Unable to set read the GPS, try again." + speed=$(stty -F $GPS_LINE) + if ((speed == GPS_BAUD)) ; then + stty -F $GPS_LINE 9600 + else + stty -F $GPS_LINE 115200 + fi + fi + + out=$(gpsctl -T 20 -t u-blox -s $GPS_BAUD -b -f $GPS_LINE) + rslt=$? + if ((rslt == 0)) && [[ $out =~ ${GPS_BAUD}[[:space:]]baud\. ]] ; then + logger -st gpsd -p daemon.info "GPS serial port speed is $GPS_BAUD." + return 0 + fi + + if ((rslt != 0)) ; then + speed=$(stty -F $GPS_LINE) + if ((speed == GPS_BAUD)) ; then + stty -F $GPS_LINE 9600 + else + stty -F $GPS_LINE ${GPS_BAUD} fi fi - fi - stty -F $GPS_LINE $GPS_BAUD - logger -st gpsd -p daemon.info "Expect a timeout error here. Need this error." - gpsctl -T 2 -f $GPS_LINE - stty -F $GPS_LINE $GPS_BAUD -fi + + out=$(gpsctl -T 20 -t u-blox -s $GPS_BAUD -b -f $GPS_LINE) + rslt=$? + if ((rslt == 0)) && [[ $out =~ ${GPS_BAUD}[[:space:]]baud\. ]] ; then + logger -st gpsd -p daemon.info "GPS serial port speed is $GPS_BAUD." + return 0 + fi + + if ((rslt != 0)) ; then + speed=$(stty -F $GPS_LINE) + if ((speed == GPS_BAUD)) ; then + stty -F $GPS_LINE 9600 + else + stty -F $GPS_LINE ${GPS_BAUD} + fi + fi + out=$(gpsctl -T 20 -t u-blox -s $GPS_BAUD -b -f $GPS_LINE) + rslt=$? + if ((rslt == 0)) && [[ $out =~ ${GPS_BAUD}[[:space:]]baud\. ]] ; then + logger -st gpsd -p daemon.info "GPS serial port speed is $GPS_BAUD." + return 0 + fi + logger -st gpsd -p daemon.err "Cannot set GPS serial port speed, speed is $GPS_BAUD." +fi # End of U-Blox GPS type } diff --git a/recipes-navigation/gpsd/gpsd_3.18.1.bb b/recipes-navigation/gpsd/gpsd_3.18.1.bb index 975482c..bbc1f88 100644 --- a/recipes-navigation/gpsd/gpsd_3.18.1.bb +++ b/recipes-navigation/gpsd/gpsd_3.18.1.bb @@ -4,7 +4,7 @@ LICENSE = "BSD" LIC_FILES_CHKSUM = "file://COPYING;md5=d217a23f408e91c94359447735bc1800" DEPENDS = "dbus dbus-glib ncurses python libusb1 chrpath-replacement-native pps-tools" PROVIDES = "virtual/gpsd" -PR="m6" +PR="m7" EXTRANATIVEPATH += "chrpath-native" |