Reading data from gps on serial port

  • Follow


I have plugged into my linux machine and I want to be able to write a
program to read the data it outputs on /dev/ttyUSB0.  The problem I am
having is that the data I see when running 'cat /dev/ttyUSB0' isn't the
standard NMEA data that the GPS should be outputting.  I have tested
this with two of these units and both are the same.  I was wondering if
there were some settings for the port that would correct this problem.

For a very short while it was functioning correctly with the correct
output but after disconnecting and reconnecting the gps unit, it
stopped functioning correctly again.

Any ideas?

0
Reply james.brodie (4) 1/25/2006 12:09:36 AM

"James Brodie" <james.brodie@gmail.com> wrote in message 
news:1138147776.512744.82720@f14g2000cwb.googlegroups.com...

>I have plugged into my linux machine and I want to be able to write a
> program to read the data it outputs on /dev/ttyUSB0.  The problem I am
> having is that the data I see when running 'cat /dev/ttyUSB0' isn't the
> standard NMEA data that the GPS should be outputting.  I have tested
> this with two of these units and both are the same.  I was wondering if
> there were some settings for the port that would correct this problem.
>
> For a very short while it was functioning correctly with the correct
> output but after disconnecting and reconnecting the gps unit, it
> stopped functioning correctly again.
>
> Any ideas?

    What are you getting?

    Two obvious possible problems are:

    1) The baud rate is not set correctly.

    2) The GPS has NMEA mode and at least one other mode and as in another 
mode.

    DS


0
Reply David 1/25/2006 12:19:32 AM


Hi

I get something that somewhat looks like NMEA, but isn't:

$PS,,,,,512.12,000000,0,E*55
GA01100,55,,,,,0000,976


Sometimes after running 'cat /dev/ttyUSB0' I get nothing at all.

The GPS also has a binary mode but I'm sure that it is not in binary
mode.  I can change it between NMEA and binary.

What are the commands to check/set the baud rate from the terminal?

0
Reply James 1/25/2006 12:59:05 AM

"James Brodie" <james.brodie@gmail.com> wrote in message 
news:1138150745.283112.243580@g44g2000cwa.googlegroups.com...

> Hi
>
> I get something that somewhat looks like NMEA, but isn't:
>
> $PS,,,,,512.12,000000,0,E*55
> GA01100,55,,,,,0000,976
>
>
> Sometimes after running 'cat /dev/ttyUSB0' I get nothing at all.
>
> The GPS also has a binary mode but I'm sure that it is not in binary
> mode.  I can change it between NMEA and binary.

> What are the commands to check/set the baud rate from the terminal?

    You should be using some kind of actual tool, like 'minicom'. Using 
'cat' just isn't going to work for a variety of reasons.

    DS


0
Reply David 1/25/2006 1:02:31 AM

Thanks for your suggestion.  I will check that program out.

For interests sake, what are the reasons that 'cat' will not work?

and also, will i be able to read the data in a C program just the same
way that I read a normal serial port?

0
Reply James 1/25/2006 1:07:37 AM

"James Brodie" <james.brodie@gmail.com> wrote in message 
news:1138151257.164391.91980@o13g2000cwo.googlegroups.com...

> Thanks for your suggestion.  I will check that program out.
>
> For interests sake, what are the reasons that 'cat' will not work?

    You can't set the baud rate. You can't send a break to the other side. 
You can't flush the port on startup. You can send and receive at the same 
time.

> and also, will i be able to read the data in a C program just the same
> way that I read a normal serial port?

    You should be able to.

    DS


0
Reply David 1/25/2006 1:10:05 AM

5 Replies
459 Views

(page loaded in 0.088 seconds)

Similiar Articles:













7/27/2012 10:37:34 AM


Reply: