Pages: [1] 2   Go Down
Author Topic: Interfacing with a Navman B10 GPS (aka GPSlim236)  (Read 3322 times)
0 Members and 1 Guest are viewing this topic.
France
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

This is my fist post here. I am trying to get information from an old Navman B10 GPS, which is actually a GPSlim236. Here is a photo of the inside :
 

I have been googleling around for the day and found a lot of information about successfull attempt to interface Arduinos with such GPS.
However I cannot make it work correctly...

First test works perfectly. The method suggested here http://arduino.cc/forum/index.php/topic,61789.msg449081.html#msg449081 works fine. As I remebered, the baud rate is 38400 and the output on the serial monitor looks like this (yes, no fix) :
Code:
$GPRMC,213649.763,V,0000.0000,N,00000.0000,E,,,310312,,,N*7D
$GPVTG,,T,,M,,N,,K,N*2C
$GPGGA,213650.763,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*42
$GPRMC,213650.763,V,0000.0000,N,00000.0000,E,,,310312,,,N*75
$GPVTG,,T,,M,,N,,K,N*2C
$GPGGA,213651.763,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*43
$GPRMC,213651.763,V,0000.0000,N,00000.0000,E,,,310312,,,N*74
$GPVTG,,T,,M,,N,,K,N*2C

But if I try this simple sketch, the feed from the GPS is unsable because of some weird characters.
Code:
/*
* Simple sketch that will output the serial feed of GPS
*/
#include <SoftwareSerial.h>

SoftwareSerial ss(3, 2);

void setup()
{
  Serial.begin(38400);
  Serial.println("Waiting for GPS...");
  ss.begin(38400);
}

void loop()
{
  while (ss.available())
    {
      Serial.write(ss.read());
    }
}


Here is the output on the serial monitor. It looks like the software serial librarie does not get all chararcters right. What am I missing ?

Code:
Waiting for GPS...
$GPG§A,2?480?.80?,00?0.0000,N?000?0.0?°0,¢,0,00,,0®0,M?0.0?M,,?°00?41
$GPRÍC,2?4800,00,00E31,6GG,,K2$GPG£A,2?480?.80?,00?0.00?0,N?000?0.0?00,¢¬0,?0,,0?0,M?0.0?M,,?000?´6
?$GP£SA,A?1,,,,,EGV1,507,024,,,0*
G311,,,0,1021,AGV3,102,,,0,-06$M1460.0000,12N
P,,N,C$GPG£A,2?480?.80?,00?0.00?0,N?000?0.0?00,¢,0,?0,,0?0,M?0.0?M,,?000?47
?$GP©MC,2?4800,00,00E31,0GG,,K2$GP£GA,?148?6.8?6,00?0.0?00,§,00?°0.?000,¢,0,?0,,?.0,¦,0.?¬M,?0000?44
?$GP©MC,?148?8V00N00,,3,7$TT¬,*
$GP£?A,2?480?.80?,00?0.0?00,§¬000?0.0?00,¢,0,?0,,?.0,¦,0.?,M,,?000?45
?$GP©MC,?±48?8V00N00,,3,7GG,,K2$GP£GA,?148?8.8?6,00?0.0?00,§,00?00.?000?E,0,?0,¬?.0,¦,0.?,M,?000?*4A
?$GP©MC,?148?8V00N00,,3,7$TT,,*
$GPGGA,21480?.80?,00?°.0?00,N,000°0.0?00,¢,0,?0,,?.0,M,0.0¬M,,?000?4B
?$GP£SA,A,1,,,,,1$S,,506,024,,,0*
G311,,,0,10210AGV3,102409,,,06
R200,00000,12N
P,,N,C$GP£GA,?148?0.8?7,0000.000,¦,00?00.?000?E,0,00,,.0,§,0.?,M,?000?*42
$GP¢MC,?148?8V00N00,,3,7$TT,,*
$GPG§A,2?481?.80?,00?0.0?0,§,000?0.0?00,¢,0,?0,,?.0,¦,0.0?M,,?000?43
?$GP©MC,?14818V00,00E31,4GG,,K2$GP£GA,?148?2.8?7,00?0.0?00,§,00?00.?000?E,0,?0,,?.0,¦,0.?,M,?000?*40
$GP©MC,?148?8V00N00,,3,7$TT,,*

