   printWeather();
   //Wait 1 second, and gather GPS data
   delay(1000);
-  getgps(); 
+  getgps();
   //REPORTING
   //Check for a new hour passing
-  Serial.print(hourReport);
-  Serial.print(gps.time.hour());
-  Serial.print(gps.time.minute());
-  if((gps.time.minute()>=0)&&(gps.time.minute()<2)){
-    Serial.print("inside the reporting if 1");
+  //Serial.print(hourReport);
+  //Serial.print(gpshour);
+  //Serial.print(gpsminute);
+  if ((gpsminute >= 0) && (gpsminute < 2)) {
+    //Serial.print(F("inside the reporting if 1"));
     //Check that the actual hour is incremented from last report
-    if(hourReport<gps.time.hour()){
-      Serial.print("inside the reporting if 2");
+    if (hourReport < gpshour) {
+      //Serial.print(F("inside the reporting if 2"));
       //Report all readings hourly
       printWeather();
       //Turn off stat LED
       delay(1000);
-      hourReport=gps.time.hour();
+      hourReport = gpshour;
     }
   }
 }
 
 void getgps(void)
 {
+  String gpsdata = "";
+  String gpsdatatmp = "";
   //GPS baud rate is 9600 for coms
-  switchGPSonoff( "AT+UART=9600,8,1,0,0",1000,DEBUG);
-  switchGPSonoff( "AT+CGNSPWR=1",1000,DEBUG); 
+  switchGPSonoff( "AT+UART=9600,8,1,0,0", 1000, DEBUG);
+  switchGPSonoff( "AT+CGNSPWR=1", 1000, DEBUG);
+  switchGPSonoff( "AT+CGNSSEQ=RMC", 1000, DEBUG);
   do
   {
-    sendData( "AT+CGNSSEQ=RMC",1000,DEBUG);
-  }
-  while(gps.date.year()<2015); 
-  switchGPSonoff( "AT+CGNSPWR=0",1000,DEBUG);
+    gpsdata.concat(sendData( "AT+CGNSINF", 1000, DEBUG));
+    delay(1000);
+    gpsdatatmp.concat(gpsdata);
+    Serial.println(gpsdata);
+    //get YEAR
+    gpsdatatmp.remove(31);
+    gpsdatatmp.remove(0, 27);
+    gpsyear = gpsdatatmp.toInt();
+    gpsdatatmp = "";
+    gpsdatatmp.concat(gpsdata);
+    //get MONTH
+    gpsdatatmp.remove(33);
+    gpsdatatmp.remove(0, 31);
+    gpsmonth = gpsdatatmp.toInt() ;
+    gpsdatatmp = "";
+    gpsdatatmp.concat(gpsdata);
+    //get DAY
+    gpsdatatmp.remove(35);
+    gpsdatatmp.remove(0, 33);
+    gpsday = gpsdatatmp.toInt() ;
+    gpsdatatmp = "";
+    gpsdatatmp.concat(gpsdata);
+    //get HOUR
+    gpsdatatmp.remove(37);
+    gpsdatatmp.remove(0, 35);
+    gpshour = gpsdatatmp.toInt() ;
+    gpsdatatmp = "";
+    gpsdatatmp.concat(gpsdata);
+    //get MINUTE
+    gpsdatatmp.remove(39);
+    gpsdatatmp.remove(0, 37);
+    gpsminute = gpsdatatmp.toInt() ;
+    gpsdatatmp = "";
+    gpsdatatmp.concat(gpsdata);
+    //get SECOND
+    gpsdatatmp.remove(41);
+    gpsdatatmp.remove(0, 39);
+    gpssecond = gpsdatatmp.toInt() ;
+
+  }
+  while (gpsyear < 2015 && gpsmonth == 0 && gpsday == 0 && (gpshour == 0 || gpshour > 12));
+  do
+  {
+    gpsdata.concat(sendData( "AT+CGNSINF", 1000, DEBUG));
+    delay(1000);
+    gpsdatatmp.concat(gpsdata);
+    Serial.println(gpsdata);
+    //get LONG
+    gpsdatatmp.remove(31);
+    gpsdatatmp.remove(0, 27);
+    gpslng = gpsdatatmp.toInt();
+    gpsdatatmp = "";
+    gpsdatatmp.concat(gpsdata);
+    //get LAT
+    gpsdatatmp.remove(31);
+    gpsdatatmp.remove(0, 27);
+    gpslat = gpsdatatmp.toInt();
+    gpsdatatmp = "";
+    gpsdatatmp.concat(gpsdata);
+    //get ALT
+    gpsdatatmp.remove(31);
+    gpsdatatmp.remove(0, 27);
+    gpsalt = gpsdatatmp.toInt();
+    gpsdatatmp = "";
+    gpsdatatmp.concat(gpsdata);
+    //get SAT
+    gpsdatatmp.remove(31);
+    gpsdatatmp.remove(0, 27);
+    gpssat = gpsdatatmp.toInt();
+    gpsdatatmp = "";
+  }
+  while (gpslng <= 0.01 && gpslat <= 0.01 && gpsalt <= 0.01);
+  switchGPSonoff( "AT+CGNSPWR=0", 1000, DEBUG);
   //FGSM baud rate is 19200 max through software serial
-  switchGPSonoff( "AT+UART=19200,8,1,0,0",1000,DEBUG);
+  switchGPSonoff( "AT+UART=19200,8,1,0,0", 1000, DEBUG);
+  //FGSM baud rate is 115200 max through HW serial PINs 0-1)
+  //switchGPSonoff( "AT+UART=115200,8,1,0,0",1000,DEBUG);
+  Serial.println(gpslng);
+  Serial.println(gpslat);
+  Serial.println(gpsalt);
+  Serial.println(gpssat);
 }
 
 String switchGPSonoff(String command, const int timeout, boolean debug)
 {
-  String response = "";    
-  ss.println(command); 
-  long int time = millis();   
-  while( (time+timeout) > millis())
-  {
-    while(ss.available())
-    {       
-      char c = ss.read(); 
-      response+=c;
-    }  
-  }    
-  if(debug)
-  {
-    Serial.print(response);
-  }    
+  //Serial.println("switchGPSonoff");
+  String response = "";
+  ss.println(command);
+  long int time = millis();
+  while ( (time + timeout) > millis())
+  {
+    while (ss.available())
+    {
+      char c = ss.read();
+      response += c;
+    }
+  }
+  if (debug)
+  {
+    Serial.println(response);
+  }
   return response;
 }
 
 
 String sendData(String command, const int timeout, boolean debug)
 {
-  String response = "";    
-  ss.println(command); 
-  long int time = millis();   
-  while( (time+timeout) > millis())
-  {
-    while(ss.available())
-    {       
-      gps.encode(ss.read());
-      char c = ss.read(); 
-      response+=c;
-    }  
-  }    
-  if(debug)
-  {
-    Serial.print(response);
-  }    
+  String response = "";
+  ss.println(command);
+  long int time = millis();
+  while ( (time + timeout) > millis())
+  {
+    while (ss.available())
+    {
+      char c = ss.read();
+      response += c;
+    }
+  }
+  if (debug)
+  {
+    Serial.println(response);
+  }
   return response;
 }
 

  winddiravg[seconds_2m] = currentDirection;

  //Check to see if this is a gust for the minute
  if(currentSpeed > windgust_10m[minutes_10m])
  {
    windgust_10m[minutes_10m] = currentSpeed;
    windgustdirection_10m[minutes_10m] = currentDirection;
  }

  //Check to see if this is a gust for the day
  if(currentSpeed > windgustms)
  {
    windgustms = currentSpeed;
    windgustdir = currentDirection;
  }
  seconds += loopMSecond/1000;
  if(++seconds > 59) seconds = 0;
  if(++minutes > 59) minutes = 0;
  minutes += seconds/60;
  minutes_10m += seconds/60;
  if(++minutes_10m > 9){
    minutes_10m = 0;
    for (i=0;i<10;i++) windgust_10m[i] = 0;
  }
  rainHour[minutes] = 0; //Zero out this minute's rainfall amount
  windgust_10m[minutes_10m] = 0; //Zero out this minute's gust

  calcWeather(); //Go calc all the various sensors

  Serial.println();
  Serial.print(gpslng, 6);//[0]
  Serial.print(",");
  Serial.print(gpslat, 6);//[1]
  Serial.print(",");
  Serial.print(gpsalt);//[2]
  Serial.print(",");
  Serial.print(gpssat);//[3]

  char sz[32];
  Serial.print(",");
  sprintf(sz, "%02d-%02d-%02d", gpsyear, gpsmonth, gpsday);//[4]
  Serial.print(sz);

  Serial.print(",");
  sprintf(sz, "%02d:%02d:%02d", gpshour, gpsminute, gpssecond);//[5]
  Serial.print(sz);

  Serial.print(",");
  Serial.print(get_wind_direction());//[6]
