 //DEBUG
 //#include <MemoryFree.h>
+#include<string.h>
 #include <Wire.h> //I2C needed for sensors
 //https://github.com/sparkfun/SparkFun_MPL3115A2_Breakout_Arduino_Library
 #include "MPL3115A2.h" //Pressure sensor

  printWeather();
  //Wait 1 second, and gather GPS data
  delay(1000);
  getgps();
  //REPORTING
  //Check for a new hour passing
  //Serial.print(hourReport);

    gpsdatatmp.remove(41);
    gpsdatatmp.remove(0, 39);
    gpssecond = gpsdatatmp.toInt() ;
    gpsdatatmp = "";
    gpsdatatmp.concat(gpsdata);
    //Test if there is Lat/Long data
    tmp = gpsdatatmp[46];
    if (!tmp.equals(",") && LATLONG == true) {
      //get LAT (8.424)
      gpslat = tmp.toInt();
      tmp = gpsdatatmp[48];
      gpslat += 0.1 * tmp.toInt();
      tmp = gpsdatatmp[49];
      gpslat += 0.01 * tmp.toInt();
      tmp = gpsdatatmp[50];
      gpslat += 0.001 * tmp.toInt();
      //get LONG (80.357)
      tmp = gpsdatatmp[55];
      gpslng = 10 * tmp.toInt();
      tmp = gpsdatatmp[56];
      gpslng += tmp.toInt();
      tmp = gpsdatatmp[58];
      gpslng += 0.1 * tmp.toInt();
      tmp = gpsdatatmp[59];
      gpslng += 0.01 * tmp.toInt();
      tmp = gpsdatatmp[60];
      gpslng += 0.001 * tmp.toInt();
      //get ALT
      tmp = gpsdatatmp[66];
      if (tmp.equals(".")) {
        tmp = gpsdatatmp[65];
        gpsalt = tmp.toInt();
        tmp = gpsdatatmp[67];
        gpsalt += 0.1 * tmp.toInt();
      }
      tmp = gpsdatatmp[67];
      if (tmp.equals(".")) {
        tmp = gpsdatatmp[65];
        gpsalt = 10 * tmp.toInt();
        tmp = gpsdatatmp[66];
        gpsalt += tmp.toInt();
        tmp = gpsdatatmp[68];
        gpsalt += 0.1 * tmp.toInt();
      }
      tmp = gpsdatatmp[68];
      if (tmp.equals(".")) {
        tmp = gpsdatatmp[65];
        gpsalt = 100 * tmp.toInt();
        tmp = gpsdatatmp[66];
        gpsalt += 10 * tmp.toInt();
        tmp = gpsdatatmp[67];
        gpsalt += tmp.toInt();
        tmp = gpsdatatmp[68];
        gpsalt += 0.1 * tmp.toInt();
      }
      //get SAT
      gpsdatatmp.remove(71);
      gpsdatatmp.remove(0, 69);
      gpssat = gpsdatatmp.toInt();
      gpsdatatmp = "";
      gpsdata = "";
    }
  }
  while (gpsyear < 2017 || gpslng <= 0.01 || gpslat <= 0.01 || gpsalt <= 0.01); // SHOULD BE IN 2017 OR MORE TO BE VALID
  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);
  //FGSM baud rate is 115200 max through HW serial PINs 0-1)
  //switchGPSonoff( "AT+UART=115200,8,1,0,0",1000,DEBUG);
  digitalWrite(SIM808, LOW); //SWITCH OFF SIM808
}

String switchGPSonoff(String command, const int timeout, boolean debug)
