Hello,
Im trying to get html response from server via esp01 module
when using the serial monitor in arduino studio everything works fine
here is the serial monitor output
AT+CIPSTART="TCP","aaaa.aaaa",80
CONNECT
OK
AT+CIPSEND=43
OK
>
Recv 43 bytes
SEND OK
+IPD,227:HTTP/1.1 200 OK
Date: Sat, 19 Jan 2019 18:42:58 GMT
Server: Apache
X-Powered-By: PHP/7.2.11
Vary: Accept-Encoding,User-Agent
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8
10
Hello from server
0
CLOSED
but when im trying to do the same from the sketch my response is returned partially (63 bytes always)
AT+CIPSTART="TCP","aaaa.aaaa",80
CONNECT
OK
AT+CIPSEND=43
OK
>
Recv 43 bytes
SEND OK
+IPD,227:HTTP/1.1 200 OK
Date: S
it ends on the first letter of date for some reason
here is my sketch
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX //serial for comunication with esp
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
// set the data rate for the SoftwareSerial port
mySerial.begin(9600);
mySerial.setTimeout(5000);//dont know if i need this
delay(10000);
//check wifi module
mySerial.println("AT");
delay(1000);
if(mySerial.find("OK"))
{
Serial.println("Initializing");
}else{
Serial.println("Error initializing");
}
}
void loop() { // run over and over
Serial.println("go");
mySerial.println("AT+CIPSTART=\"TCP\",\"aaaa.aaaa\",80");
delay(1000);
while(mySerial.available()){
Serial.write(mySerial.read());
delay(1);
}
mySerial.println("AT+CIPSEND=43");
delay(1000);
while(mySerial.available()){
Serial.write(mySerial.read());
delay(1);
}
mySerial.println("GET /load.php HTTP/1.1");
delay(100);
while(mySerial.available()){
Serial.write(mySerial.read());
delay(1);
}
mySerial.println("Host: aaaa.aaaa");
delay(100);
while(mySerial.available()){
Serial.write(mySerial.read());
delay(1);
}
mySerial.println("");
delay(2000);
while(mySerial.available()){
Serial.write(mySerial.read());
//delay(100);
}
delay(5000);
}
what is the reason for this behavior? how can i fix this?
i've tried increasing baud rate. this did not helped.