   ***********************************************************/
   connect_GPS(240, FIRST_TIME);  //wait GPS connect 2minutes
 
-  if(!GPSAnalyzer128()){ 
+  if(!GPSAnalyzer128()){ // Get current time from GPS 
     setCurrentError(INITIAL_TIME_NOT_SET);   
     printAllError();  
-  }
-  
+  }else{
+    addWrite = EEPROMReadInt(0);               //position 0 always have the last position to write data
+//    Serial.print("InitAdd: ");
+//    Serial.print(addWrite);
+    if(addWrite==0){
+      addWrite = addWrite + 2;                //Write date starting at position 2  
+    }
+    addWrite = storeString(addWrite,"D");
+    addWrite = storeString(addWrite,startDateTime);
+    EEPROMWriteInt(0,addWrite);
+    Serial.println(startDateTime);
+  }
+  
+
+/*****************************************************************************************
+ *Configure SIM808 to power save mode, AT+CSCLK. 
+ *It can exit sleep mode  Configure SIM808 
+ * Pull down DTR
+ * Receive voice or data call from network
+ * Receive SMS from network
+ * Receive external interrupt
+ * Charge VBUS pin
+ * AT+CSCLK=0 disable slow clock
+ *          1 enable slow clock controlled by DTR. when DTR=1 can enter sleep mode
+ *                                                 when DTR=0 exit sleep mode
+ *****************************************************************************************/
+  //configure DTR pin to normal HIGH
+  pinMode(DTRkey, OUTPUT);
+  digitalWrite(DTRkey, LOW);      //can not enter sleep mode
+  
+  //sim808_check_with_cmd("AT+CSCLK=1\r\n","OK\r\n",CMD);  //activate the sleep mode
+
   GetGPSLocation();
   
   timerID = timer.setInterval(60000, GetGPSLocation); //call subroutine to GetGPSLocation every minute


  if ((readCurrentError(NO_GPRS_SIGNAL))== 1){
    timer.disable(timerID);
    Serial.println("GetGPSDisabled");
    connect_GPS(120, RUNNING_TIME);                        //leave GPS ON/COLD START until timeout of 120 sec

    sim808_check_with_cmd("=0\r\AT+CGPSPWRn","OK\r\n",CMD);   //put GPS to sleep either acquire signal or not   

      //sim808_flush_serial();
      clearCurrentError(NO_GPRS_SIGNAL);

     //Serial.print("GPSsync: ");
     timeGetGPS = ((unsigned long) (millis() - timerStart))/1000UL;
     Serial.println(timeGetGPS);
     //Serial.println((unsigned long) (millis() - timerStart));
      
      return true;
     }
