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 can you use an old bluetooth GPS reciever with an Arduiono - #3 by system - Networking, Protocols, and Devices - Arduino Forum works fine. As I remebered, the baud rate is 38400 and the output on the serial monitor looks like this (yes, no fix) :
$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.
/*
* 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 ?
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.000,¦,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-1.0\libraries\SoftwareSerial
As of Arduino 1.0, edit line 42 :
#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 : Gammon Forum : Electronics : Microprocessors : How to process incoming serial data without blocking (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):
- ?
- Ground
- RTS
- CTS
- TXD
- RXD
- ? - 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 : Welcome gpsinformation.org - Hostmonster.com
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 : Gammon Forum : Electronics : Microprocessors : How to process incoming serial data without blocking
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) : NewSoftSerial | Arduiniana
TinyGPS Library : TinyGPS | Arduiniana
NMEA information : Welcome gpsinformation.org - Hostmonster.com