A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.espressif.com/projects/esp-at/en/latest/AT_Command_Set/Wi-Fi_AT_Commands.html below:

Website Navigation


Wi-Fi AT Commands - ESP32

Wi-Fi AT Commands

[中文]

Introduction

Important

The default AT firmware supports all the AT commands except AT+CWJEAP mentioned on this page. If you need to modify the commands supported by ESP32 by default, please compile the ESP-AT project by following the steps in Compile ESP-AT Project Locally documentation. In the project configuration during the fifth step, make the following selections (Each item below is independent. Choose it according to your needs):

AT+CWINIT: Initialize or Deinitialize Wi-Fi Driver Query Command

Function:

Query the Wi-Fi initialization status of ESP32 device.

Command:

Response:

Set Command

Function:

Initialize or deinitialize Wi-Fi driver of ESP32 device.

Command:

Response:

Parameters Note Example
// Deinitialize Wi-Fi driver
AT+CWINIT=0
AT+CWMODE: Query/Set the Wi-Fi Mode (Station/SoftAP/Station+SoftAP) Query Command

Function:

Query the Wi-Fi mode of ESP32.

Command:

Response:

Set Command

Function:

Set the Wi-Fi mode of ESP32.

Command:

AT+CWMODE=<mode>[,<auto_connect>]

Response:

Parameters Note Example AT+CWSTATE: Query the Wi-Fi state and Wi-Fi information Query Command

Function:

Query the Wi-Fi state and Wi-Fi information of ESP32.

Command:

Response:

+CWSTATE:<state>,<"ssid">

OK
Parameters Note AT+CWCONFIG: Query/Set Wi-Fi Inactive Time and Listen Interval Time Query Command

Command:

Response:

+CWCONFIG:<ap_inactive_time>,<sta_inactive_time>,<listen_interval>

OK
Set Command

Command:

AT+CWCONFIG=[<ap_inactive_time>][,<sta_inactive_time>][,<listen_interval>]

Response:

Parameters Note AT+CWJAP: Connect to an AP Query Command

Function:

Query the AP to which the ESP32 Station is already connected.

Command:

Response:

+CWJAP:<"ssid">,<"bssid">,<channel>,<rssi>,<pci_en>,<reconn_interval>,<listen_interval>,<scan_mode>,<pmf>
OK
Set Command

Function:

Connect an ESP32 station to a targeted AP.

Command:

AT+CWJAP=[<"ssid">],[<"pwd">][,<"bssid">][,<pci_en>][,<reconn_interval>][,<listen_interval>][,<scan_mode>][,<jap_timeout>][,<pmf>]

Response:

WIFI CONNECTED
WIFI GOT IP

OK
[WIFI GOT IPv6 LL]
[WIFI GOT IPv6 GL]

or

+CWJAP:<error code>
ERROR
Execute Command

Function:

Connect an ESP32 station to a targeted AP with last Wi-Fi configuration.

Command:

Response:

WIFI CONNECTED
WIFI GOT IP

OK
[WIFI GOT IPv6 LL]
[WIFI GOT IPv6 GL]

or

+CWJAP:<error code>
ERROR
Parameters Notes Example
// If the target AP's SSID is "abc" and the password is "0123456789", the command should be:
AT+CWJAP="abc","0123456789"

// If the target AP's SSID is "ab\,c" and the password is "0123456789"\", the command should be:
AT+CWJAP="ab\\\,c","0123456789\"\\"

// If multiple APs all have the SSID of "abc", the target AP can be found by BSSID:
AT+CWJAP="abc","0123456789","ca:d7:19:d8:a6:44"

// If esp-at is required that connect to a AP by protected management frame, the command should be:
AT+CWJAP="abc","0123456789",,,,,,,3
AT+CWRECONNCFG: Query/Set the Wi-Fi Reconnecting Configuration Query Command

Function:

Query the configuration of Wi-Fi reconnect.

Command:

Response:

+CWRECONNCFG:<interval_second>,<repeat_count>
OK
Set Command

Function:

