# GPS datalogger for raspberry pi

Date: 2017-03-07

I have 3 buoys that need&#8217;s a GPS logger,

Each buoy got it&#8217;s own raspberry pi 3 and GPS module.

I used [gpspipe](http://manpages.ubuntu.com/manpages/xenial/man1/gpspipe.1.html)  and for the translation to csv [gpsbabel](https://www.gpsbabel.org/)

<!--more-->

  1. set up a GPS logger ,

```shell
mkdir ~/gpsdata 
vi ~/gpslogger.sh
gpspipe -r -d -l -o /home/pi/gpsdata/data.`date +%F.%H:%M:%S`.nmea
```

  2. run the ~/gpslogger.sh using cron to capture data
  3. to translate the nmea to csv I use gpsbabel 
    <pre>for f in ~/gpsdata/*.nmea; do gpsbabel -t -i nmea -f $f -o unicsv -F - &gt;&gt; ~/uni.csv; echo "$f done"; done</pre>
