void loop() {
connectWeb("TCP", HOST, PAGE, 443);
requestPage(HOST, PAGE, 443);
if(esp8266.find("+IPD"))
Serial.print("found IPD");
else Serial.print("cant find ipd"); //it shows me this...
}
And here;s the connectweb
String connectWeb(String type, String address, String page, int port)
{
String cmd = "AT+CIPSTART=\"";
String response;
cmd += type;
cmd += "\",\"";
cmd += address;
cmd += "\",\"";
cmd += port;
cmd += "\"";
esp8266.println(cmd);
Serial.println(cmd);
delay(5000);
while (esp8266.available()) {
char c = esp8266.read(); // read the next character. this is because it prints one char at a time
response += c;
delay(50);
}
return response;
}
Requesting page
// Request a page from an HTTP server.
boolean requestPage(String host, String page, int port)
{
// Create raw HTTP request for web page.
String http_req = "GET " + page + " HTTP/1.1\r\nHost: " + host + ":" + port + "\r\n\r\n";
// Ready the module to receive raw data.
String cmd = "AT+CIPSEND=0,";
cmd = cmd + http_req.length(); // Tell the ESP8266 how long the coming HTTP request is.
Serial.print(cmd);
Serial.println("requesting page...");
sendData(cmd,1000);
}