User manual

if (esp8266.find("+IPD,"))
{
debug("Incoming Request");
int connectionId = esp8266.parseInt();
if (esp8266.findUntil("LED","\n")) digitalWrite(LED, !digitalRead(LED));
String webpage = "<h1>Hello World!</h1>Open [IP]/LED to Toggle LED on D9";
if (sendCom("AT+CIPSEND=" + String(connectionId) + "," + String(webpage.length()),
">"))
{
sendCom(webpage,"SEND OK");
sendCom("AT+CIPCLOSE=" + String(connectionId),"OK");
debug("Send and Close");
}
}
}
}
To start the web server, you can use a simple function again. It is called con-
figTCPServer(). This is simply what you entered manually before. The loop-routine
waits for inbound data. When these data contain »LED«, the LED is toggled. The
routine does not care about where »LED« is placed. Therefore, the command in
the submitted URL is legitimate. In this experiment, the website is in the webpage-
variable and contains the following text:
<h1>Hello World!</h1>
Open [IP]/LED to Toggle LED on D9
<h1> is an instruction to the browser to display the text until </h1> as a headline