SKYLAB GPS

Hello Guys
I hate asking stupid questions here but I'm stuck.

I purchased the Skylab SKM53 tiny GPS awhile back and I'm Just now getting around to finding uses for it.
I went to this site http://fut-electronics.com/wp-content/plugins/fe_downloads/Uploads/Connecting%20Skylab%20SKM53%20GPS%20module%20with%20Arduino%20and%20Demo%20code.pdf
Which describes the basic use, gives simple sketch, links to Library's needed and when the sketch is ran returns current global position.
The Sketch is below and the errors it returns when I try to compile it are also below that.

My question is, I assume the reason I have the errors is the placement of the library's or the type of library's I have installed.
Looking at the errors can you tell if they are in the right location? Or if I have the correct ones at all?
I have NewSoftSerial, Mbed and TinyGPS Libraries installed and all are installed under the sketch/library's folders.
Thanks in advance for any help!

#include <TinyGPS.h>
#include <NewSoftSerial.h>

unsigned long fix_age;
NewSoftSerial GPS(2,3);
TinyGPS gps;
void gpsdump(TinyGPS &gps);
bool feedgps();
void getGPS();
long lat, lon;
float LAT, LON;
//Future Electronics Egypt Ltd. (Arduino Egypt).
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;
//Future Electronics Egypt Ltd. (Arduino Egypt).
}
}
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
}
}

In file included from GPS.ino:1:
C:\Documents and Settings\dad\My Documents\Arduino\libraries\TinyGPS/TinyGPS.h:23:18: error: mbed.h: No such file or directory
In file included from GPS.ino:2:
C:\Documents and Settings\dad\My Documents\Arduino\libraries\NewSoftSerial/NewSoftSerial.h:33:2: error: #error NewSoftSerial has been moved into the Arduino core as of version 1.0. Use SoftwareSerial instead.
In file included from GPS.ino:2:
C:\Documents and Settings\dad\My Documents\Arduino\libraries\NewSoftSerial/NewSoftSerial.h:99: error: conflicting return type specified for 'virtual void NewSoftSerial::write(uint8_t)'
C:\Program Files\Arduino\hardware\arduino\cores\arduino/Print.h:48: error: overriding 'virtual size_t Print::write(uint8_t)'
In file included from GPS.ino:4:
C:\Program Files\Arduino\hardware\arduino\cores\arduino/Arduino.h:94: error: conflicting declaration 'typedef uint8_t byte'
C:\Documents and Settings\dad\My Documents\Arduino\libraries\TinyGPS/types.h:4: error: 'byte' has a previous declaration as 'typedef char byte'
C:\Program Files\Arduino\hardware\arduino\cores\arduino/Arduino.h:105: error: 'long unsigned int millis()' redeclared as different kind of symbol
C:\Documents and Settings\dad\My Documents\Arduino\libraries\TinyGPS/types.h:5: error: previous declaration of 'typedef int millis'

Why are you using NewSoftSerial in a .ino file? Use SoftwareSerial instead.

My copy of TinyGPS, from http://arduiniana.org/libraries/tinygps/ does not try to include mbed.h.

Hello PaulS
Thank you for replying so quickly.

After I posted I went back and looked at the errors and I see what your saying. I corrected in the sketch to have the #include (NewSoftSerial.h) changed to (SoftwareSerial) and the error went away. So yes I see that part.

Going to scrap my sketch and start working from yours, I will reply my results shortly.

Thanks again

Hello again PaulS

I used the sketch below:
It compiled fine and the seemed to run fine except I'm receiving a error on the serial com port that says
"No characters received from GPS: check wiring "
I'm certain the GPS is receiving 5+ and Gnd but I'm not sure how to check for raw data coming from the GPS.
The GPS TX is connected to pin 3 on Arduino and GPS RX is connected to pin 4 on Arduino .
The baud rate for serial is set to 115200 and seems to be reading correctly.
I have the GPS located in a room in the house if that makes a difference "should I be next to a window or out side"
The GPS is brand new and never hooked up before now but I know that does not mean she ain't broke. :slight_smile:
I wouldn't think it makes any difference but I'm using the mega2560.
Any suggestions?
Thanks

#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 4(rx) and 3(tx).
*/

TinyGPS gps;
SoftwareSerial ss(4, 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);
if (chars == 0)
Serial.println("** No characters received from GPS: check wiring **");
}

Here i am attaching Modified code along with library associate with it. Just Download and enjoy GPS

main_c.rar (1.5 KB)

libraries.rar (18.4 KB)

SoftwareSerial ss(4, 3);

Which pins on your GPS are connected to these pins?

PaulS:

SoftwareSerial ss(4, 3);

Which pins on your GPS are connected to these pins?

TX-4 and Rx-3

AMPS-N

I downloaded and compiled the two sketches you passed along. Both gave me errors.
The sketch "main-c" is below and the compile error is below that. I chose to post the main-c sketch because I figure it will be easier to resolve the error.
The error refers to "time_t" which gps.h defines as
"time_t gpsTimeToArduinoTime"
"time_t gpsTimeSync"
Any thoughts to why I might be getting the error?
Thanks in advance

#include <TinyGPS.h>
#include<gps.h>

TinyGPS gps;

void setup()
{
gps_setup();
Serial.begin(9600);
}
void loop()
{

gps_data();
delay(1000);
int a=get_year();
int b=get_month();
int c=get_day();
float d=get_latitude();
float E=get_longitude();
Serial.print(a);Serial.println("/"); Serial.print(b); Serial.println("/"); Serial.print(c);

Serial.println("latitude:\t");
Serial.print(d);

Serial.println("longitude:\t");
Serial.print(E);
Serial.println("");

}

In file included from main_c.ino:2:
C:\Documents and Settings\dad\My Documents\Arduino\libraries\GPS/gps.h:16: error: 'time_t' does not name a type
C:\Documents and Settings\dad\My Documents\Arduino\libraries\GPS/gps.h:17: error: 'time_t' does not name a type

Also include Below lib so it start working

Time.rar (18.2 KB)

please can utell me how to download the ( SoftwareSerial.h ) library ???

Run this test to see things work..

// minimum test code for serial gps

#include <SoftwareSerial.h>

SoftwareSerial gps(3,4); // RX, TX  Connect GPS TX to pin 3 !!!!BEWARE YOUR switched parameters
void setup()
{
  Serial.begin(115200);
  gps.begin(9600);  // may be 4800

}

void loop()
{
  if (gps.available())  Serial.write(gps.read());
}

Thank you saraEAGLES

Ive been trying this whole time to run this on the Mega.
I switched to Uno and everyone here's sketch worked including yours.
I love the mega but hate that most wiring must change to run the sketch most people are using .
Thanks again.

RodneyD:
Ive been trying this whole time to run this on the Mega.
I switched to Uno and everyone here's sketch worked including yours.
I love the mega but hate that most wiring must change to run the sketch most people are using .

You don't need SoftwareSerial if you run on the Mega2650. It has four hardware Serial ports.

As for changing wiring, well, you just need to think about what the sketch is doing, and choose your own pins,