i connect esp8266 to Arduino-Uno (WiFi Controlled LED using ESP8266 and Arduino) it's working well. but, when in browser i call (http://192.168.1.***/?led=ON) i want esp8266 respond and display message like that is (Ok/No) on that page, can we do that with AT Commands? or any other way ...
void loop() {
if (esp8266.available()) {
if (esp8266.find("+IPD,")) {
String msg;
esp8266.find("?");
msg = esp8266.readStringUntil(' ');
String command1 = msg.substring(0, 3);
String command2 = msg.substring(4);
if (DEBUG) {
Serial.println(command1); // Must print "led"
Serial.println(command2); // Must print "ON" or "OFF"
}
delay(100);
if (command2 == "ON") {
digitalWrite(led_pin, HIGH);
// here i want send led is on now
} else {
digitalWrite(led_pin, LOW);
// here i want send led is off now
}
}
}
}