How to Parse GPS Data on SIM808 GPS + GPRS Shield Using TinyGPS Library

Hi Guys,

I am trying to parse GPS Data. I need just latitude and longtitude. I can get GPS data but ı can not parse it. Please find the codes below.

#include <SoftwareSerial.h>
#define DEBUG true
SoftwareSerial mySerial(7,8);

void setup(){
Serial.begin(9600);
mySerial.begin(9600);
getgps();
}

void loop(){
sendData( “AT+CGNSINF”,1000,DEBUG);
}

void getgps(void){
sendData( “AT+CGNSPWR=1”,1000,DEBUG);
sendData( “AT+CGPSINF=0”,1000,DEBUG);
}

void sendData(String command, const int timeout, boolean debug){
String response = “”;
mySerial.println(command);
delay(5);
if(debug){
long int time = millis();
while( (time+timeout) > millis()){
while(mySerial.available()){
response += char(mySerial.read());
}
}
Serial.print(response);
}
}

Did you find a way to do this?
I’m trying to do the same

If you want examples of how to use the TinyGPS library look in the \Examples folder that comes with that Library.

TinyGPSplus is a more up to date library.