Hardware Reference
In-Depth Information
Instead, we'll add our own GPS setup routine to the /etc/rc.local script that we've
used throughout this topic.
1.
Open it up for editing using the following command:
pi@raspberrypi ~ $ sudo nano /etc/rc.local
2.
Anywhere before the last exit 0 line, add the following script snippet, adjust
the GPSDEV and GPSBAUD variables to match your GPS and enable the
optional GPSBEACON and GPSLOGGER , as follows:
# GPS startup routine
GPSDEV="/dev/ttyACM0"
GPSBAUD="38400"
GPSBEACON="y"
GPSLOGGER="y"
if [ -c "$GPSDEV" ]; then
stty -F $GPSDEV speed $GPSBAUD
gpsd -n $GPSDEV
if [ "$GPSBEACON" = "y" ]; then
sleep 5
sudo -u pi python /home/pi/gegpsd.py &
cd /tmp && sudo -u pi python -m SimpleHTTPServer &
fi
if [ "$GPSLOGGER" = "y" ]; then
sudo -u pi gpxlogger -d -f /tmp/gpslog.gpx
fi
fi
3.
Now reboot the Pi with the GPS attached and verify with cgps -s that gpsd
was started.
Controlling the Pi with your smartphone
There is something oddly satisfying about controlling a small device remotely from
another small device. To do this with a headless Pi and a smartphone, all we need is
a Wi-Fi adapter on the Pi with SSH running and a remote control app for the phone
that knows how to send commands through an SSH connection.
 
Search WWH ::




Custom Search