A collection of scripts for logging GPS data and taking periodic / timelapse photos via webcam on a Raspberry Pi. Intended for use in vehicles on roadtrips.
This code is a one-off project written over a couple weeks in preparation for a road trip way out west. I apologize for the mess.
You can read more at my website: http://wiki.exceedindustries.net/index.php?title=GPS_logger_%26_time_lapse_image_device
- Raspberry Pi Model B
- Running latest Raspbian
- BU-353 S4 USB GPS Reciever
- Logitech C270 HD webcam
- A nice univeral car charger with a USB port
sudo apt-get install gpsd gpsd-clients python-gps sqlite3 fswebcam
- Install the dependencies as listed above.
- Plug in the GPS unit to an open USB port. Be near a window, or better yet, outdoors.
- Open a terminal and:
- Run dmesg to see the device name of your GPS (likely /dev/ttyUSB0)
- Run cgps and/or xgps to verify GPS functionality
- Assuming you've installed the dependencies...
- Plug in the webcam to an open USB port
- Run fswebacm and adjust camera
- Tip: Try experimenting with the -S flag of fswebcam. It tells your camera to take a few pictures, but only returns the last one taken. This allows your webcam to auto-focus and/or adjust light levels. I've found a value between 3-10 is about right; it all depends on the webcam in use.
sudo pip install RPi.GPIO
START_DAEMON="true"
GPSD_OPTIONS="/dev/ttyUSB0"
#!/bin/sh
# launcher.sh
# You can cd or skip the next line and add the full path to the last line
# but be careful if your script relies on relative paths?
cd /home/pi/logger
sudo python your_script.py
Add to the bottom:
@lxterminal -e /home/pi/launcher.sh