    ******************************************/  
   if(!sim808_check_with_cmd("AT+CSTT=\"UNINET\"\r\n","OK\r\n",CMD)){ 
     error = CSTT_UNINET_FAIL;   
+    setCurrentError(CSTT_UNINET_FAIL);
+  }else{
+    clearCurrentError(CSTT_UNINET_FAIL);
   }
   delay(50);
 

posBuf=0;
int i = 0;
int j=0;

//  //waking up GPS after sleep
  sim808_check_with_cmd("AT+CGPSPWR=1\r\n","OK\r\n",CMD); 
  delay(1000);
  sim808_check_with_cmd("AT+CGPSRST=1\r\n","OK\r\n",CMD); 
  delay(1000);

  if(!wait_GPS_connect(25)){ //timeout of 25 seconds to acquire signal  
    sim808_check_with_cmd("AT+CGPSPWR=0\r\n","OK\r\n",CMD); 
    return NO_GPS_DATA_AVAILABLE;
  }


  sim808_clean_buffer(infoLocation,BUFFER_SIZE);
  
  sim808_send_cmd("AT+CGPSINF=2\r\n");
  delay(50);
  if(sim808.readable()) {
    sim808_read_buffer(infoLocation,BUFFER_SIZE,DEFAULT_TIMEOUT);
  }
  Serial.println("buffer2:");
  Serial.println(infoLocation);
  
  
//  while(GPRS.available()){
//    GPRS.read();
//  } 
//  GPRS.println("AT+CGPSINF=2");
//   
//  //Read response of SIM808 at Serial Port, Uno buffer all data without other activities
//  //otherwise it may lose some bytes 
//  //after send the command to GPS, it takes about 100ms to all serial information arrives UNO   
//  delay(50);
   

//  //for(int i=0;i<7;i++){
//  while((posBuf<=99)&&(i<15)){ 
//    while((GPRS.available()>0)){
//      infoLocation[posBuf++]=GPRS.read();
//    }
//    delay(10);
//    i++;
//    //delay(15); 
//  }

  if(!GPSAnalyzer(infoLocation)){
    //sim808_clean_buffer(infoLocation,BUFFER_SIZE);
    sim808_check_with_cmd("AT+CGPSPWR=0\r\n","OK\r\n",CMD);     
    return NO_GPS_DATA_AVAILABLE;
  }


  //debug until here





char MSL_altitude[8]="00000.0";
char Speed[8]="000.000";
char GEOID[5]="00000";
char startDateTime[22] = "000000000000000000000";//"hhmmss.sss-dd-mm-yyyy"; start time of HW
   
boolean DNS_OK = true;
int currentRadioSig = 10;   //currentRadioSig/previousRadioSig = 10 to avoid configure again the data connection
int previousRadioSig = 10;  //when enter the first time of loop to send data
//USED FOR EEPROM
int addr = 0;

//time to GPS acquire signal
int timeGetGPS=0;  //in seconds


//byte pos = 0;  //WHAT POSITION WE ARE AT IN THAT BUFFER
