diff options
Diffstat (limited to 'recipes-navigation/gpsd/gpsd/gpsd-default')
-rw-r--r-- | recipes-navigation/gpsd/gpsd/gpsd-default | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/recipes-navigation/gpsd/gpsd/gpsd-default b/recipes-navigation/gpsd/gpsd/gpsd-default index 168b0cf..3450731 100644 --- a/recipes-navigation/gpsd/gpsd/gpsd-default +++ b/recipes-navigation/gpsd/gpsd/gpsd-default @@ -51,16 +51,22 @@ GPSFIX="3" # function SET_GPS_SPEED { if [[ $(cat /run/config/gpstype) == u-blox ]] ; then - logger -t gpsd -p daemon.info "Attempting to set baud rate to ${GPS_BAUD}" + 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 -t gpsd -p daemon.info "WARNING: Unable to set GPS serial port speed." + 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 -t gpsd -p daemon.info "WARNING: Unable to set GPS serial port speed." + 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!" + fi fi fi stty -F $GPS_LINE $GPS_BAUD - logger -t gpsd -p daemon.info "Expect a timeout error here. Need this error." + 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 |