Set the configuration of Wi-Fi reconnect.

Command:

AT+CWRECONNCFG=<interval_second>,<repeat_count>

Response:

Parameters Example
// The ESP32 station tries to reconnect to AP at the interval of one second for 100 times.
AT+CWRECONNCFG=1,100

// The ESP32 station will not reconnect to AP when disconnected.
AT+CWRECONNCFG=0,0
Notes AT+CWLAPOPT: Set the Configuration for the Command AT+CWLAP Set Command

Command:

AT+CWLAPOPT=<reserved>,<print mask>[,<rssi filter>][,<authmode mask>]

Response:

or

Parameters Example
// The first parameter is reserved;
// The second parameter is 31, namely 0x1F, meaning that the corresponding bits of <print mask> are set to 1. All parameters will be shown in the result of AT+CWLAP.
AT+CWLAPOPT=,31
AT+CWLAP

// Just show the AP which authmode is OPEN
AT+CWLAPOPT=,31,-100,1
AT+CWLAP
AT+CWLAP: List Available APs Set Command

Function:

Query the APs with specified parameters, such as the SSID, MAC address, or channel.

Command:

AT+CWLAP=[<"ssid">][,<"mac">][,<channel>][,<scan_type>][,<scan_time_min>][,<scan_time_max>][,<ext_channel_bitmap>]
Execute Command

Function:

List all available APs.

Command:

Response:

+CWLAP:(<ecn>,<"ssid">,<rssi>,<"mac">,<channel>,<freq_offset>,<freqcal_val>,<pairwise_cipher>,<group_cipher>,<bgn>,<wps>)

OK
Parameters Example
AT+CWLAP="Wi-Fi","ca:d7:19:d8:a6:44",6,0,400,1000

// Search for APs with a designated SSID:
AT+CWLAP="Wi-Fi"
AT+CWQAP: Disconnect from an AP Execute Command

Command:

Response:

AT+CWSAP: Query/Set the configuration of an ESP32 SoftAP Query Command

Function:

Query the configuration parameters of an ESP32 SoftAP.

Command:

Response:

+CWSAP:<"ssid">,<"pwd">,<channel>,<ecn>,<max conn>,<ssid hidden>
OK
Set Command

Function:

Set the configuration of an ESP32 SoftAP.

Command:

AT+CWSAP=<"ssid">,<"pwd">,<chl>,<ecn>[,<max conn>][,<ssid hidden>]

Response:

Parameters Notes Example
AT+CWSAP="ESP","1234567890",5,3
AT+CWLIF: Obtain IP Address of the Station That Connects to an ESP32 SoftAP Execute Command

Command:

Response:

+CWLIF:<ip addr>,<mac>

OK
Parameters Note AT+CWQIF: Disconnect Stations from an ESP32 SoftAP Execute Command

Function:

Disconnect all stations that are connected to the ESP32 SoftAP.

Command:

Response:

Set Command

Function:

Disconnect a specific station from the ESP32 SoftAP.

Command:

Response:

Parameter AT+CWDHCP: Enable/Disable DHCP Query Command

Command:

Response:

Set Command

Function:

Enable/disable DHCP.

Command:

AT+CWDHCP=<operate>,<mode>

Response:

Parameters Notes Example
// Enable Station DHCP. If the last DHCP mode is 2, the current DHCP mode will be 3.
AT+CWDHCP=1,1

// Disable SoftAP DHCP. If the last DHCP mode is 3, the current DHCP mode will be 1.
AT+CWDHCP=0,2
AT+CWDHCPS: Query/Set the IPv4 Addresses Allocated by an ESP32 SoftAP DHCP Server Query Command

Command:

Response:

+CWDHCPS:<lease time>,<start IP>,<end IP>
OK
Set Command

Function:

Set the IPv4 address range of the ESP32 SoftAP DHCP server.

Command:

AT+CWDHCPS=<enable>,<lease time>,<"start IP">,<"end IP">

Response:

Parameters Notes Example
AT+CWDHCPS=1,3,"192.168.4.10","192.168.4.15"

