Last active
February 24, 2019 02:11
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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