Arduino GPS Shield by iteadstudio.com

Another starter at wit's end!

I have run through all of the coding options to change the speed from 38400 to 4800 and still only get asterisk both ways, at 38400 and 4800. I do get an increasing count for Char and Check sum but Sentences stays at zero when I run 4800. When I run 38400 the Sentences and check sum are zero with the increasing Char count.
I have let this this run for one hour outside each test.
My Tx pin is on 2 and Rx pin on 3 with the opposite setting for the SoftSerial setting Rx is 2, Tx is 3. I have INT0 and INT1 strapped OFF.

Can anyone conform or discount that the PWR Led on the GPS card will 1 PPS when good signals are received?

Does anyone have a 'raw data dump' sketch or more ideas that I can try to get running?

LostJohn

I have found the correction to my first problem. My GPS card defaults to 9600 bps.
All of the sketches in the TinyGPSPlus lib run well.

Next problem: I cannot get any of the same sketches to run on my YUN.

Ideas?

/*
 * TimeGPS.pde
 * example code illustrating time synced from a GPS
 * 
 */

#include <Time.h>
#include <TinyGPS.h>       // http://arduiniana.org/libraries/TinyGPS/
#include <SoftwareSerial.h>
// TinyGPS and SoftwareSerial libraries are the work of Mikal Hart

SoftwareSerial SerialGPS = SoftwareSerial(2, 3);  // receive on pin 10
TinyGPS gps; 

// To use a hardware serial port, which is far more efficient than
// SoftwareSerial, uncomment this line and remove SoftwareSerial
//#define SerialGPS Serial1

// Offset hours from gps time (UTC)
const int offset = -1;   // Costa Rica  Time
//const int offset = -5;  // Eastern Standard Time (USA)
//const int offset = -4;  // Eastern Daylight Time (USA)
//const int offset = -8;  // Pacific Standard Time (USA)
//const int offset = -7;  // Pacific Daylight Time (USA)

// Ideally, it should be possible to learn the time zone
// based on the GPS position data.  However, that would
// require a complex library, probably incorporating some
// sort of database using Eric Muller's time zone shape
// maps, at http://efele.net/maps/tz/

time_t prevDisplay = 0; // when the digital clock was displayed

void setup()
{
  Serial.begin(300);
  while (!Serial) ; // Needed for Leonardo and YUN
  SerialGPS.begin(9600);
  Serial.println("Waiting for GPS time ... ");
}

void loop()
{
  while (SerialGPS.available()) {
    if (gps.encode(SerialGPS.read())) { // process gps messages
      // when TinyGPS reports new data...
      unsigned long age;
      int Year;
      byte Month, Day, Hour, Minute, Second;
      gps.crack_datetime(&Year, &Month, &Day, &Hour, &Minute, &Second, NULL, &age);
      if (age < 500) {
        // set the Time to the latest GPS reading
        setTime(Hour, Minute, Second, Day, Month, Year);
        adjustTime(offset * SECS_PER_HOUR);
      }
    }
  }
  if (timeStatus()!= timeNotSet) {
    if (now() != prevDisplay) { //update the display only if the time has changed
      prevDisplay = now();
      digitalClockDisplay();  
    }
  }
}

void digitalClockDisplay(){
  // digital clock display of the time
  Serial.print(hour());
  printDigits(minute());
  printDigits(second());
  Serial.print(" ");
  Serial.print(day());
  Serial.print(" ");
  Serial.print(month());
  Serial.print(" ");
  Serial.print(year()); 
  Serial.println(); 
}

void printDigits(int digits) {
  // utility function for digital clock display: prints preceding colon and leading 0
  Serial.print(":");
  if(digits < 10)
    Serial.print('0');
  Serial.print(digits);
}

Martin_Y:
Hi guys,

First of all, sorry for my bad English.

After a week of fighting and reading this post, I just made my iteadstudio GPS shield works (with Arduino UNO). I would like to share my experience to you guys.

