#!/bin/bash
# gpsd doesn't wnat to share with ModemManger so give it a fifo instead
# To get this to work you need to modify /etc/default/gpsd to
# monitor "/tmp/gps". You also need to move the AUX BM818 antenna connection
# to the center unmarked position.

DEVICE="/dev/ttyUSB1"
FIFO="/tmp/gps"

rm ${FIFO}
mkfifo ${FIFO}

printf "AT+GPSSTART\r\n" > ${DEVICE}
cat ${DEVICE} > ${FIFO} &
systemctl restart gpsd
#echo "AT+GPSSTOP" > ${DEVICE}
