User manual

//-------Controll ESP--------
boolean sendCom(String command, char respond[])
{
esp8266.println(command);
if (esp8266.findUntil(respond, "ERROR"))
{
return true;
}
else
{
debug("ESP SEND ERROR: " + command);
return false;
}
}
When you call the function, you therefore need to submit the command and the
expected return value to the function, e.g. AT and the expected return value OK.
println() transmits the command and finally waits until the expected return value or
an ERROR is received. When the expectation is met, the function returns the val-
ue true. Otherwise, the module will use the debug()-function to return an ESP
SEND ERROR and the sent command, so that it is easy to check which command
caused the problem.
Not all AT-commands have a unique or one-line return value. If, e.g., the IP ad-
dress is queried, there usually is no previously known value. Therefore, a second
sendCom()-function exists that only needs the parameter command and will then
return the entire received string. The string should not be too long, since the buffer
of SoftwareSerial can overflow.
String sendCom(String command)
{
esp8266.println(command);