├── .gitignore ├── LICENSE.txt ├── README.md └── app.py /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | isstreamer.ini 3 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 David Sulpy 2 | 3 | 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 20 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 22 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 24 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 25 | THE SOFTWARE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Raspberry Pi GPS Tracker 2 | 3 | This repository contains code samples and instructions for building a simple, inexpensive GPS tracker with a Raspberry Pi and Adafruit Ultimate GPS breakout. 4 | 5 | For full instructions including hardware and software step-by-step refer to the [Wiki Documentation](https://github.com/InitialState/rpi-gps/wiki) 6 | -------------------------------------------------------------------------------- /app.py: -------------------------------------------------------------------------------- 1 | import serial 2 | import pynmea2 3 | from ISStreamer.Streamer import Streamer 4 | 5 | serialStream = serial.Serial("/dev/ttyAMA0", 9600, timeout=0.5) 6 | 7 | # construct a streamer instance with information to append to or create 8 | # a bucket and an ini file location that contains the Initial State 9 | # Account Access Key. 10 | streamer = Streamer(bucket_name="GPS Tracker", ini_file_location="./isstreamer.ini") 11 | 12 | try: 13 | while True: 14 | sentence = serialStream.readline() 15 | if sentence.find('GGA') > 0: 16 | data = pynmea2.parse(sentence) 17 | streamer.log("Satellite Count", data.num_sats) 18 | if (data.num_sats >= 3): 19 | streamer.log("Location", "{lat},{lon}".format(lat=data.latitude,lon=data.longitude)) 20 | if (data.num_sats >= 4): 21 | streamer.log("Altitude ({unit})".format(unit=data.altitude_units), data.altitude) 22 | except KeyboardInterrupt: 23 | streamer.close() 24 | --------------------------------------------------------------------------------