Skm53 gps module and demo code

I am trying to get latitude and longtitude datas from arduino uno via Skylab skm53 gps module.I have uploaded a demo code.The code owner says you will get sample outputs like this:
Latitude : 30.330136 :: Longitude : 31.057404
Latitude : 30.330092 :: Longitude : 31.057339
But from my arduino I just saw in the serial monitor:

Latitude : 0.0000000 :: Longitude : 0.0000000
Latitude : 0.0000000 :: Longitude : 0.0000000

No error messages during the upload.What am I doing wrong?

Code:

#include <TinyGPS.h>
#include <SoftwareSerial.h>
unsigned long fix_age;
SoftwareSerial GPS(2,3);
TinyGPS gps;
void gpsdump(TinyGPS &gps);
bool feedgps();
void getGPS();
long lat, lon;
float LAT, LON;

void setup(){
GPS.begin(9600);
Serial.begin(115200);
}
void loop(){
long lat, lon;
unsigned long fix_age, time, date, speed, course;
unsigned long chars;
unsigned short sentences, failed_checksum;
// retrieves +/- lat/long in 100000ths of a degree
gps.get_position(&lat, &lon, &fix_age);
// time in hh:mm:ss, date in dd/mm/yy
/*gps.get_datetime(&date, &time, &fix_age);
year = date % 100;
month = (date / 100) % 100;
day = date / 10000;
hour = time / 1000000;
minute = (time / 10000) % 100;
second = (time / 100) % 100;
Serial.print(“Date: “);
Serial.print(year); Serial.print(”/”);
Serial.print(month); Serial.print("/");
Serial.print(day);
Serial.print(" :: Time: “);
Serial.print(hour); Serial.print(”:");
Serial.print(minute); Serial.print(":");
Serial.println(second);
*/
getGPS();
Serial.print("Latitude : “);
Serial.print(LAT/100000,7);
Serial.print(” :: Longitude : ");
Serial.println(LON/100000,7);
}
void getGPS(){
bool newdata = false;
unsigned long start = millis();
// Every 1 seconds we print an update
while (millis() - start < 1000)
{
if (feedgps ()){
newdata = true;

}
}
if (newdata)
{
gpsdump(gps);
}
}
bool feedgps(){
while (GPS.available())
{
if (gps.encode(GPS.read()))
return true;
}
return 0;
}
void gpsdump(TinyGPS &gps)
{
//byte month, day, hour, minute, second, hundredths;
gps.get_position(&lat, &lon);
LAT = lat;
LON = lon;
{
feedgps(); // If we don’t feed the gps during this long routine, we may drop characters and get checksum errors
}
}

What am I doing wrong?

Assuming that you got a fix, and, therefore valid data, when likely you didn't.

I didn’t understand.

If you can correct that code,I would be appreciated.Otherwise,never mind that code.I have used the code in the Arduino cookbook too but that doesn’t parse nmea sentences.
#include “TinyGPS.h”
#include “SoftwareSerial.h”
#define HEMISPHERE_PIN 13
#define GPS_RX_PIN 2
#define GPS_TX_PIN 3
TinyGPS gps; // create a TinyGPS object
SoftwareSerial ss(GPS_RX_PIN, GPS_TX_PIN); // create soft serial object
void setup()
{
Serial.begin(9600); // for debugging
ss.begin(4800); // Use Soft Serial object to talk to GPS
pinMode(HEMISPHERE_PIN, OUTPUT);
digitalWrite(HEMISPHERE_PIN, LOW); // turn off LED to start
}
void loop()
{
while (ss.available())
{
int c = ss.read();
Serial.write(c); // display NMEA data for debug
// Send each byte to encode()
// Check for new position if encode() returns “True”
if (gps.encode(c))
{
long lat, lon;
unsigned long fix_age;
gps.get_position(&lat, &lon, &fix_age);
if (fix_age == TinyGPS::GPS_INVALID_AGE )
Serial.println(“No fix ever detected!”);
else if (fix_age > 2000)
Serial.println(“Data is getting STALE!”);
else
Serial.println(“Latitude and longitude valid!”);
Serial.print("Lat: “);
Serial.print(lat);
Serial.print(” Lon: ");
Serial.println(lon);
if (lat < 0) // Southern Hemisphere?
digitalWrite(HEMISPHERE_PIN, HIGH);
else
digitalWrite(HEMISPHERE_PIN, LOW);
}
}
}

Can you help to find a code that shows latitude and longtitude?Simple and clean.

Can you help to find a code that shows latitude and longtitude?Simple and clean.

Not until you can successfully read data from the GPS. Forget about trying to parse the data, for now. Just print what comes in:

void loop()
{
   while (ss.available())
   {
      int c = ss.read();
      Serial.print(c); // display NMEA data for debug (You print ASCII data; you write binary data)
   }
}

Until that is printing good data, it is pointless to try to parse it.

I have uploaded this code:

include "TinyGPS.h"

include "SoftwareSerial.h"

define HEMISPHERE_PIN 13

define GPS_RX_PIN 2

define GPS_TX_PIN 3

TinyGPS gps; // create a TinyGPS object SoftwareSerial ss(GPS_RX_PIN, GPS_TX_PIN); // create soft serial object void setup() { Serial.begin(9600); // for debugging ss.begin(9600); // Use Soft Serial object to talk to GPS pinMode(HEMISPHERE_PIN, OUTPUT); digitalWrite(HEMISPHERE_PIN, LOW); // turn off LED to start } void loop() { while (ss.available()) { int c = ss.read(); Serial.write(c); // display NMEA data for debug } }

In serial monitor,it is printing nmea sentences and tx led blinks on arduino.

In serial monitor,it is printing nmea sentences and tx led blinks on arduino.

Show them!

$GPGGAü$GPGGA,164900.450,,,,,0,0,,,M,,M,,*43 $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPGSV,1,1,00*79 $GPRMC,164900.450,V,,,,,0.00,0.00,170613,,,N*44 $GPGGA,164901.450,,,,,0,0,,,M,,M,,*42 $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPGSV,1,1,00*79 $GPRMC,164901.450,V,,,,,0.00,0.00,170613,,,N*45 $GPGGA,164902.450,,,,,0,0,,,M,,M,,*41 $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPGSV,1,1,00*79 $GPRMC,164902.450,V,,,,,0.00,0.00,170613,,,N*46 $GPGGA,164903.450,,,,,0,0,,,M,,M,,*40 $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPGSV,1,1,00*79 $GPRMC,164903.450,V,,,,,0.00,0.00,170613,,,N*47 $GPGGA,164904.450,,,,,0,0,,,M,,M,,*47 $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPGSV,1,1,00*79 $GPRMC,164904.450,V,,,,,0.00,0.00,170613,,,N*40 $GPGGA,164905.450,,,,,0,0,,,M,,M,,*46 $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPGSV,1,1,00*79 $GPRMC,164905.450,V,,,,,0.00,0.00,170613,,,N*41 $GPGGA,164906.450,,,,,0,0,,,M,,M,,*45 $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPGSV,1,1,00*79 $GPRMC,164906.450,V,,,,,0.00,0.00,170613,,,N*42 $GPGGA,164907.450,,,,,0,0,,,M,,M,,*44 $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPGSV,1,1,00*79 $GPRMC,164907.450,V,,,,,0.00,0.00,170613,,,N*43 $GPGGA,164908.450,,,,,0,0,,,M,,M,,*4B $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPGSV,1,1,00*79 $GPRMC,164908.450,V,,,,,0.00,0.00,170613,,,N*4C $GPGGA,164909.450,,,,,0,0,,,M,,M,,*4A $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPGSV,1,1,00*79 $GPRMC,164909.450,V,,,,,0.00,0.00,170613,,,N*4D $GPGGA,164910.450,,,,,0,0,,,M,,M,,*42 $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPGSV,1,1,00*79 $GPRMC,164910.450,V,,,,,0.00,0.00,170613,,,N*45 $GPGGA,164911.450,,,,,0,0,,,M,,M,,*43 $GPGSA,A,1,,,,,,,,,,,,,,,*1E $GPGSV,1,1,00*79 $GPRMC,164911.450,V,,,,,0.00,0.00,170613,,,N*44

While the format of the data looks OK, there is no latitude or longitude data being returned.

Have you tried printing some of the other data available, like number of satellites? You are doing this testing outside, right?

No,I haven't and I am testing it inside.Testing it inside is a big problem?Won't it work inside? I have watched some tutorials and some of them are working inside.One of them uses PMB-648.Do all receivers need to be outside to match satellites?

Anyway,does printing number of satellites data helps us?Do you recommend me to try it outside?

I have tested it outside today.It works.I can read the position data.I uploaded the full code and I could read lat and lon datas with parsing.

Thank you so much Paul.

I uploaded the full code and I could read lat and lon datas with parsing.

hi, can you show me the code?i want to check with my code.im also facing the same problem as you.

thanks

Using GPS indoors you will be lucky to get a fix. You need to be out doors!.

$GPGSA,A,1,*1E

the 1 as in $GPGSA,A,1… tells you there is no fix as does the V in this

$GPRMC,164900.450,V,0.00,0.00,170613,N*44

Read the datasheet!

Mark

Please post your code inside the code tags, i.e. use the # in the text editor.

And, you need to take your GPS outside to get a proper "fix" and get better readings.

Sure.This is the code.

#include “TinyGPS.h”
#include “SoftwareSerial.h”
#define HEMISPHERE_PIN 13
#define GPS_RX_PIN 2
#define GPS_TX_PIN 3
TinyGPS gps; // create a TinyGPS object
SoftwareSerial ss(GPS_RX_PIN, GPS_TX_PIN); // create soft serial object
void setup()
{
Serial.begin(9600); // for debugging
ss.begin(4800); // Use Soft Serial object to talk to GPS
pinMode(HEMISPHERE_PIN, OUTPUT);
digitalWrite(HEMISPHERE_PIN, LOW); // turn off LED to start
}
void loop()
{
while (ss.available())
{
int c = ss.read();
Serial.write(c); // display NMEA data for debug
// Send each byte to encode()
// Check for new position if encode() returns “True”
if (gps.encode(c))
{
long lat, lon;
unsigned long fix_age;
gps.get_position(&lat, &lon, &fix_age);
if (fix_age == TinyGPS::GPS_INVALID_AGE )
Serial.println(“No fix ever detected!”);
else if (fix_age > 2000)
Serial.println(“Data is getting STALE!”);
else
Serial.println(“Latitude and longitude valid!”);
Serial.print("Lat: “);
Serial.print(lat);
Serial.print(” Lon: ");
Serial.println(lon);
if (lat < 0) // Southern Hemisphere?
digitalWrite(HEMISPHERE_PIN, HIGH);
else
digitalWrite(HEMISPHERE_PIN, LOW);
}
}
}

Upload the above code and test it outside.Works without any problem.

Please see point #7: http://forum.arduino.cc/index.php/topic,148850.0.html

I am facing that kind of error while trying to verify the demo code before to compile. It seems I don’t have Wprogram.h inside arduino’s libraries directory.

Besides that, the string #include <SoftwareSerial.h> is not turning into orange, like IDE doesn’t recognizes the library.

do I have to reinstall TinyGps.h library?

better viewing

do I have to reinstall TinyGps.h library?

Where did you get the version of TinyGps.h that you have? The latest version contains:

#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif

which would, on 1.0+, ensure that the compiler is not even be looking for WProgram.h.

Hi Paul,

I got the librarie from

http://arduiniana.org/TinyGPS/TinyGPS10.zip

and contains: Tinygps.cpp Tinygps.h

folder examples statictest.pde test_with_gps_device.pde

I am trying to find now another librarie