GPS Data UART

Status
Not open for further replies.

mike1612

New Member
Hi, this is my first post, go easy.

I am trying to use the GPS Bee and have got it working, except the data string it's outputting is strangely missing characters from a standard NMEA string. I have checked the code, tested it outside, I am using the standard antenna, I have tried different serial readers, I'm really not sure what else to try, if anyone could help it would be really appreciated.

Code:
#use rs232(baud=9600, xmit=PIN_A7, STREAM=HOSTPC)         //HOST PC STREAM
#use rs232(baud=9600, xmit=PIN_A3, rcv=PIN_A2, STREAM=GPS)   //GPS MODULE STREAM

void TEST_GPS(){
unsigned char c;
fprintf(HOSTPC, "Now starting to test GPS\n");
   while(1) {
      c=fgetc(GPS);
      fprintf(HOSTPC, "%c", c);
   }
}

void main(){
TEST_GPS();
}

This is the code I'm using to read the GPS Bee, and this is the data I am getting from it:


$PT,7.6T,,.5,,.7,,*B91W028146,821,A7
GGA144.053.16,,02.16,,,433,97M4.,,*8
GGAA32,41,3,,,,65,.156*5
GGV311,22,0,0,9223,70,6,1,1263*9
GGV321,36,9,72,9083,40,4,2,135*0
GGV331,00,6,3,007
$PT,7.5T,,.9,,.0,,*195W112148,821,A7
GGA144.053.17,,02.18,,,433,00M4.,,*A
GGAA32,41,3,,,,65,.156*5
GGV311,22,0,0,9223,70,6,1,1263*9
GGV321,36,9,72,9083,40,4,2,135*1
GGV331,00,6,3,007
$PT,7.2T,,.6,,.1,,*D97W075148,821,A7
GGA144.053.13,,02.19,,,433,03M4.,,*4
GGAA32,41,3,,,,65,.156*5
GGV311,22,0,0,9223,70,6,1,1263*A
GGV321,36,9,72,9083,40,4,2,135*1
GGV331,00,6,3,007
 
They look like standard NMEA strings to me.
Have you tried sending them to a NMEA monitor to see what sence it would make of them?
**broken link removed**
 
Are you using or ignoring parity? It looks to me that you are only getting half the characters.
 
Last edited:
Thanks for your replies.

I have tried various NMEA monitors with no success, the format changed slightly outputting:

??:??:?? $PM,1160,,,,,231,N7 $PT,,,,,*0
??:??:?? $PS,,,12,,17 $PL,,,1160,,*C
??:??:?? $PM,1170,,,,,231,N7 $PT,,,,,*0
??:??:?? $PS,,,12,,17 $PL,,,1170,,*D
??:??:?? $PM,1180,,,,,231,N7 $PT,,,,,*0
??:??:?? $PS,,,12,,17 $PL,,,1180,,*2
??:??:?? $PM,1190,,,,,231,N7 $PT,,,,,*0

It still appears to be missing half of the string. I have played around with the parity on and off and it didn't make any difference. I may try a different antenna, but I'm not sure that's the issue. Any other suggestions would be a big help!
 
It help a lot if you state which chip and compiler you are using. So, assuming a pic chip and that you are using a software UART, you receive one character and then print it. I suspect you are missing characters whilst printing. Try receiving a whole string before printing and see if that fixes it.

Mike.
 
Missing fileds like that is typical if the GPS has no signal or does not have enough satellites. You can also get an in-between mode where it will give some information fields but not the whole lot.

However I think MikeMl and Pommie hit it on the head, you only seem to be getting every second char;
GGA144.053.17,,02.18,,,433,00M4.,,*A

appears to be the $GPGGA string, but missing the comma (and every odd char);
Code:
$GPGGA,   (it should be)
 G G A    (what you got)

This is also backed up by the $GPGGA string missing lots of commas, they are reliable even if the fields are empty and there should be about 14 commas in that string.

Your serial seems to be losing every second byte. Is it a buffer full issue?
 
Last edited:
Solved! Thanks very much for your help, it was losing every other byte as I tried to print each character. I read the whole string before printing the data, and it now makes sense.

Thanks again, Mike
 
Can anybody tell me whether AGPS is a very important feature for systems in rural areas? Also how badly does the number of channels affect the performance of the GPS receiver? Eg. SIM18 GPS module supports 48 channels and the GPS receiver in the telit combo module GM863 supports 20 channels. Will the performance of the receiver in the telit module be a lot inferior then that in SIM18?
 
I would have said that in rural areas AGPS is far less important.

In rural areas, it is very difficult to get accurate information from the cellular system about where the unit is. It is that information that is passed to the GPS in an assisted GPS system.

Also in rural areas there is less likely to be obstruction of the GPS signals, so the GPS will work fine on its own.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…