User manual
008
return success;
009
}
The function configStation() has been called in the espConfig()-function. Here,
setting of the WLAN-mode to station mode with the command CWMODE and then
connection to the network via the CWJAP-command are performed. It can take
quite a long time until the connection is established. Therefore, the time-out is
briefly raised to 20 seconds here. If you prefer dual WLAN-mode, you can set
CWMODE to 3 here.
001
boolean configAP()
002
{
003
boolean success = true;
004
005
success &= (sendCom("AT+CWMODE=2", "OK"));
006
success &= (sendCom("AT+CWSAP=\"NanoESP\",\"\",5,0",
"OK"));
007
008
return success;
009
}
The function configAP() is not called here, but should be mentioned briefly any-
way. It is the counterpart to the configStation()-function, since it is used to set the
module to Access Point. A long time-out is not necessary here, since the module
can process the CWSAP-command much faster. In later tests, the espConfig()-
function instead of the
configStation() will be used to call the configAP()-function.
001
void setup()
002
{
003
// Open serial communications and wait for port to open:
004
Serial.begin(19200);