AT+CWDHCPS=0 // Disable the settings and use the default IPv4 address range.
AT+CWAUTOCONN: Query/Set Automatic Connection to an AP When Powered on Query Command

Command:

Response:

Set Command

Command:

Response:

Parameters Note Example AT+CWAPPROTO: Query/Set the 802.11 b/g/n Protocol Standard of SoftAP Mode Query Command

Command:

Response:

Set Command

Command:

Response:

Parameters Note AT+CWSTAPROTO: Query/Set the 802.11 b/g/n Protocol Standard of Station Mode Query Command

Command:

Response:

+CWSTAPROTO:<protocol>
OK
Set Command

Command:

Response:

Parameters Note AT+CIPSTAMAC: Query/Set the MAC Address of an ESP32 Station Query Command

Function:

Query the MAC address of the ESP32 Station.

Command:

Response:

Set Command

Function:

Set the MAC address of an ESP32 station.

Command:

Response:

Parameters Notes Example
AT+CIPSTAMAC="1a:fe:35:98:d3:7b"
AT+CIPAPMAC: Query/Set the MAC Address of an ESP32 SoftAP Query Command

Function:

Query the MAC address of the ESP32 SoftAP.

Command:

Response:

Set Command

Function:

Set the MAC address of the ESP32 SoftAP.

Command:

Response:

Parameters Notes Example
AT+CIPAPMAC="18:fe:35:98:d3:7b"
AT+CIPSTA: Query/Set the IP Address of an ESP32 Station Query Command

Function:

Query the IP address of the ESP32 Station.

Command:

Response:

+CIPSTA:ip:<"ip">
+CIPSTA:gateway:<"gateway">
+CIPSTA:netmask:<"netmask">
+CIPSTA:ip6ll:<"ipv6 addr">
+CIPSTA:ip6gl:<"ipv6 addr">

OK
Set Command

Function:

Set the IPv4 address of the ESP32 station.

Command:

AT+CIPSTA=<"ip">[,<"gateway">,<"netmask">]

Response:

Parameters Notes Example
AT+CIPSTA="192.168.6.100","192.168.6.1","255.255.255.0"
AT+CIPAP: Query/Set the IP Address of an ESP32 SoftAP Query Command

Function:

Query the IP address of the ESP32 SoftAP.

Command:

Response:

+CIPAP:ip:<"ip">
+CIPAP:gateway:<"gateway">
+CIPAP:netmask:<"netmask">
+CIPAP:ip6ll:<"ipv6 addr">

OK
Set Command

Function:

Set the IPv4 address of the ESP32 SoftAP.

Command:

AT+CIPAP=<"ip">[,<"gateway">,<"netmask">]

Response:

Parameters Notes Example
AT+CIPAP="192.168.5.1","192.168.5.1","255.255.255.0"
AT+CWSTARTSMART: Start SmartConfig Execute Command

Function:

Start SmartConfig of the type ESP-TOUCH+AirKiss.

Command:

Set Command

Function:

Start SmartConfig of a designated type.

Command:

AT+CWSTARTSMART=<type>[,<auth floor>][,<"esptouch v2 key">]

Response:

Parameters Notes Example
AT+CWMODE=1
AT+CWSTARTSMART
AT+CWSTOPSMART: Stop SmartConfig Execute Command

Command:

Response:

Note Example
AT+CWMODE=1
AT+CWSTARTSMART
AT+CWSTOPSMART
AT+WPS: Enable the WPS Function Set Command

Command:

AT+WPS=<enable>[,<auth floor>]

Response:

Parameters Notes Example AT+CWJEAP: Connect to a WPA2 Enterprise AP Query Command

Function:

Query the configuration information of the Enterprise AP to which the ESP32 station is already connected.

Command:

Response:

+CWJEAP:<"ssid">,<method>,<"identity">,<"username">,<"password">,<security>
OK
Set Command

Function:

Connect to the targeted Enterprise AP.

Command:

