My Code is as follows->
#include <SoftwareSerial.h>
SoftwareSerial ESP8266(8,9);
String inData;
void setup() {
ESP8266.println("AT");
delay(1000);
ESP8266.println("AT+RST");
}
void loop() {
String cmd = "AT+CIPSTART=\"TCP\",\"";
cmd += "api.thingspeak.com"; // 184.106.153.149 thingspeak IP address
cmd += "\",80";
ESP8266.println(cmd);
if(ESP8266.find("Error"))
{
Serial.println("AT+CIPSTART error");
return;
}
String hostt = "GET /apps/thinghttp/send_request?api_key=689WYA85WW1VJSBA";
hostt += "\r\n";
hostt += "Host:api.thingspeak.com";
hostt += "\r\n\r\n\r\n\r\n\r\n\r\n";
ESP8266.println(hostt);
cmd = "AT+CIPSEND=";
cmd += String(hostt.length());
ESP8266.println(cmd);
if(ESP8266.find(">")){
ESP8266.print(hostt);
}
else{
ESP8266.println("AT+CIPCLOSE");
// alert user
Serial.println("AT+CIPCLOSE");
}
delay(5000);
}
Is this the write code? Where am I going wrong? I am not able to see the required fetched data. Help me with this.