In order to make it simple, I would like to make a list to show how to do it.

  1. Make sure your antenna is in outside.
  2. Check your jumper settings. (I am using pin 2 for Tx, and pin 3 for Rx)
  3. Download and import the TinyGPS++ library from TinyGPS++ | Arduiniana?
  4. Open the example code "FullExample" from TinyGPS++.
  5. Change the pin settings from "RXPin = 4, TXPin = 3" to "RXPin = 2, TXPin = 3"
  6. Change the following code in the setup function:
ss.begin(GPSBaud);

to:

  ss.begin(38400); 

ss.print("$PUBX,41,1,0007,0003,4800,0*13\r\n"); // Change iTead baudrate
 ss.flush();
 delay(50);
 
 ss.begin(4800); // reset SoftwareSerial baudrate
 ss.flush();
 delay(50);




(This is very important to make it works. The code above is provided by **adhia** at reply #118. Thanks!)

7. Upload your code to Arduino and open the Serial Monitor.
8. The example code uses 115200 baud, so please turn your Serial Monitor to use 115200 baud.
9. After that, you should be able to see the stars like


**** **** ********** *********** **** ********** ******** **** ****** ****** ***** ***   ******** ****** ***   0 0         0




The first zero means the number of received characters from the GPS shield. This number should be increased every time the new line comes. For example:


**** **** ********** *********** **** ********** ******** **** ****** ****** ***** ***   ******** ****** ***   0     0         0        
0    9999 ********** *********** **** 02/21/2014 11:31:17 368  ****** ****** ***** ***   ******** ****** ***   253   0         0        
0    9999 ********** *********** **** 02/21/2014 11:31:18 626  ****** ****** ***** ***   ******** ****** ***   514   0         0        
0    9999 ********** *********** **** 02/21/2014 11:31:20 179  ****** ****** ***** ***   ******** ****** ***   1020  0         0



If you can see this, that means your shield and code are configured correctly. 

**You may ask: why my latitude and longitude have became stars?** 
It seems that the GPS shield needs to take around 5 - 10 minutes to warm up or something. After few minutes, you should be able to see the HDOP will be changed from 9999 to a number lesser than 9999. After that, you should be able to receive the GPS coordinate. 

Good Luck.

Thanks Martin. I followed u and now i get the output like u. Since my Mega2560 doesn't able to communicate with arduino with rxPin=2 and txPin=3 i did some change to the procedure. So i set rxPin=64 and txPin and =65. After that i put jumper wires from pin 2,3 to 64,65. Hope this helps someone.

OK. Now I have a new issue. Itead studio doesn't send any useful information like time, lat, lon. Number of satellites also 0. I spend more than 30 minutes in outside. I attached the out put and code with a image. Im running on mega2560.
According to
$GPGGA,,,,,,0,00,99.99,,,,,,*48
number of satellites, latitude, longitude not updated. what could be the issue. been really dissapointed

Is your antenna connected?

Thanks for the quick reply aarg. Yes it is connected

First time acquisition is always slow, but 30 minutes is too long. It's good that you're outdoors, but do you have a clear view of the sky, or are you surrounded by a lot of tall buildings? The signals can reflect off the buildings and confuse the receiver. The message strings you're getting are typical output when the device can't get a lock on any satellites. What kind of antenna is it?

Sky is somewhat cloudy. I put antenna out of the window. There are no tall buildings. Only my house beside the antenna. I attached a picture with arduino and the antenna. I dont know the correct side of the antenna. So i tried both. But still no results. I switched the rx, tx to Serial1 now.
SO now my code is

void setup() {
// Put the proper GPS communication speed down in those 2
Serial.begin(9600); // This is the port the Mega use to communicate with you computer
Serial1.begin(38400);
Serial1.flush();
delay(50);
}

void loop() {
// read from GPS, send to IDE Serial Monitor:
if (Serial1.available()) {
char inByte = Serial1.read();
Serial.write(inByte);
}

// read from IDE Serial Monitor, send to GPS:
if (Serial.available()) {
char inByte = Serial.read();
Serial1.write(inByte);
}
}

output like this

$GPGSV,1,1,0079
$GPGLL,,,,,,V,N
64
$GPRMC,,V,,,,,,,,,,N53
$GPVTG,,,,,,,,,N
30
$GPGGA,,,,,,0,00,99.99,,,,,,48
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99
30
$GPGSV,1,1,0079
$GPGLL,,,,,,V,N
64
$GPRMC,,V,,,,,,,,,,N53
$GPVTG,,,,,,,,,N
30
$GPGGA,,,,,,0,00,99.99,,,,,,48
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99
30
$GPGSV,1,1,0079
$GPGLL,,,,,,V,N
64
$GPRMC,,V,,,,,,,,,,N53
$GPVTG,,,,,,,,,N
30
$GPGGA,,,,,,0,00,99.99,,,,,,48
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99
30
$GPGSV,1,1,0079
$GPGLL,,,,,,V,N
64
$GPRMC,,V,,,,,,,,,,N*53

Thanks aarg

Hello,

I try this code in my arduino uno, I put the pins RX in 3 and Tx in 2

#include <SoftwareSerial.h>

#include <TinyGPS.h>

/* This sample code demonstrates the normal use of a TinyGPS object.
   It requires the use of SoftwareSerial, and assumes that you have a
   4800-baud serial GPS device hooked up on pins 3(rx) and 4(tx).
*/

TinyGPS gps;
SoftwareSerial ss(2, 3);

void setup()
{
  Serial.begin(115200);
  ss.begin(4800);
 
  Serial.print("Simple TinyGPS library v. "); Serial.println(TinyGPS::library_version());
  Serial.println("by Mikal Hart");
  Serial.println();
}

void loop()
{
  bool newData = false;
  unsigned long chars;
  unsigned short sentences, failed;

  // For one second we parse GPS data and report some key values
  for (unsigned long start = millis(); millis() - start < 1000;)
  {
    while (ss.available())
    {
      char c = ss.read();
      // Serial.write(c); // uncomment this line if you want to see the GPS data flowing
      if (gps.encode(c)) // Did a new valid sentence come in?
        newData = true;
    }
  }

  if (newData)
  {
    float flat, flon;
    unsigned long age;
    gps.f_get_position(&flat, &flon, &age);
    Serial.print("LAT=");
    Serial.print(flat == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flat, 6);
    Serial.print(" LON=");
    Serial.print(flon == TinyGPS::GPS_INVALID_F_ANGLE ? 0.0 : flon, 6);
    Serial.print(" SAT=");
    Serial.print(gps.satellites() == TinyGPS::GPS_INVALID_SATELLITES ? 0 : gps.satellites());
    Serial.print(" PREC=");
    Serial.print(gps.hdop() == TinyGPS::GPS_INVALID_HDOP ? 0 : gps.hdop());
  }
 
  gps.stats(&chars, &sentences, &failed);
  Serial.print(" CHARS=");
  Serial.print(chars);
  Serial.print(" SENTENCES=");
  Serial.print(sentences);
  Serial.print(" CSUM ERR=");
  Serial.println(failed);
}

But I dont see any data received.

Simple TinyGPS library v. 13
by Mikal Hart

 CHARS=28 SENTENCES=0 CSUM ERR=0
 CHARS=57 SENTENCES=0 CSUM ERR=0
 CHARS=85 SENTENCES=0 CSUM ERR=0
 CHARS=113 SENTENCES=0 CSUM ERR=0
 CHARS=142 SENTENCES=0 CSUM ERR=0
 CHARS=170 SENTENCES=0 CSUM ERR=0
 CHARS=198 SENTENCES=0 CSUM ERR=0
 CHARS=226 SENTENCES=0 CSUM ERR=0
 CHARS=255 SENTENCES=0 CSUM ERR=0

...


 CHARS=43597 SENTENCES=0 CSUM ERR=6
 CHARS=43665 SENTENCES=0 CSUM ERR=6
 CHARS=43733 SENTENCES=0 CSUM ERR=6
 CHARS=43801 SENTENCES=0 CSUM ERR=6
 CHARS=43869 SENTENCES=0 CSUM ERR=6

The CHARS data are incremented, but dont see any Lat, Long...

Some help?

Try different baud rates. Instead of

ss.begin(4800);

...try 9600 or other numbers listed here.

Cheers,
/dev

If he can see that $GP crap, then the baud rate is correct. So don't change it. For some reason, the GPS device is failing to lock on to the satellites. This is normally due to obstructions ( buildings ) or a defective antenna

Person who gave me the device doesn't had a idea of gps shield. So may be he gave me the wrong antenna. I'm going to switch antenna tomorrow and let u know the result.

I try change baud of serial, the unique change are the number of csum err are incremented too.

I go try another space, more "open", with no builds.

Thanks

michinyon:
If he can see that $GP crap, then the baud rate is correct.

@michinyon, I'm not familiar with the $GPCRAP sentence. :wink: I assume you are replying to me. Sorry, I didn't direct my reply with @tecnowancer, the post above mine. Maybe you skipped over tecnowancer's post?

tecnowancer is only seeing "CHARS = ...". After 43,000 chars, it did see 6 CS errors, but that could be random data because the baud rate is incorrect. itead's demo code uses 9600. It looks like it's 9600 from the product photo (GPIO pins OPEN). The "working" code on page 1 of this thread shows 9600. The itead download tab also shows a Neo 5Q in the schematic and Neo 6M manual, so who knows what's correct. :smiley:

I agree that dilushan is probably having antenna problems.

technowancer:
I try change baud of serial, the unique change are the number of csum err are incremented too.

@technowancer, just to confirm, you are using the itead GPS shield, and you placed the jumpers just like it shows here? Switch set to 5V? Int0 and Int1 OFF?

Look closely at the GPS chip on the shield. Make sure it is a RoyalTek REB-4216, which has a default baud rate of 4800, 9600 or 38400.

You said, "number of csum err are incremented". If one of those baud rates has many CSUM ERR, that could be the correct rate. The UNO should be getting 7 to 9 GPS messages every second, so the CSUM ERR should increment by a few every second, if that's the correct baud rate. I think 9600 is the correct baud rate.

Here are some other things to try:

  1. Try this code, from page 1 of this thread.

  2. Try the jumpers on two different pins: instead of 2 and 3, try 4 and 5. DO NOT use 0 or 1! Be sure to change ss to use the pins you choose. For example:

SoftwareSerial ss(4,5);

This will test whether pins 2 and 3 are working or not.

  1. Try changing your program from this:
  for (unsigned long start = millis(); millis() - start < 1000;)
  {
    while (ss.available())
    {
      char c = ss.read();

to this:

  for (unsigned long start = millis(); millis() - start < 10;)
  {
    while (ss.available())
    {
      start = millis();
      char c = ss.read();

This will test whether you're having a data-overrun problem. Step 1 would have probably worked, though.

Good luck,
/dev

I try use the same project in walk in one street, but not have any data too.

@/dev
Yes, I use Itead gps, in same pins and 5v, but in my gps chip, the code is another:

NEO-6M-0-001
24228109735
1131
0300 15

I change the code for try bauds, 9600 and 38400, and ports 3 and 4 but no changes.

I go try the code of 1 page now.

Thanks

It is easy /dev. without tinygps we can extract information from this. Google "NMEA sentences"

$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47

Where:
GGA Global Positioning System Fix Data
123519 Fix taken at 12:35:19 UTC
4807.038,N Latitude 48 deg 07.038' N
01131.000,E Longitude 11 deg 31.000' E
1 Fix quality: 0 = invalid
1 = GPS fix (SPS)
2 = DGPS fix
3 = PPS fix
4 = Real Time Kinematic
5 = Float RTK
6 = estimated (dead reckoning) (2.3 feature)
7 = Manual input mode
8 = Simulation mode
08 Number of satellites being tracked
0.9 Horizontal dilution of position
545.4,M Altitude, Meters, above mean sea level
46.9,M Height of geoid (mean sea level) above WGS84
ellipsoid
(empty field) time in seconds since last DGPS update
(empty field) DGPS station ID number
*47 the checksum data, always begins with *

Why dont u try this techno. Change ur rx, tx instead 64, 65 in the code

#include "SoftwareSerial.h"

#define RXPIN 64
#define TXPIN 65

SoftwareSerial nss(RXPIN, TXPIN);
void setup(){
   Serial.begin(9600);
   nss.begin(38400); 
   nss.flush();
   delay(50);
   //Serial.println("Init");
}

void loop(){
   while (nss.available()>0)
       Serial.print((char)nss.read()); 
}

@dilushan

Im use arduino Uno, and Uno dont have 64 and 65 pins, sorry, I go try this code now!

I receive some data

$GPGSV,1,1,00*79
$GPG,,40,E$GPRMC,175413.00,V,,,,,,,150315,,,N*7B
$GPVTG,,,,,,,,,N*30
$GPGGA,175413.00,,,,,0,00,99.99,,,,,,*63
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
$GPGSV,1,1,00*79
$GPG,,40,F$GPRMC,175414.00,V,,,,,,,150315,,,N*7C
$GPVTG,,,,,,,,,N*30
$GPGGA,175414.00,,,,,0,00,99.99,,,,,,*64
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
$GPGSV,1,1,00*79
$GPG,,40,8$GPRMC,175415.00,V,,,,,,,150315,,,N*7D
$GPVTG,,,,,,,,,N*30
$GPGGA,175415.00,,,,,0,00,99.99,,,,,,*65
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
$GPGSV,1,1,00*79
$GPG,,40,9$GPRMC,175416.00,V,,,,,,,150315,,,N*7E
$GPVTG,,,,,,,,,N*30
$GPGGA,175416.00,,,,,0,00,99.99,,,,,,*66
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
$GPGSV,1,1,00*79
$GPG,110N
$GPRMC,175417.00,V,,,,,,,150315,,,N*7F
$GPVTG,,,,,,,,,N*30
$GPGGA,175417.00,,,,,0,00,99.99,,,,,,*67
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
$GPGSV,1,1,00*79
$GPG,,40,B$GPRMC,175418.00,V,,,,,,,150315,,,N*70
$GPVTG,,,,,,,,,N*30
$GPGGA,175418.00,,,,,0,00,99.99,,,,,,*68
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
$GPGSV,1,1,00*79
$GPG,110N
$GPRMC,175419.00,V,,,,,,,150315,,,N*71
$GPVTG,,,,,,,,,N*30
$GPGGA,175419.00,,,,,0,00,99.99,,,,,,*69
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
$GPGSV,1,1,00*79
$GPG,,40,5$GPRMC,175420.00,V,,,,,,,150315,,,N*7B
$GPVTG,,,,,,,,,N*30
$GPGGA,175420.00,,,,,0,00,99.99,,,,,,*63
$GPGSA,A,1,,,,,,,,,,,,,99.99,99.99,99.99*30
$GPGSV,1,1,00*79
$GPG,,40,F

@/dev
In code of 1 page, what pins I use?

replace 64, 65 with ur pins. i guess its 2 and 3. If there is empty output then try 3 and 2. Don't forget to set 9600 baud rate in serial monitor.

ok :slight_smile: fine. Serial connection now working. now u have to read that data. currently u don't track any satellite.
And the time is 17:54:20