[EDIT]
To avoid you reading the whole topic searching for the solution and more, here is what I learned building this topic :

About the character problem:
The SoftwareSerial library has little buffer (64 characters). It can be increased to limit problems (to a maximum of 128 characters). Doing will reduce the problem, but you will still get errors from time to time (I still does).

To increase the buffer size :
Find the SoftwareSerial.h. It sould be locate in this directory :
<arduino install base>\arduino-1.0\libraries\SoftwareSerial\
As of Arduino 1.0, edit line 42 :
Code:
#define _SS_MAX_RX_BUFF 64 // RX buffer size
Change the value to match your need. It won't work with a value above 128.

About serial communications
That said, you must be aware that the way of coding your sketch can affect the behavior. For instance, you should avoid character by character operation and prefer buffering one or more lines. For coding good practices with serial ports, Nick Gammon has a very nice page : http://www.gammon.com.au/serial (BTW, Thank you Nick for your help!).

Moreover, if you need a reliable serial connection, you should definitely use a hardware port instead of the SoftwareSerial library.

About the hardware : GPSlim236
The Navman B10 is actually a widely spread GPSlim236. Many people successfully used it with Arduino. Here is some usefull pieces of informations I picked up.
Connectivity :
GPS can be connected using a serial port at 38400 bps. The serial port is available on the USB connector which isn't a real USB port. Don't expect anything plugging it directly into your computer. On the PCB, you will also find connectors.

