Figure 1 – Output of the AT command to set the WiFi mode.
Then, we will configure the access point we are setting with the AT+CWSAP command. This command receives as parameters the name of the network we are setting, the password, the channel and the encryption mode. Note that this last parameter is passed as a number, with the options available listed bellow:
0 – Open
2 – WPA_PSK
3 – WPA2_PSK
4 – WPA_WPA2_PSK
We are going to call our network “ESP”, set a password equal to “password”, define channel 1 and encryption type equal to WPA_WPA2_PSK. Check the command we need to send to the device bellow:
The result of the command is shown in figure 2. As can be seen, an OK message should be returned if everything is correctly configured.