Hello, I have the GPS shield and am facing a problem when it sends an sms with the date and time coordinates, after synchronize sms loses part of the string date and time. example while the GPS synchronizes not get the sms like this:
lat long datetime
0.000000,0.000000,20150320141717
after syncing receive
-12.547854, -39.524574,201503201
so sms loses the numbers the hour minute and second 41717
I hope that colleagues can help
I'm using this AT to get information from gps
AT+CGPSINF=0
and receive this answer:
0,-3915.870823,-1257.929730,0.196135,20150320104050.000,195,5,0.0000000,0.000000
this code read the string and record it on 'inData' from terminal
void read_String() {
index = 0;
while (mySerial.available() > 0)
{
if (index < 199)
{
inChar = mySerial.read();
inData[index] = inChar;
index++;
}
}
inData[199] = '\0';
Now cut of inData the selected values
strtok(inData, ",");
strcpy(longitude, strtok(NULL, ","));
strcpy(latitude, strtok(NULL, ","));
strcpy(altitude, strtok(NULL, ","));
strcpy(datetime, strtok(NULL, ","));
while I wait synchronization gps, get the sms this information with the full date and time
0.000000,0.000000,20150320101525
when the GPS sync sms loses hour minute and second
-12.654758,-39.254562,201503201