Ultimate GPS

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
mikemaurice
 
Posts: 4
Joined: Fri Oct 12, 2012 9:44 am

Ultimate GPS

Post by mikemaurice »

Hi,

I have bought an Ultimate GPS to use with the Rasperry PI. Before I connect it I was going to test it on Windows XP by connecting it with http://adafruit.com/products/954 (USB to TTL cable) Will this work?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Ultimate GPS

Post by adafruit_support_rick »

Yes, that will work

mikemaurice
 
Posts: 4
Joined: Fri Oct 12, 2012 9:44 am

Re: Ultimate GPS

Post by mikemaurice »

Many thanks for the info driverblock. I have ordered the cable.

I have another question. I have attached the Ultimate GPS to the Raspberry PI using
http://www.adafruit.com/blog/2012/08/28 ... pberry-pi/
as the wiring guide.
I have connected the Ultimate GPS to the PI using the 5V pin to VIN. I have then connected RX / TX as shown in the picture. I then followed
http://blog.retep.org/2012/06/18/gettin ... pberry-pi/
to setup the software. Et Voila, it works.
One question. Does the Ultimate GPS use 3.3v or 5V on it's TX RX pins? I am aware that the Raspberry PI is only 3.3v tolerant.

Many thanks
Mike

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Ultimate GPS

Post by adafruit_support_rick »

3.3V RX/TX levels are fine with the Ultimate.

mikemaurice
 
Posts: 4
Joined: Fri Oct 12, 2012 9:44 am

Re: Ultimate GPS

Post by mikemaurice »

Hi driverblock,

Many thanks for your quick reply.

So, even though I am powering the Ultimate GPS with 5V it will not damage the raspberry PI by using 5V on the TX? Sorry for the additional question, but I am new to all this :roll:

Kind regards

Mike

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Ultimate GPS

Post by adafruit_support_rick »

You're using the Ultimate GPS Breakout, right? The breakout has a level converter that shifts the 5V down to 3.3V for the GPS module. The GPS module transmits at 3.3V, so you should be OK.

mikemaurice
 
Posts: 4
Joined: Fri Oct 12, 2012 9:44 am

Re: Ultimate GPS

Post by mikemaurice »

Great, thanks again.

User avatar
abbadabbatech
 
Posts: 17
Joined: Mon Sep 17, 2012 2:42 pm

Re: Ultimate GPS

Post by abbadabbatech »

Does anyone have the wiring diagram from Ultimate GPS to pi, I think I have it deciphered it from the pic but want to be clear about it for sure. Not clear on if I power from 3.3 or 5v pin as well.

My ultimate is on the way once they have recovered from Sandy, so I am building my prototype board this weekend in anticipation of next week.

Also anyone have any python code examples for receiving data from the ultimate so that it can be parsed and used?

Thanks

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: Ultimate GPS

Post by adafruit_support_rick »

You can follow the arduino wiring instructions in the tutorial. You can power it with either 3.3V or 5V to VIN.

User avatar
abbadabbatech
 
Posts: 17
Joined: Mon Sep 17, 2012 2:42 pm

Re: Ultimate GPS

Post by abbadabbatech »

Thanks and that will help, anyone have any samples using python on pi to get serial data from the ultimate?

Thanks again

Vim
 
Posts: 1
Joined: Tue Apr 17, 2012 8:21 pm

Re: Ultimate GPS

Post by Vim »

2 questions:

1. Adafruit's tutorial for the Ultimate GPS provides information on how to connect the GPS to an Arduino. Is that information sufficient for an absolute newbie to figure out how to connect the GPS to a Pi?

2. Does Ladyada have plans for a tutorial about using the Ultimate GPS with a Pi?

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Ultimate GPS

Post by adafruit »

we have plans to do a tutorial for the gps+pi, but there is no ETA - it should not be difficult for someone with experience but we have no pointers, tutorials, diagrams, links, etc.

User avatar
abbadabbatech
 
