Reading data from gps on serial port
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Reading data from gps on serial port




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Reading data from gps on serial port  
James Brodie


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-24-06 11:23 PM

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?






[ Post a follow-up to this message ]



    Re: Reading data from gps on serial port  
David Schwartz


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-24-06 11:23 PM


"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







[ Post a follow-up to this message ]



    Re: Reading data from gps on serial port  
James Brodie


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-25-06 01:56 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?






[ Post a follow-up to this message ]



    Re: Reading data from gps on serial port  
David Schwartz


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-25-06 01:56 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







[ Post a follow-up to this message ]



    Re: Reading data from gps on serial port  
James Brodie


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-25-06 01:56 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?






[ Post a follow-up to this message ]



    Re: Reading data from gps on serial port  
David Schwartz


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-25-06 01:56 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







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:02 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register