Here is the function that is in question. I have also attached the complete sketch.
void sendStringWUnderground(float windSpeedMPH, float gustWindSpeedMPH){
String cmd1 = "AT+CIPSTART=\"TCP\",\"";
cmd1 += "rtupdate.wunderground.com"; // wunderground
cmd1 += "\",80";
Serial.println(cmd1);
esp8266Module.println(cmd1);
if (esp8266Module.find("Error")) {
Serial.println("AT+CIPSTART error");
return;
}
String cmd = "GET /weatherstation/updateweatherstation.php?;
cmd += ID;
cmd += "&PASSWORD=";
cmd += PASSWORD;
cmd += "&dateutc=now";
cmd += "&winddir=";
cmd += getCalulatedDirection();
//cmd += "&windspeedmph=";
//cmd += windSpeedMPH;
//cmd += "&windgustmph=";
//cmd += gustWindSpeedMPH;
cmd += "&tempf=";
cmd += getTemperatureValue();
cmd += "&dewptf=";
cmd += getDewPointValue();
cmd += "&humidity=";
cmd += getHumidityValue();
//cmd += "&baromin=";
//cmd += getBarPresValue();
//cmd += "&solarradiation=";
//cmd += solar;
//cmd += "&UV=";
//cmd += UVmax;
//cmd += "&rainin=";
//cmd += rain1h;
//cmd += "&dailyrainin=";
//cmd += rain24h;
cmd += "&softwaretype=Arduino-ESP8266&action=updateraw&realtime=1&rtfreq=30"; // &softwaretype=Arduino%20UNO%20version1
cmd += "/ HTTP/1.1\r\nHost: rtupdate.wunderground.com:80\r\nConnection: close\r\n\r\n";
cmd1 = "AT+CIPSEND=";
cmd1 += String(cmd.length());
Serial.println(cmd1);
esp8266Module.println(cmd1);
if (esp8266Module.find(">")) {
Serial.println(cmd);
esp8266Module.print(cmd);
Serial.println("Data send OK");
}
else {
esp8266Module.println("AT+CIPCLOSE");
Serial.println("Connection closed");
Serial.println(" ");
}
}