Code stop running

I am on a project usingTEL0051 SIM908 gps/gsm/gprs shield, part of the project asking to receive GPS location from time to time.
So I created a simple sketch based on the library from the wiki. Here is what my code like and the library.But the problem is that after about 10 minutes, it stoped receiving any new data, some ppl say it is the problem of the GPS module, while I think it is because the sketch problem, anyone have any idea on the sketch?
Code: Select all#include
#include
#include "gps_gsm_sim908Serial0.h"
unsigned long timeover = millis();
LiquidCrystal_I2C lcd(0x27, 20, 4);
int stateGPS = 2;
void setup () {
lcd.init(); // initialize the lcd
// Print a message to the LCD.
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Initial begin...");
gps_init (); //init GPS pin
Serial.begin (9600); //serial0 connect computer
start_gps (); //open GPS
lcd.setCursor(0, 1);
lcd.print("Initial done.");
}
void loop () {
if (millis() - timeover > 30 * 60 * 60 * 1000) {
timeover = millis();
start_gps ();
lcd.clear();
lcd.setCursor(0, 0);
lcd.print ("Initialize every 30'...");
}
delay(2000);
stateGPS = gps_get_gga (); // read data from GPS, return 0 is ok
delay(5000);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print ("waiting state");
if (stateGPS == 0 || stateGPS == 1) {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print ("waiting valid data");
if (gps_gga_is_fix ()) { //true if fix
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Time:"); lcd.print (gps_gga_utc_s ());
lcd.setCursor(0, 1);
lcd.print (gps_gga_EW ()); lcd.print(":");
lcd.print (gps_gga_lat_s ());
lcd.setCursor(0, 2);
lcd.print (gps_gga_NS ()); lcd.print(":");
lcd.print (gps_gga_long_s ());
delay(2000);
}
}
else if (stateGPS == 2 || stateGPS == 3)
waitingData();
}
void waitingData() {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print ("Data error, waiting");
lcd.setCursor(0, 1);
lcd.print (int(millis() / 1000));
delay(200);
// return;
}
I also wanted to try the tinyGPS library from Github, but it doesn't work at all.