AT+CWJEAP=<"ssid">,<method>,<"identity">,<"username">,<"password">,<security>[,<jeap_timeout>]

Response:

or

Parameters Example
// Connect to EAP-TLS mode Enterprise AP, set identity, verify server certificate and load client certificate
AT+CWJEAP="dlink11111",0,"example@espressif.com",,,3

// Connect to EAP-PEAP mode Enterprise AP, set identity, username and password, not verify server certificate and not load client certificate
AT+CWJEAP="dlink11111",1,"example@espressif.com","espressif","test11",0

Error Code:

The WPA2 Enterprise error code will be prompt as ERR CODE:0x<%08x>.

AT_EAP_MALLOC_FAILED

0x8001

AT_EAP_GET_NVS_CONFIG_FAILED

0x8002

AT_EAP_CONN_FAILED

0x8003

AT_EAP_SET_WIFI_CONFIG_FAILED

0x8004

AT_EAP_SET_IDENTITY_FAILED

0x8005

AT_EAP_SET_USERNAME_FAILED

0x8006

AT_EAP_SET_PASSWORD_FAILED

0x8007

AT_EAP_GET_CA_LEN_FAILED

0x8008

AT_EAP_READ_CA_FAILED

0x8009

AT_EAP_SET_CA_FAILED

0x800A

AT_EAP_GET_CERT_LEN_FAILED

0x800B

AT_EAP_READ_CERT_FAILED

0x800C

AT_EAP_GET_KEY_LEN_FAILED

0x800D

AT_EAP_READ_KEY_FAILED

0x800E

AT_EAP_SET_CERT_KEY_FAILED

0x800F

AT_EAP_ENABLE_FAILED

0x8010

AT_EAP_ALREADY_CONNECTED

0x8011

AT_EAP_GET_SSID_FAILED

0x8012

AT_EAP_SSID_NULL

0x8013

AT_EAP_SSID_LEN_ERROR

0x8014

AT_EAP_GET_METHOD_FAILED

0x8015

AT_EAP_CONN_TIMEOUT

0x8016

AT_EAP_GET_IDENTITY_FAILED

0x8017

AT_EAP_IDENTITY_LEN_ERROR

0x8018

AT_EAP_GET_USERNAME_FAILED

0x8019

AT_EAP_USERNAME_LEN_ERROR

0x801A

AT_EAP_GET_PASSWORD_FAILED

0x801B

AT_EAP_PASSWORD_LEN_ERROR

0x801C

AT_EAP_GET_SECURITY_FAILED

0x801D

AT_EAP_SECURITY_ERROR

0x801E

AT_EAP_METHOD_SECURITY_UNMATCHED

0x801F

AT_EAP_PARAMETER_COUNTS_ERROR

0x8020

AT_EAP_GET_WIFI_MODE_ERROR

0x8021

AT_EAP_WIFI_MODE_NOT_STA

0x8022

AT_EAP_SET_CONFIG_FAILED

0x8023

AT_EAP_METHOD_ERROR

0x8024

Note AT+CWHOSTNAME: Query/Set the Host Name of an ESP32 Station Query Command

Function:

Query the host name of ESP32 Station.

Command:

Response:

+CWHOSTNAME:<hostname>

OK
Set Command

Function:

Set the host name of ESP32 Station.

Command:

AT+CWHOSTNAME=<"hostname">

Response:

If the Station mode is not enabled, the command will return:

Parameters Note Example
AT+CWMODE=3
AT+CWHOSTNAME="my_test"
AT+CWCOUNTRY: Query/Set the Wi-Fi Country Code Query Command

Function:

Query Wi-Fi country code information.

Command:

Response:

+CWCOUNTRY:<country_policy>,<"country_code">,<start_channel>,<total_channel_count>

OK
Set Command

Function:

Set the Wi-Fi country code information.

Command:

AT+CWCOUNTRY=<country_policy>,<"country_code">,<start_channel>,<total_channel_count>

Response:

Parameters Note Example
AT+CWMODE=3
AT+CWCOUNTRY=1,"CN",1,13

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4