This is the code I am using
#include <stdlib.h>
// connect 10 to TX of Serial USB
// connect 11 to RX of serial USB
SoftwareSerial ser(10, 11); // RX, TX
void setup() {
// enable debug serial
Serial.begin(9600);
// enable software serial
ser.begin(9600);
// reset ESP8266
ser.println("AT+RST");
}
// the loop
void loop() {
// TCP connection
String cmd = "AT+CIPSTART=\"TCP\",\"";
cmd += "api.pushingbox.com"; //
cmd += "\",80";
ser.println(cmd);
Serial.println(cmd);
if(ser.find("Error")){
Serial.println("AT+CIPSTART error");
return;
}
// prepare GET string
String getStr = "GET api.pushingbox.com/pushingbox?devid=vB142D4A918331D6&tempdata=53";
// send data length
cmd = "AT+CIPSEND=";
cmd += String(getStr.length());
ser.println(cmd);
Serial.println(cmd);
if(ser.find(">")){
ser.print(getStr);
Serial.print(getStr);
}
else{
ser.println("AT+CIPCLOSE");
// alert user
Serial.println("AT+CIPCLOSE");
}
delay(16000);
}
I also tried to do GET requests using AT commands via serial monitor but it gets timeout as I enter the values.