AT+CIPSEND fails to send complete string

miklstel
Posts: 1
Joined: Mon Aug 09, 2021 5:14 am

AT+CIPSEND fails to send complete string

Postby miklstel » Mon Aug 09, 2021 6:52 am

I'm trying to send data from my DIY weather station to a website using AT Commands. My Hardware is an Arduino Nano using Software Serial to send data to ESP8266-01. Whenever the GET statement's length exceeds about 270 characters the AT+CIPSEND fails. I'm wondering if anyone else has experienced this and could offer some advice. Thanks

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

Her Mary
Posts: 537
Joined: Mon Oct 27, 2014 11:09 am

Re: AT+CIPSEND fails to send complete string

Postby Her Mary » Thu Aug 19, 2021 3:55 pm

The latest official AT supports HTTP, maybe you can have a try with it. https://docs.espressif.com/projects/esp ... mands.html

Who is online

Users browsing this forum: No registered users and 4 guests