USB connector :
  • Green: TX
  • White: RX ?
  • Red: +5V (don't plug it to your Arduino, see current considerations bellow)
  • Black: Ground

On the PCB (J1 on the left, from top to bottom):
1. ?
2. Ground
3. RTS
4. CTS
5. TXD
6. RXD
7. ? - maybe power in?

Current draw considerations:
The current the GPSlim 236 needs to operate is arround 56-70 mA. The Arduino Uno has a maximum of 50mA output and cannot be used to supply power to the GPS. You must use an external source.
For more details, you can check Kai's results : Current draw of Holux GPSlim 236.

GPS
For the easy of things, everybody is using the TinyGPS library from Arduiana.org. However, if you feel decoding NMEA strings by yourself, it can be done (although spec are not publicly available). Some people are gathering information : http://www.gpsinformation.org/dale/nmea.htm

Links (that helped me gathering all this) :
Mike Cochrane pages : Holux GPSlim236 connecting to Arduino
Kai's pages :
Holux GPSlim 236 on Seeeduino Mega (Arduino Mega)
Current draw of Holux GPSlim 236
Nick Gammon serial ports programming tips : http://www.gammon.com.au/serial
Wayne's page: Navigating with GPS
SoftwareSerial Library at Arduino.cc : http://arduino.cc/en/Reference/SoftwareSerial
NewSoftwareSerial Library at arduiniana.org (which is the official SoftwareSerial library since Arduino 1.0 and included) : http://arduiniana.org/libraries/newsoftserial/
TinyGPS Library : http://arduiniana.org/libraries/tinygps/
NMEA information : http://www.gpsinformation.org/dale/nmea.htm
« Last Edit: April 10, 2012, 03:59:21 am by thoms » Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Try using the hardware serial for the GPS. Or reading in a full line (eg. up to a linefeed) and then echoing it.
Logged

France
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for your quick answer.
I tried to read a full line before printing it to the serial port to the PC. Weird characters are gone, but I get a lot of weird lines. Here are some examples :
Code:
$GPGSA,,06,,...
G3159,,,122,2
G,,1,,2,92,4

$GPRMC,3.A13,090350,6G,5,00,

$GPRMC20043,02,07,1A

$GPRMC20043,02E07,1A

$GPGSAA2,1,3,118
S,33,1,1,6,1,4P3,5,65,0,,4

$GPGSA,32625,2116P,1,9,552,2,0*$V,,0,32,2,,1
S,362,161,37

$GPRMC,00A14007.343,9P35,00,

Here is the skecth I wrote for this :

Code:
/*
* Simple sketch that will output the serial feed of GPS
 */
#include <SoftwareSerial.h>

SoftwareSerial ss(3, 2);

void setup()
{
  Serial.begin(38400);
  Serial.println("Waiting for GPS...");
  ss.begin(38400);
  ss.listen();
}

void loop()
{
  String line=String("");
  while (ss.available())
  {
    char c=ss.read();
    if(c>=0)
    {
      line+=c;
    }
    if(c==13)
    {
      Serial.println(line);
      line=String("");
    }
  }
}
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I would lose the String class, it tends to be a memory hog. Read this:

http://www.gammon.com.au/serial
Logged

France
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello again,

Thank you again for your link. I tried to follow your piece of advice with no luck... Weird characters are back and some end of lines are missing...
Could it be possible that my Ardunio Uno (rev3) is not able to handle software serial at 38400bps ?

here is the result :
Code:
Waiting for GPS...
$PSRFTXTVersion GSW3.1.1TO_3.1.00.07-C23P1.00 *2A
$PSRFTXTTOW:  156587*31
…$P©RFªXT«K:  ˜68™*4š
’PS©FT¬TP§S:  ´1.63MH*43
$SRTXTerion0102-2A68
$GPGGA,193513.456,4841.3754,N,00150.2582,E,0,00,,203.8,M,47.3,M,,0000*74
$GPRMC,193513.456,V,4841.3754,N,001š0.™µ8™,E–,,0204‘2–,,N•7D
$$GPGGA,193514.388,4841.3754,N,00150.2582,E,0,00,,203.8,M,47.3,M,,0000*77
$GPRMC,193514.388,V,4841.3754,N,001š0.™58˜,E–,,˜20š12–,,§*7¢
’$GPGGA,193515.388,4841.3874,N,00150.2448,E,1,03,1.9,203.8,M,47.3,M,,0000*58
$GPRMC,193515.388,A,4841.3874,N,0015˜.2š48–E,˜.0˜,,˜20š12,,,Aª7$GPGGA,193516.288,4841.3832,N,00150.2548,E,1,03,1.9,203.8,M,47.3,M,,0000*59
$GPRMC,193516.288,A,4841.3832,N,00150.˜54œ,E¬2.š6,˜99—62–02˜41™$GPGGA,193517.389,4841.3760,N,00150.2636,E,1,06,2.6,169.4,M,47.3,M,,0000*50
$GPGSA,A,3,27,04,25,14,09,02,,,,,,,5.›,2—6,š®0•38†
$£PG©V,™,1–1$GPGGA,193518.000,4841.3814,N,00150.2782,E,1,06,2.6,219.6,M,47.3,M,,0000*59
$GPRMC,19³518.000,A,4841.3814,N,00150®27˜2,¢,4—69–23™.8˜,0™04˜2$GPGGA,193519.000,4841.3831,N,00150.2796,E,1,06,2.6,225.8,M,47.3,M,,0000*5B

Here is the code I used for this :
Code:
/*
* Simple sketch that will output the serial feed of GPS
 */
#include <SoftwareSerial.h>
const unsigned int MAX_INPUT = 200;

// Software serial port.
// only receive on pin 3
SoftwareSerial ss(3, -1);

void setup()
{
  Serial.begin(38400); // serial to PC
  Serial.println("Waiting for GPS...");
  ss.begin(38400); // start serial port for the GPS
  ss.listen(); // listen on this software serial port, should not be necessary with only one software port.
}

void loop()
{
  static char line[MAX_INPUT];
  static unsigned int pos=0;

  if(ss.available())
  {
    char c=ss.read();
    switch(c)
    {
    case '\n': // end of line
      line[pos]=0; // terminate with null byte
      Serial.println(line);
      pos=0;
      break;
    default:
      if (pos < (MAX_INPUT - 1))
        line [pos++] = c;
      break;
    }
  }
}




Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah, as I read it SoftwareSerial doesn't support negative pin numbers:

Code:
SoftwareSerial ss(3, -1);
Logged

France
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I used that -1 value because I don't need to transmit to the GPS and I don't use a PIN for tx. I'll test it with a positive value this evening to see if change something.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, but SoftwareSerial doesn't know you don't want to use it. It does this:

Code:
void SoftwareSerial::setTX(uint8_t tx)
{
  pinMode(tx, OUTPUT);
  digitalWrite(tx, HIGH);
  _transmitBitMask = digitalPinToBitMask(tx);
  uint8_t port = digitalPinToPort(tx);
  _transmitPortRegister = portOutputRegister(port);
}

This may not be your problem, but setting pin -1 to output and then high isn't the sort of thing I would do.
Logged

France
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You are absolutely right and I will fix this to see if something changes. I borrowed this '-1' from an example which was using the NewSoftSerial library here: http://kaistech.wordpress.com/2011/08/01/holux-gpslim-236-on-seeeduino-mega-arduino-mega/
Logged

France
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So I corrected code as follows:
Code:
SoftwareSerial ss(3, 2);

And here is the result :
Code:
Waiting for GPS...
$PSRFTXTVersion GSW3.1.1TO_3.1.00.07-C23P1.00 *2A
$PSRFTXTTOW:  0*09
$PSR£TXªWK  13š0*4F
„P©RFTXTPS: 6™78˜3FTTVesin 000-0A*6
$GPGGA,235948.036,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*47
$GPRMC,235948.036,V,0000.0000,N,00˜00—00˜0,¢,,–10˜90š,,–N*7F
¤$GPGGA,235949.046,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*41
$GPRMC,235949.046,V,0000.0000,N,00000®00˜0,¢,,–10˜90š,,–N*›9
…$$GPGGA,235950.035,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*4D
$GPRMC,235950.035,V,0000.0000,N,00000.00˜,E–,,˜00œ05–,,§*7š
’$GPGGA,235951.035,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*4C
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The first couple of lines appear to have been received OK. Try bumping up your speed to your serial monitor, like to 115200, so your debugging gets echoed faster. Remember "debugging changes behaviour" so the problem might simply be that it can't echo to you fast enough, and is losing some incoming bits while it does so.
Logged

France
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for your advice ... and your patience !
So I ran a new serie of tests. In all my test, I used the startup sequence of the GPS. Directly connected to the PC here is the output:
Code:
$PSRFTXTVersion GSW3.1.1TO_3.1.00.07-C23P1.00 *2A
$PSRFTXTTOW:  0*09
$PSRFTXTWK:   1340*4F
$PSRFTXTPOS:  6378137 0 0*06
$PSRFTXTCLK:  96250*09
$PSRFTXTCHNL: 12*5F
$PSRFTXTBaud rate: 38400  System clock: 1124.403MHz*6D
$PSRFTXTVersion 01002-02A*68
$GPGGA,235948.037,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*46
$GPRMC,235948.037,V,0000.0000,N,00000.0000,E,,,100905,,,N*7E
$GPVTG,,T,,M,,N,,K,N*2C
$GPGGA,235949.047,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*40
$GPRMC,235949.047,V,0000.0000,N,00000.0000,E,,,100905,,,N*78
$GPVTG,,T,,M,,N,,K,N*2C

Quote
Try bumping up your speed to your serial monitor, like to 115200, so your debugging gets echoed faster.
Here are two tests to check if the serial port speed has an effect :
Test #1:
Buffering : one line
Serial port speed : 115200
Code:
Waiting for GPS...
$PSRFTXTVersion GSW3.1.1TO_3.1.00.07-C23P1.00 *2A
$PSRFTXTTOW:  0*09
$PSRF?XT¯K:  ?34?*4£
?S©FT¬TP§S: 6?78?3FXTerson0102-2A68
$GPGGA,235948.037,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*46
$GPRMC,235948.037,V,0000.0000,N,000?0.?°0?,E?,,?°0?05,,,N*7¢
?$GPGGA,235949.047,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*40
$GPRMC,235949.047,V,0000.0000,N,00?00?00?0,¢,,?10?90?,,?N*?8
?$$GPGGA,235950.036,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*4E
$GPRMC,235950.036,V,0000.0000,N,0000?.0?00?E,?,1?09?5,?,N?76?

Test #2:
Buffering : one line
Serial port speed : 4800
Code:
Waiting for GPS...
$PSRFTXTVersion GSW3.1.1TO_3.1.00.07-C23P1.00 *2A
$PSRFTXTTOW:  0*09
$PSRFªXT«K:  1340*4£
$PSRFªXTPOS: 63781?*
PSTXTadrae:840 Sserin 10-0A*8
$GPGGA,235948.037,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*46
$GPRMC,235948.037,V,0000.0000,N,00?00?0000?E,,,10?905,,,N*7?
$$GPGGA,235949.047,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*40
$GPRMC,235949.047,V,0000.0000,N,00000?0000,E,,,100905,,,N*78
$$GPGGA,235950.036,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*4E
$GPRMC,235950.036,V,0000.0000,N,000?0.000,E,,,100?05,,,N*76

Result are similar for both speeds.

Quote
the problem might simply be that it can't echo to you fast enough, and is losing some incoming bits while it does so.
Here are some more few tests. Here, the sketch is buffering several lines to see if it gets better (code available here http://pastebin.com/GK5fAkU8)

Test #3
Buffering : 4 lines
Serial port speed : 115200
Code:
Waiting for GPS...

Bloc
$PSRFTXTVersion GSW3.1.1TO_3.1.00.07-C23P1.00 *2A
$PSRFTXTTOW:  0*09
$PSRFTXTWK:   1340*4F
$PSRFTXTPOS:  6378137 0 0*06

Bloc
$PSRFTXTCLK:  96250*09
$PSRFTXTCHNL: 12*5F
$PSRFTXTBaud rat: $GPGGA,235948.037,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*46
$GPRMC,235948.037,V,0000.0000,N,00000®0000,E,,,100905,,,N*7E

Bloc
$GPVTG,,T,,M,,N,,K,N*2C
$GPGGA,235949.048,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*4F
$GPRMC,235949.048,V,0000.0000,N,00000.0000,E,,,100905,,,N*77
$GPVTG,,T,,M,,N,,K,N*2C

Test #4
Buffering : 4 lines
Serial port speed : 4800 bps
Code:
Waiting for GPS...

Bloc
$PSRFTXTVersion GSW3.1.1TO_3.1.00.07-C23P1.00 *2A
$PSRFTXTTOW:  0*09
$PSRFTXTWK:   1340*4F
$PSRFTXTPOS:  6378137 0 0*06

Bloc
$PSRFTXTCLK:  96250*09
$PSRFTXTCHNL: 12*5F
$PSRFTXTBaud rat: $GPGGA,235948.037,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*46
$GPRMC,235948.037,V,0000.0000,N,00000.0000,E,,,100905,,,N*7E

Bloc
$GPVTG,,T,,M,,N,,K,N*2C
$GPGGA,235949.047,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*40
$GPRMC,235949.047,V,0000.0000,N,00000.0000,E,,,100905,,,N*78
$GPVTG,,T,,M,,N,,K,N*2C

Test #5
Buffering : 10 lines
Serial port speed : 115200
Code:
Waiting for GPS...

Bloc
$PSRFTXTVersion GSW3.1.1TO_3.1.00.07-C23P1.00 *2A
$PSRFTXTTOW:  0*09
$PSRFTXTWK:   1340*4F
$PSRFTXTPOS:  6378137 0 0*06
$PSRFTXTCLK:  96250*09
$PSRFTXTCHNL: 12*5F
$PRFXTau rte 840  yte coc: 12.03Hz*D
$SRTTVesin010202*6
$GPGGA,235948.037,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*46
$GPRMC,235948.037,V,0000.0000,N,00000.0000,E,,,100905,,,N*7E

Bloc
$GPVTG,,T,,M,,N,,K,N*2C
$GPGGA,235949.047,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*40
$GPRMC,²35949.047,V,0000.0000,N,00000.0000,E,,,100905,,,N*78
$GPVTG,,T,,M,,N,,K,N*2C
$GPGGA,235950.036,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*4E
$GPRMC,235950.036,V,0000.0000,N,00000.0000,E,,,100905,,,N*76
$GPVTG,,T,,M,,N,,K,N*2C
$GPGGA,235951.036,0000.0000,N,00000.0000,E,0,00,,0.0,M,0.0,M,,0000*4F
$GPRMC,235951.036,V,0000.0000,N,00000.0000,E,,,100905,,,N*77
$GPVTG,,T,,M,,N,,K,N*2C

Buffering more lines and using slow speeds seems to lower the problem. However, data get screwed up in the first bloc of 10 lines. This might indicate that the Arduino messed with data without outputing something to the serial port.

In the Arduino Serial.print() reference http://arduino.cc/en/Serial/Print one can read :
Quote
As of version 1.0, serial transmission is asynchronous; Serial.print() will return before any characters are transmitted.
Does this means invoking Serial.print() should not block the Arduino ? I tried to used Serial.flush() and Serial.write() without any more luck.

What am I missing?
« Last Edit: April 04, 2012, 03:57:26 pm by thoms » Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

HardwareSerial has an internal buffer size of 64 bytes. After that it will block. Judging by eye you appear to be getting about that much data out before you have problems.

For debugging, and if you have a second Uno or similar, you might want to try the techniques I describe here:

http://www.gammon.com.au/forum/?id=11329

In particular, if you use a second Uno as the "debug output" and connect them via SPI, it should be able to pump out your debugging messages quickly enough.

Failing that, just read as much as you can from the GPS (say, 1000 bytes), stop reading and then send the results to your serial monitor. Combining hardware serial, software serial, high baud rates, and large amounts of data is likely to be the cause of your problems.

After all, in practice, aren't you going to use the data internally? So maybe just parse it and use it without trying to echo all of it.
Logged

France
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe I was not clear: I am using an Arduino Uno and the GPS is connected to Software Serial port.

Googleing around about other SoftwareSerial problems, it appears I am not alone ! Some other are getting weird characters with GPS on SoftwareSerial!
http://forum.sparkfun.com/viewtopic.php?p=139796#p139796
https://sites.google.com/site/wayneholder/self-driving-rc-car/navigating-with-gps

It looks like the problem is the buffer size of SoftwareSerial ports. I will try this tonite and report
Logged

France
Offline Offline
Newbie
*
Karma: 0
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So increasing the RX buffer size of the SoftwareSerial library from 64 to 128 makes it better. I get less errors and at least TinyGPS is able to parse some lines. Maybe a bigger buffer could get things perfect, but I cannot make it work with value above 128.

To increase the buffer size :
Find the SoftwareSerial.h. It sould be locate in this directory :
<arduino install base>\arduino-1.0\libraries\SoftwareSerial\
As of Arduino 1.0, edit line 42 :
Code:
#define _SS_MAX_RX_BUFF 64 // RX buffer size
Change the value to match your need. It must be less than 128.
Logged

Pages: [1] 2   Go Up
Jump to: