Skip to content

Instantly share code, notes, and snippets.

@maxious
Last active February 24, 2019 02:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxious/6a4038d0a24a4484d30849c5af8a8d5b to your computer and use it in GitHub Desktop.
Save maxious/6a4038d0a24a4484d30849c5af8a8d5b to your computer and use it in GitHub Desktop.
rc.local for booking up a Quectel GPS chip with assisted GPS data
stty -F /dev/ttyAMA0 raw speed 115200;
# clone from https://github.com/f5eng/mt3339-utils
/home/pi/mt3339-utils/gpsinit -f /home/pi/mt3339-utils/gpsinit.conf /dev/ttyAMA0 ;
if ifconfig -a | grep --quiet wlan0; then
echo wlan exists, wait to load epo;
while ! ping -c 1 -W 1 8.8.8.8; do
echo "Waiting for 8.8.8.8 - network interface might be down..."
sleep 1
done
ntpdate -d -t 5 au.pool.ntp.org;
/home/pi/mt3339-utils/eporetrieve MTK30.EPO /etc/MTK30.EPO ;
/home/pi/mt3339-utils/eporetrieve EPO_GPS_3_1.DAT /etc/EPO_GPS_3_1.DAT ;
/home/pi/mt3339-utils/gpsinit -f /home/pi/mt3339-utils/gpsinit.conf /dev/ttyAMA0 ;
/home/pi/mt3339-utils/epoloader -t - -l=-33,151,42 -s 115200 /etc/EPO_GPS_3_1.DAT /dev/ttyAMA0;
else
echo wlan not found, lora mapping is go;
/home/pi/mt3339-utils/gpsinit -f /home/pi/mt3339-utils/gpsinit.conf /dev/ttyAMA0 ;
/home/pi/mt3339-utils/epoloader -t - -l=-33,151,42 -s 115200 /etc/MTK30.DAT /dev/ttyAMA0;
fi
/etc/init.d/gpsd start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment