bent55
Posts: 13
Joined: Mon Dec 07, 2015 7:21 pm

Getting information from GPS module from serial port!!

Mon Feb 15, 2016 7:08 pm

We use Raspberry Pi II, there is a Pi II click shield on it and on top of that there is a GPS click (GPS3 click from mikroe) on it. We would like to get information through this GPS module for our school project. Also, for programming we use java programming language.

http://blog.retep.org/2012/06/18/gettin ... pberry-pi/

by following this link, i tried to achieve what i wanted, also instead of ttyUSB0 we used ttyAMA0 module because we dont own a USB. That is why we used serial connection port.But, i cant get any information at all.

I would appreciate, if you could help.
Thanks very much.

klricks
Posts: 7154
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Getting information from GPS module from serial port!!

Mon Feb 15, 2016 8:09 pm

Show a photo of the serial module and how it is connected to the RPi.
Give a link to specifications of the serial module.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

bent55
Posts: 13
Joined: Mon Dec 07, 2015 7:21 pm

Re: Getting information from GPS module from serial port!!

Mon Feb 15, 2016 10:24 pm

Actually, I resolve this problem. However, I have a new problem. I check my GPS with "gpsmon" and "cgps -s" commands. I get different values. These values are approximately 15km. What is this problem?
Last edited by bent55 on Sat Feb 20, 2016 10:22 am, edited 1 time in total.

User avatar
topguy
Posts: 6491
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Getting information from GPS module from serial port!!

Mon Feb 15, 2016 10:34 pm

Give us some examples of output.. ( change degrees a bit if you dont want to tell us where you live )

Could be a conversion problem or it could be that one is written as degrees/minutes/seconds while the other writes decimal degrees. 1 degree 30 minutes = 1.5 decimal degrees.

bent55
Posts: 13
Joined: Mon Dec 07, 2015 7:21 pm

Re: Getting information from GPS module from serial port!!

Mon Feb 15, 2016 10:51 pm

Thank you for your replies,

For example, "gpsmon" output --> 41.812105,33.577201

"cgps -s" output --> 41.482105,33.147201

"cgps -s" gives more accurate results. We are codding our program with JAVA programming. We parse these values and our outputs are same with gpsmon's outputs.

However, we want to use gpsd -s outputs in our programs because these are true. What can we do?
Last edited by bent55 on Sat Feb 20, 2016 10:22 am, edited 1 time in total.

User avatar
topguy
Posts: 6491
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: Getting information from GPS module from serial port!!

Tue Feb 16, 2016 1:48 pm

Personally I would have ignored GPSD completely and parsed the NMEA messages coming from the GPS myself.
http://ktuukkan.github.io/marine-api/

Or a least use a direct client for gpsd like this: https://github.com/taimos/GPSd4Java

bent55
Posts: 13
Joined: Mon Dec 07, 2015 7:21 pm

Re: Getting information from GPS module from serial port!!

Sat Feb 20, 2016 10:18 am

Thank you for your reply. Actually, I listen my default communication ports. It is interesting because gpsmon has wrong values but cgps -s give more accurate results. I have a question? Are these libraries listening to default ports?

Return to “Beginners”