ESP8266 Developer Zone The Official ESP8266 Forum 2021-08-19T15:55:41+08:00 https://bbs.espressif.com:443/feed.php?f=16&t=75195 2021-08-19T15:55:41+08:00 2021-08-19T15:55:41+08:00 https://bbs.espressif.com:443/viewtopic.php?t=75195&p=100138#p100138 <![CDATA[Re: AT+CIPSEND fails to send complete string]]> https://docs.espressif.com/projects/esp ... mands.html

Statistics: Posted by Her Mary — Thu Aug 19, 2021 3:55 pm


]]>
2021-08-09T06:52:27+08:00 2021-08-09T06:52:27+08:00 https://bbs.espressif.com:443/viewtopic.php?t=75195&p=100117#p100117 <![CDATA[AT+CIPSEND fails to send complete string]]>
Here is the function that is in question.

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 += "&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(" ");
}
}

Statistics: Posted by miklstel — Mon Aug 09, 2021 6:52 am


]]>