Parallax Gps giving weird Long Lat Points
TylerSkyler
Posts: 72
Hello All! I'm using a Parallax Gps for reading gps data(This One). Using this code I'm continually printing Longitude and Latitude:
All of the variables are declared in VAr. This prints values to the terminal. But the values are completely erratic jumping from .1degree to degrees in one debug. The light on the module is solid and it is reading in smart mode with the GPS_SmartMode object in the obex. some said it needed to be moving to get good values so I drove it around my block then plotted the points and they were skattered all over europe(im in California). Why would this be? How can I fix it?
As Always...Thanks,
Tyler
Pub Main repeat Debug.str(string("Longitude : ")) lon2 := GPS.GetLongitude Debug.str(FS.FloatToString(lon2)) Debug.str(string(" degrees",13)) Debug.str(string("Latitude : ")) lat2 := GPS.GetLatitude Debug.str(FS.FloatToString(lat2)) Debug.str(string(" degrees",13)) waitcnt(clkfreq + cnt)
All of the variables are declared in VAr. This prints values to the terminal. But the values are completely erratic jumping from .1degree to degrees in one debug. The light on the module is solid and it is reading in smart mode with the GPS_SmartMode object in the obex. some said it needed to be moving to get good values so I drove it around my block then plotted the points and they were skattered all over europe(im in California). Why would this be? How can I fix it?
As Always...Thanks,
Tyler
Comments
-Phil
Even If I assumed a decimal place it isn't close to my location(i have found it on my gps). Any other ideas?
Thanks,
Tyler
-Phil
Thanks,
Tyler
-Phil
!GPS is still the command word to use with this unit. Not sure what Phil was looking at there.
Please also note the unit requires 5V to 12V (won't run reliably at 3.3V as it has its own 3.3V voltage regulator) but its I/O pin is 3.3V friendly, having already a suitable 1K series resistor.
-- Gordon
@Gordon- thanks I'll look at that code when I get a chance(I'm responding on my iPod touch right now). I'll post the results of your code. Wish me luck!
As always Thanks,
Tyler
-Phil
Thanks,
Tyler
Ken Gracey
It could be in the formatting of the code. Compare the indenting shown in the code here with yours. As you didn't provide the actual output (you can copy and paste, as you did before) it's hard to know from just your short description. It helps if you're as specific and complete as possible.
Apart from that, is 33.12175 correct for your latitude? That would be helpful info. (Or is it your longitude, and you're in eastern Europe or some such?)
You can also switch to /RAW mode, and just read the sentences as they stream into the Propeller. This is a great way to verify proper operation of any GPS module.
Phil, The docs on this one are a little scant. The BS2 code was updated (the main change was the baud rate), but for whatever reason the additional detail that was in the 28146 docs were omitted for the replacement unit.
-- Gordon
No my position isn't 33.12175 lat or long(I'm in California). The you provided code seems to reports data even when the gps isn't connected. The wire to the antenna is very loose and I'm worried that the gps antenna isn't send data to the module or being grounded properly. Would the gps light go solid even if the gps antenna isn't enjoying a good connection?
@Ken- Thanks for the info. If it is deemed to be a bad module I'll have it replaced, but I how it is user error on my part
Thanks,
Tyler
That latitude is valid for California (north San Diego county, parts of Imperial county), so without knowing what it's supposed to be anything I suggest is just guessing.
The only thing I can say is to check the usual things:
1. Don't connect /RAW (let it float high, so it's in Smart Mode).
2. Be sure you're powering it from an *adequate* 5V supply (not 3.3V)
3. Recheck the wiring to the GPS (the example I provided assumes the GPS is on pin 0.)
etc.
You may also want to simply try receiving the GPS in raw mode at 4800. Pull /RAW low, reset power to the GPS, and see if you get what looks like valid sentences. You'll see sentences that should include your location (but it's not Google Maps ready).
The antenna on this is a bit loose (I wouldn't classify it as "very loose"). It just snaps on. If you get satellite lock within a minute or so then it should be fine.
-- Gordon
Thanks,
Tyler
-Phil
Yes, that's correct. Should be 4800 baud. I edited original post as well.
-- Gordon
I looked at the posted code and I see the forum software lobbed off some characters. The line should read:
GPS.start(0, 0, (percent sign)1100, 9600)
where the (percent sign) is %.
In case there's anything else missing I'm posting it, as well.
For a more robust test, you might want to go back to the smart mode object you started out with, changing it to 9600 baud (edit GPS_SmartMode.spin), and trying that again. That demo provides more data. The one I posted just gives latitude and longitude only.
-- Gordon
Which browser and OS are you using?
-Phil
Try editing your post, and see what happens.
Anyway, I'm using WinXP/SP3 and Firefox (latest whatever). Funnily enough, I get a Unicode symbol box when I view your quote of my post in Firefox, and nothing (a blank space) when I view in Chrome. (Same characters appear in View Source). However, your post of the code shows the percent character.
Same thing happens when I view the page on a Mac with Firefox.
Maybe you have extra posting privileges, being a VIP and all.
Just to test, I'm going to post the line again with the percent sign, and leave it to see what happens now (I won't edit this post either way):
GPS.start(0, 0, $1100, 9600)
-- Gordon
I edited my post, and nothing changed. I, too, am using WinXP/SP3 and latest Firefox. I use the plain-text editor, though, not the fancy one. Maybe that's the difference. BTW, your percent sign got changed to a dollar sign in your previous post.
-Phil
You ARE outside when you run this?
In my tests, accuracy with this unit was always within six feet of my actual location inside my house, as displayed in Google Maps. In fact, it was always more accurate than the GPS in my iPhone. With my iPhone I apparently live two houses down the street.
Try the revised code with the proper mask for the serial port setup. That might do it. Download the spin file itself to avoid any possible errors in formatting of the posted code.
-- Gordon
-- Gordon
Thanks Again,
Tyler
I don't have any special or unique posting privileges. Are you using the fancy editor, or the plain text editor? If the former, try the latter to see if there's any difference.
Tyler,
'Glad you got it working!
-Phil
Tyler, Glad it's working now. This GPS is a nice unit, especially as you can tweak the firmware. The existing code is on the shopping page for the GPS. It's not commented much (if at all) though. It's not terribly complicated, fortunately.
-- Gordon
Thanks,
Tyler
Note that heading is usually not accurate unless you're moving, and even then, it's still often off by several degrees. So if you get incorrect or inconsistent results that's probably the reason. You need a magnetometer to get accurate compass headings.
For other values returned and how to handle them look at the smart gps object you originally started with.
-- Gordon