User manual

success &= sendCom("AT+CIPMODE=0", "OK");
success &= sendCom("AT+CIPMUX=0", "OK");
return success;
}
At the beginning of the function, the variable success is set to true first, since this
variable is now and-linked to various functions. This means that even if only one of
the functions that have the value returns false, success will also immediately be-
come false and the entire configuration will have failed. The first AT-command to
be reviewed for success this way is the Reset-command, which is nearly always
performed at the beginning of the program to ensure that prior tests are not still
using the module. However, it may take up to five seconds until the module returns
the message ready. Therefore, the time-out for esp8266.findUtil is increased just
before thesendCom()-function. After the reset, the time-out is returned to the stan-
dard value of one second.
This is followed by calling a self-defined function called configStation(), which will
be discussed in the next section. It is used to connect the module to your home
network. For this, the parameters SSID and PASSWORD will be transmitted that
you entered at the beginning of the program. If the connection has been success-
fully established, the success message and then the current IP of the module are
transferred to the serial monitor. At the end of the function, parameters will be set
that I will deal with later. Last, the variable success will be returned, which hope-
fully has kept the value true.
boolean configStation(String vSSID, String vPASSWORT)
{
boolean success = true;
success &= (sendCom("AT+CWMODE=1", "OK"));
esp8266.setTimeout(20000);
success &= (sendCom("AT+CWJAP=\"" + String(vSSID) + "\",\""
+ String(vPASSWORT) + "\"", "OK"));
esp8266.setTimeout(1000);