Posts: 17
Joined: Mon Sep 17, 2012 2:42 pm

Re: Ultimate GPS

Post by abbadabbatech »

Maybe this is a start. I have an ultimate connected to a PI. You will need pyserial and pynmea. Still working on other boot up and wrapping alot in class but this is the base I started with parsing the sentences. Hope it helps and feel free to share anything you add.

Code: Select all

#!/usr/bin/python -tt

import serial, time, csv, sys
from pynmea import nmea
from pynmea.streamer import NMEAStream

##different commands to set the update rate from once a second (1 Hz) to 10 times a second (10Hz)
PMTK_SET_NMEA_UPDATE_1HZ = '$PMTK220,1000*1F\r\n'
PMTK_SET_NMEA_UPDATE_5HZ = '$PMTK220,200*2C\r\n'
PMTK_SET_NMEA_UPDATE_10H = '$PMTK220,100*2F\r\n'

##turn on only the second sentence (GPRMC)
PMTK_SET_NMEA_OUTPUT_RMCONLY = '$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n'
##turn on GPRMC and GGA
PMTK_SET_NMEA_OUTPUT_RMCGGA = '$PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n'
##turn on ALL THE DATA
PMTK_SET_NMEA_OUTPUT_ALLDATA = '$PMTK314,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n'
## turn off output
PMTK_SET_NMEA_OUTPUT_OFF = '$PMTK314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*28\r\n'

streamer = NMEAStream()
DEVICE = '/dev/ttyAMA0'
BAUD = 115200
ser = serial.Serial(DEVICE, BAUD)
ser.open()
ser.flush()
##ser.writelines(PMTK_SET_NMEA_UPDATE_1HZ, PMTK_SET_NMEA_OUTPUT_RMCONLY)
ser.write(PMTK_SET_NMEA_UPDATE_1HZ)
##ser.write(PMTK_SET_NMEA_OUTPUT_RMCONLY)
ser.write(PMTK_SET_NMEA_OUTPUT_RMCGGA)

ser.close()
time.sleep(1)
BAUD = 9600
ser = serial.Serial(DEVICE, BAUD)
ser.open()

out = ''
while True:
	##May add some connection check
	while ser.inWaiting() > 0:
		out = ser.readline()
		if out.startswith("$GPGGA"):
			gpgga = nmea.GPGGA()
			gpgga.parse(out)
			print "sats:" + gpgga.num_sats
		if out.startswith("$GPRMC"):
			# Create the object
			gps = nmea.GPRMC()
			# Ask the object to parse the data
			gps.parse(out)
			##print ">>"
			print "time:", gps.timestamp, "lat:", gps.lat,gps.lat_dir, "long:", gps.lon, gps.lon_dir, "speed:", gps.spd_over_grnd, "course:", gps.true_course



divious1
 
Posts: 4
Joined: Wed Nov 28, 2012 11:42 pm

Re: Ultimate GPS

Post by divious1 »

Thank you that does help, have you made any progress on the parser, maybe seen any other project that parses it?

User avatar
abbadabbatech
 
Posts: 17
Joined: Mon Sep 17, 2012 2:42 pm

Re: Ultimate GPS

Post by abbadabbatech »

The parser was already working with the code above using pynmea, but I did find a better solution that does some other stuff like decimal conversions of lat and long and now parsing time, etc... I also now have it posting to a webservice, logging, running as a daemon and starting on boot.

Maybe its time for a github or open my bitbucket since its all being worked in the awesome adafruit webide.

So as a recap:
Raspberry PI
Ultimate GPS breakout
Python code reading serial, parsing, reading parameters from config file, sending data to webservice, running as Daemon and starting on boot.

Last thing left is to figure out how to get power off my car fusebox so that I can power the device and a hotspot. Got the TSR buck converters on the way already, so just need to figure out the fusebox wiring.

I will work this weekend to get my bitbucket organized with only the essentials as there is a lot of test code right now and I will post to here for anyone interested. If you need anything prior to that my email is [email protected]

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”