Search code examples
arduinoat-commandesp8266arduino-esp8266

Connect ESP8266 to a network


I have connected correctly my ESP8266 to an Arduino UNO R3. It responds to AT commands but when I ask for the operation mode with AT+CWMODE? it responds with state +CWMODE:2 and as a result when I send the AT+CWLAP command the respond is an error. If I am right the CWMODE should be 3 in order to be able to connect to a Wi-Fi network. If anyone could help me, I would really appreciate it.


Solution

  • CWMODE sets the mode of connectivity.

    AT+CWMODE? queries the actual mode. AT+CWMODE=1 sets the mode for STA. AT+CWMODE=2 sets the mode for AP. AT+CWMODE=3 sets the mode for both AP and STA.

    You can use mode 1 for actual Wifi connection.