AT+CWINIT: Initialize/Deinitialize Wi-Fi driver.
AT+CWMODE: Set the Wi-Fi mode (Station/SoftAP/Station+SoftAP).
AT+CWSTATE: Query the Wi-Fi state and Wi-Fi information.
AT+CWCONFIG: Query/Set Wi-Fi inactive time and listen interval time.
AT+CWJAP: Connect to an AP.
AT+CWRECONNCFG: Query/Set the Wi-Fi reconnecting configuration.
AT+CWLAPOPT: Set the configuration for the command AT+CWLAP.
AT+CWLAP: List available APs.
AT+CWQAP: Disconnect from an AP.
AT+CWSAP: Query/Set the configuration of an ESP32 SoftAP.
AT+CWLIF: Obtain IP address of the station that connects to an ESP32 SoftAP.
AT+CWQIF: Disconnect stations from an ESP32 SoftAP.
AT+CWDHCP: Enable/disable DHCP.
AT+CWDHCPS: Query/Set the IPv4 addresses allocated by an ESP32 SoftAP DHCP server.
AT+CWAUTOCONN: Connect to an AP automatically when powered on.
AT+CWAPPROTO: Query/Set the 802.11 b/g/n protocol standard of SoftAP mode.
AT+CWSTAPROTO: Query/Set the 802.11 b/g/n protocol standard of station mode.
AT+CIPSTAMAC: Query/Set the MAC address of an ESP32 station.
AT+CIPAPMAC: Query/Set the MAC address of an ESP32 SoftAP.
AT+CIPSTA: Query/Set the IP address of an ESP32 station.
AT+CIPAP: Query/Set the IP address of an ESP32 SoftAP.
AT+CWSTARTSMART: Start SmartConfig.
AT+CWSTOPSMART: Stop SmartConfig.
AT+WPS: Enable the WPS function.
AT+CWJEAP: Connect to a WPA2 Enterprise AP.
AT+CWHOSTNAME: Query/Set the host name of an ESP32 station.
AT+CWCOUNTRY: Query/Set the Wi-Fi Country Code.
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):
Enable EAP commands (AT+CWJEAP): Component config
-> AT
-> AT WPA2 Enterprise command support
Disable WPS commands (AT+WPS): Component config
-> AT
-> AT WPS command support
Disable smartconfig commands (AT+CWSTARTSMART and AT+CWSTOPSMART): Component config
-> AT
-> AT smartconfig command support
Disable all Wi-Fi commands (Not recommended. Once disabled, all Wi-Fi and above functions will be unusable, and you will need to implement these AT commands yourself): Component config
-> AT
-> AT wifi command support
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ï<init>:
0: Deinitialize Wi-Fi driver of ESP32 device.
1: Initialize Wi-Fi driver of ESP32 device. (Default value)
This setting is not saved to flash and will revert to the default value of 1 after restarting.
When you run out of RAM resources and Wi-Fi is not used, you can use this command to clean up the Wi-Fi driver to free up RAM resources.
// Deinitialize Wi-Fi driver AT+CWINIT=0AT+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ï<mode>:
0: Null mode. Wi-Fi RF will be disabled.
1: Station mode.
2: SoftAP mode.
3: SoftAP+Station mode.
<auto_connect>: Enable or disable automatic connection to an AP when you change the mode of the ESP32 from the SoftAP mode or null mode to the station mode or the SoftAP+Station mode. Default: 1. If you omit the parameter, the default value will be used, i.e. automatically connecting to an AP.
0: The ESP32 will not automatically connect to an AP.
1: The ESP32 will automatically connect to an AP if the configuration to connect to the AP has already been saved in flash before.
The configuration changes will be saved in the NVS partition if AT+SYSSTORE=1.
If you have previously used the Bluetooth function, it is recommended to send the following commands to deinitialize the initialized functions before using the SoftAP or SoftAP+Station functions:
AT+BTINIT=0 (Deinitialize Classic Bluetooth)
AT+BLEINIT=0 (Deinitialize Bluetooth LE)
AT+BLUFI=0 (Disable BluFi)
For more details, please refer to the RF Coexistence documentation.
Function:
Query the Wi-Fi state and Wi-Fi information of ESP32.
Command:
Response:
+CWSTATE:<state>,<"ssid"> OKParametersï
<state>: current Wi-Fi state.
0: ESP32 station has not started any Wi-Fi connection.
1: ESP32 station has connected to an AP, but does not get an IPv4 address yet.
2: ESP32 station has connected to an AP, and got an IPv4 address.
3: ESP32 station is in Wi-Fi connecting or reconnecting state.
4: ESP32 station is in Wi-Fi disconnected state.
<âssidâ>: the SSID of the target AP.
When ESP32 station is not connected to an AP, it is recommended to use this command to query Wi-Fi information; after ESP32 station is connected to an AP, it is recommended to use AT+CWJAP to query Wi-Fi information.
Command:
Response:
+CWCONFIG:<ap_inactive_time>,<sta_inactive_time>,<listen_interval> OKSet Commandï
Command:
AT+CWCONFIG=[<ap_inactive_time>][,<sta_inactive_time>][,<listen_interval>]
Response:
Parametersï<ap_inactive_time>: Inactive time in SoftAP mode. Unit: seconds. Default: 300. Range: [10,3600]. If the SoftAP does not receive any data from a connected station within the inactive time, the SoftAP will forcibly disconnect that Stationâs Wi-Fi connection.
<sta_inactive_time>: Inactive time in Station mode. Unit: seconds. Default: 6. Range: [3,600]. If the Station does not receive any beacon frames from the connected SoftAP within the inactive time, the Wi-Fi connection of ESP32 will be forcibly disconnected.
<listen_interval>: Interval for listening to AP beacons, in units of AP beacon intervals. Default: 3. Range: [1,100]. This parameter is the same as <listen_interval> in AT+CWJAP, but this configuration is global.
The configuration changes will be saved in the NVS partition if AT+SYSSTORE=1.
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> OKSet 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> ERRORExecute 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> ERRORParametersï
<âssidâ>: the SSID of the target AP.
Escape character syntax is needed if SSID or password contains special characters, such as ,
, "
, or \
.
Chinese SSID is supported. Chinese SSID of some routers or hotspots is not encoded in UTF-8 encoding format. You can scan SSID first, and then connect using the scanned SSID.
<âpwdâ>: password, MAX: 63-byte ASCII.
<âbssidâ>: the MAC address of the target AP. It cannot be omitted when multiple APs have the same SSID.
<channel>: channel.
<rssi>: signal strength.
<pci_en>: PCI Authentication.
0: The ESP32 station will connect APs with all encryption methods, including OPEN and WEP.
1: The ESP32 station will connect APs with all encryption methods, except OPEN and WEP.
<reconn_interval>: the interval between Wi-Fi reconnections. Unit: second. Default: 1. Maximum: 7200.
0: The ESP32 station will not reconnect to the AP when disconnected.
[1,7200]: The ESP32 station will reconnect to the AP at the specified interval when disconnected.
<listen_interval>: the interval of listening to the APâs beacon. Unit: AP beacon intervals. Default: 3. Range: [1,100].
<scan_mode>:
0: fast scan. It will end after finding the targeted AP. The ESP32 station will connect to the first scanned AP.
1: all-channel scan. It will end after all the channels are scanned. The device will connect to the scanned AP with the strongest signal.
<jap_timeout>: maximum timeout for AT+CWJAP command. Unit: second. Default: 15. Range: [3,600].
<pmf>: Protected Management Frames. Default: 1.
0 means disable PMF.
bit 0: PMF capable, advertizes support for protected management frame. Device will prefer to connect in PMF mode if other device also advertizes PMF capability.
bit 1: PMF required, advertizes that protected management frame is required. Device will not associate to non-PMF capable devices.
<error code>: (for reference only)
1: connection timeout.
2: wrong password.
3: cannot find the target AP.
4: connection failed.
others: unknown error occurred.
The configuration changes will be saved in the NVS partition if AT+SYSSTORE=1.
This command requires Station mode to be enabled.
After ESP32 station is connected to an AP, it is recommended to use this command to query Wi-Fi information; when ESP32 station is not connected to an AP, it is recommended to use AT+CWSTATE to query Wi-Fi information.
The parameter <reconn_interval>
of this command is the same as <interval_second>
of the command AT+CWRECONNCFG. Therefore, if you omit <reconn_interval>
when running this command, the interval between Wi-Fi reconnections will use the default value 1.
If the <"ssid">
and <"password">
parameter are omitted, AT will use the last configuration.
Execute command has the same maximum timeout to setup command. The default value is 15 seconds, but you can change it by setting the parameter <jap_timeout>
.
The authentication method via WAPI is not supported for connecting to the router.
To get an IPv6 address, you need to set AT+CIPV6=1.
Response OK
means that the IPv4 network is ready, but not the IPv6 network. At present, ESP-AT is mainly based on IPv4 network, supplemented by IPv6 network.
WIFI GOT IPv6 LL
represents that the linklocal IPv6 address has been obtained. This address is calculated locally through EUI-64 and does not require the participation of the AP. Because of the parallel timing, this print may be before or after OK
.
WIFI GOT IPv6 GL
represents that the global IPv6 address has been obtained. This address is combined by the prefix issued by AP and the suffix calculated internally, which requires the participation of the AP. Because of the parallel timing, this print may be before or after OK
, or it may not be printed because the AP does not support IPv6.
// 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",,,,,,,3AT+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> OKSet Commandï
Function:
Set the configuration of Wi-Fi reconnect.
Command:
AT+CWRECONNCFG=<interval_second>,<repeat_count>
Response:
Parametersï<interval_second>: the interval between Wi-Fi reconnections. Unit: second. Default: 0. Maximum: 7200.
0: The ESP32 station will not reconnect to the AP when disconnected.
[1,7200]: The ESP32 station will reconnect to the AP at the specified interval when disconnected.
<repeat_count>: the number of attempts the ESP32 makes to reconnect to the AP. This parameter only works when the parameter <interval_second>
is not 0. Default: 0. Maximum: 1000.
0: The ESP32 station will always try to reconnect to AP.
[1,1000]: The ESP32 station will attempt to reconnect to AP for the specified times.
// 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,0Notesï
The configuration changes will be saved in the NVS partition if AT+SYSSTORE=1.
The parameter <interval_second>
of this command is the same as the parameter [<reconn_interval>]
of the command AT+CWJAP.
This command works for passive disconnection from APs, Wi-Fi mode switch, and Wi-Fi auto connect after power on.
Command:
AT+CWLAPOPT=<reserved>,<print mask>[,<rssi filter>][,<authmode mask>]
Response:
or
Parametersï<reserved>: reserved item.
<print mask>: determine whether the following parameters are shown in the result of AT+CWLAP. Default: 0x7FF. If you set them to 1, it means showing the corresponding parameters; if you set them as 0, it means NOT showing the corresponding parameters.
bit 0: determine whether <ecn> will be shown.
bit 1: determine whether <âssidâ> will be shown.
bit 2: determine whether <rssi> will be shown.
bit 3: determine whether <âmacâ> will be shown.
bit 4: determine whether <channel> will be shown.
bit 5: determine whether <freq_offset> will be shown.
bit 6: determine whether <freqcal_val> will be shown.
bit 7: determine whether <pairwise_cipher> will be shown.
bit 8: determine whether <group_cipher> will be shown.
bit 9: determine whether <bgn> will be shown.
bit 10: determine whether <wps> will be shown.
[<rssi filter>]: determine whether the result of the command AT+CWLAP will be filtered according to rssi filter
. In other words, the result of the command will NOT show the APs whose signal strength is below rssi filter
. Unit: dBm. Default: -100. Range: [-100,40].
[<authmode mask>]: determine whether APs with the following authmodes are shown in the result of AT+CWLAP. Default: 0xFFFF. If you set bit x
to 1, the APs with the corresponding authmode will be shown. If you set bit x
to 0, the APs with the corresponding authmode will NOT be shown;
bit 0: determine whether APs with OPEN
authmode will be shown.
bit 1: determine whether APs with WEP
authmode will be shown.
bit 2: determine whether APs with WPA_PSK
authmode will be shown.
bit 3: determine whether APs with WPA2_PSK
authmode will be shown.
bit 4: determine whether APs with WPA_WPA2_PSK
authmode will be shown.
bit 5: determine whether APs with WPA2_ENTERPRISE
authmode will be shown.
bit 6: determine whether APs with WPA3_PSK
authmode will be shown.
bit 7: determine whether AP with WPA2_WPA3_PSK
authmode will be shown.
bit 8: determine whether AP with WAPI_PSK
authmode will be shown.
bit 9: determine whether AP with OWE
authmode will be shown.
bit 10: determine whether AP with WPA3_ENT_192
authmode will be shown.
bit 11: determine whether AP with WPA3_EXT_PSK
authmode will be shown.
bit 12: determine whether AP with WPA3_EXT_PSK_MIXED_MODE
authmode will be shown.
bit 13: determine whether AP with DPP
authmode will be shown.
bit 14: determine whether AP with WPA3_ENTERPRISE
authmode will be shown.
bit 15: determine whether AP with WPA2_WPA3_ENTERPRISE
authmode will be shown.
// 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+CWLAPAT+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>) OKParametersï
<ecn>: encryption method.
0: OPEN
1: WEP
2: WPA_PSK
3: WPA2_PSK
4: WPA_WPA2_PSK
5: WPA2_ENTERPRISE
6: WPA3_PSK
7: WPA2_WPA3_PSK
8: WAPI_PSK
9: OWE
10: WPA3_ENT_192
11: WPA3_EXT_PSK
12: WPA3_EXT_PSK_MIXED_MODE
13: DPP
14: WPA3_ENTERPRISE
15: WPA2_WPA3_ENTERPRISE
<âssidâ>: string parameter showing SSID of the AP.
<rssi>: signal strength.
<âmacâ>: string parameter showing MAC address of the AP.
<channel>: channel.
<scan_type>: Wi-Fi scan type. Default: 0.
0: active scan
1: passive scan
<scan_time_min>: the minimum active scan time per channel. Unit: millisecond. Range [0,1500]. If the scan type is passive, this parameter is invalid.
<scan_time_max>: the maximum active scan time per channel. Unit: millisecond. Range [0,1500]. If this parameter is 0, the firmware will use the default time: 120 ms for active scan; 360 ms for passive scan.
<ext_channel_bitmap>: the extended channel.
bit1 ~ bit14: 2.4 GHz channel. multiple bits can be set to 1, which means scanning multiple channels.
<freq_offset>: frequency offset (reserved item).
<freqcal_val>: frequency calibration value (reserved item).
<pairwise_cipher>: pairwise cipher type.
0: None
1: WEP40
2: WEP104
3: TKIP
4: CCMP
5: TKIP and CCMP
6: AES-CMAC-128
7: Unknown
<group_cipher>: group cipher type, same enumerated value to <pairwise_cipher>
.
<bgn>: 802.11 b/g/n. If the corresponding bit is 1, the corresponding mode is enabled; if the corresponding bit is 0, the corresponding mode is disabled.
bit 0: bit to identify if 802.11b mode is enabled or not
bit 1: bit to identify if 802.11g mode is enabled or not
bit 2: bit to identify if 802.11n mode is enabled or not
<wps>: wps flag.
0: WPS disabled
1: WPS enabled
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> OKSet Commandï
Function:
Set the configuration of an ESP32 SoftAP.
Command:
AT+CWSAP=<"ssid">,<"pwd">,<chl>,<ecn>[,<max conn>][,<ssid hidden>]
Response:
Parametersï<âssidâ>: string parameter showing SSID of the AP.
<âpwdâ>: string parameter showing the password. Length: 8 ~ 63 bytes ASCII.
<channel>: channel ID.
<ecn>: encryption method; WEP is not supported.
0: OPEN
2: WPA_PSK
3: WPA2_PSK
4: WPA_WPA2_PSK
[<max conn>]: maximum number of stations that ESP32 SoftAP can connect. Range: refer to max_connection description.
[<ssid hidden>]:
0: broadcasting SSID (default).
1: not broadcasting SSID.
This command works only when AT+CWMODE=2 or AT+CWMODE=3.
The configuration changes will be saved in the NVS partition if AT+SYSSTORE=1.
The default SSID varies from devices to device as it consists of the MAC address of the device. You can use AT+CWSAP? to query the default SSID.
AT+CWSAP="ESP","1234567890",5,3AT+CWLIF: Obtain IP Address of the Station That Connects to an ESP32 SoftAPï Execute Commandï
Command:
Response:
+CWLIF:<ip addr>,<mac> OKParametersï
<ip addr>: IP address of the station that connects to the ESP32 SoftAP.
<mac>: MAC address of the station that connects to the ESP32 SoftAP.
This command cannot get a static IP. It works only when DHCP of both the ESP32 SoftAP and the connected station are enabled.
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ï<âmacâ>: MAC address of the station to disconnect.
Command:
Response:
Set CommandïFunction:
Enable/disable DHCP.
Command:
AT+CWDHCP=<operate>,<mode>
Response:
Parametersï<operate>:
0: disable
1: enable
<mode>:
Bit0: Station DHCP
Bit1: SoftAP DHCP
<state>: the status of DHCP
Bit0:
0: Station DHCP is disabled.
1: Station DHCP is enabled.
Bit1:
0: SoftAP DHCP is disabled.
1: SoftAP DHCP is enabled.
Bit2:
0: Ethernet DHCP is disabled.
1: Ethernet DHCP is enabled.
The configuration changes will be saved in the NVS partition if AT+SYSSTORE=1.
This Set Command correlates with the commands that set static IP, such as AT+CIPSTA and AT+CIPAP:
If DHCP is enabled, static IPv4 address will be disabled;
If static IPv4 address is enabled, DHCP will be disabled;
The last configuration overwrites the previous configuration.
// 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,2AT+CWDHCPS: Query/Set the IPv4 Addresses Allocated by an ESP32 SoftAP DHCP Serverï Query Commandï
Command:
Response:
+CWDHCPS:<lease time>,<start IP>,<end IP> OKSet 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ï<enable>:
1: Enable DHCP server settings. The parameters below have to be set.
0: Disable DHCP server settings and use the default IPv4 address range.
<lease time>: lease time. Unit: minute. Range [1,2880].
<âstart IPâ>: start IPv4 address of the IPv4 address range that can be obtained from ESP32 SoftAP DHCP server.
<âend IPâ>: end IPv4 address of the IPv4 address range that can be obtained from ESP32 SoftAP DHCP server.
The configuration changes will be saved in the NVS partition if AT+SYSSTORE=1.
This AT command works only when both SoftAP and DHCP server are enabled for ESP32.
The IPv4 address should be in the same network segment as the IPv4 address of ESP32 SoftAP.
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ï<enable>:
1: Enable automatic connection to an AP when powered on. (Default)
0: Disable automatic connection to an AP when powered on.
The configuration changes will be saved in the NVS partition.
Command:
Response:
Set CommandïCommand:
Response:
Parametersï<protocol>:
bit0: 802.11b protocol standard.
bit1: 802.11g protocol standard.
bit2: 802.11n protocol standard.
The configuration changes will be saved in the NVS partition if AT+SYSSTORE=1.
See Wi-Fi Protocol Mode for the PHY mode supported by the ESP32 device.
By default, PHY mode of ESP32 is 802.11bgn mode.
Command:
Response:
+CWSTAPROTO:<protocol> OKSet Commandï
Command:
Response:
Parametersï<protocol>:
bit0: 802.11b protocol standard.
bit1: 802.11g protocol standard.
bit2: 802.11n protocol standard.
The configuration changes will be saved in the NVS partition if AT+SYSSTORE=1.
See Wi-Fi Protocol Mode for the PHY mode supported by the ESP32 device.
By default, PHY mode of ESP32 is 802.11bgn mode.
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ï<âmacâ>: string parameter showing MAC address of an ESP32 station.
The configuration changes will be saved in the NVS partition if AT+SYSSTORE=1.
The MAC address of ESP32 Station is different from that of the ESP32 SoftAP and ESP32 Ethernet. Please make sure that you do not set the same MAC address for both of them.
Bit 0 of the ESP32 MAC address CANNOT be 1. For example, a MAC address can be â1a:â¦â but not â15:â¦â.
FF:FF:FF:FF:FF:FF and 00:00:00:00:00:00 are invalid MAC address and cannot be set.
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ï<âmacâ>: string parameter showing MAC address of the ESP32 SoftAP.
The configuration changes will be saved in the NVS partition if AT+SYSSTORE=1.
The MAC address of ESP32 SoftAP is different from that of the ESP32 station and ESP32 Ethernet. Please make sure that you do not set the same MAC address for both of them.
Bit 0 of the ESP32 MAC address CANNOT be 1. For example, a MAC address can be â18:â¦â but not â15:â¦â.
FF:FF:FF:FF:FF:FF and 00:00:00:00:00:00 are invalid MAC and cannot be set.
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"> OKSet Commandï
Function:
Set the IPv4 address of the ESP32 station.
Command:
AT+CIPSTA=<"ip">[,<"gateway">,<"netmask">]
Response:
Parametersï<âipâ>: string parameter showing the IPv4 address of the ESP32 station.
<âgatewayâ>: gateway.
<ânetmaskâ>: netmask.
<âipv6 addrâ>: string parameter showing the IPv6 address of the ESP32 station.
For the query command, only when the ESP32 station is connected to an AP or the static IP address is configured can its IP address be queried.
The configuration changes will be saved in the NVS partition if AT+SYSSTORE=1.
The Set Command correlates with the commands that set DHCP, such as AT+CWDHCP.
If static IPv4 address is enabled, DHCP will be disabled;
If DHCP is enabled, static IPv4 address will be disabled;
The last configuration overwrites the previous configuration.
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"> OKSet Commandï
Function:
Set the IPv4 address of the ESP32 SoftAP.
Command:
AT+CIPAP=<"ip">[,<"gateway">,<"netmask">]
Response:
Parametersï<âipâ>: string parameter showing the IPv4 address of the ESP32 SoftAP.
<âgatewayâ>: gateway.
<ânetmaskâ>: netmask.
<âipv6 addrâ>: string parameter showing the IPv6 address of the ESP32 SoftAP.
The set command is just applied to the IPv4 network, but not the IPv6 network.
The configuration changes will be saved in the NVS partition if AT+SYSSTORE=1.
The set command correlates with the commands that set DHCP, such as AT+CWDHCP.
If static IPv4 address is enabled, DHCP will be disabled;
If DHCP is enabled, static IPv4 address will be disabled;
The last configuration overwrites the previous configuration.
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ï<type>:
1: ESP-TOUCH
2: AirKiss
3: ESP-TOUCH+AirKiss
4: ESP-TOUCH v2
<auth floor>: Wi-Fi authentication mode floor. ESP-AT will not connect to the AP whose authmode is lower than this floor.
0: OPEN (Default)
1: WEP
2: WPA_PSK
3: WPA2_PSK
4: WPA_WPA2_PSK
5: WPA2_ENTERPRISE
6: WPA3_PSK
7: WPA2_WPA3_PSK
8: WAPI_PSK
9: OWE
10: WPA3_ENT_192
11: WPA3_EXT_PSK
12: WPA3_EXT_PSK_MIXED_MODE
13: DPP
14: WPA3_ENTERPRISE
15: WPA2_WPA3_ENTERPRISE
<âesptouch v2 keyâ>: ESP-TOUCH v2 decrypt key. It is used to decrypt Wi-Fi password and reserved data. Length: 16 bytes.
For more details on SmartConfig, please see ESP-TOUCH User Guide.
SmartConfig is only available in the ESP32 station mode.
The message Smart get Wi-Fi info
means that SmartConfig has successfully acquired the AP information. ESP32 will try to connect to the target AP.
Message +SCRD:<length>,<rvd data>
means that ESP-Touch v2 has successfully acquired the reserved data information.
Message Smartconfig connected Wi-Fi
is printed if the connection is successful.
When AT returns Smartconfig connected Wi-Fi
, it is recommended to delay more than 6
seconds before executing AT+CWSTOPSMART because the ESP32 needs to synchronize the SmartConfig results to the mobile phone.
Use command AT+CWSTOPSMART to stop SmartConfig before running other commands. Please make sure that you do not execute other commands during SmartConfig.
AT+CWMODE=1 AT+CWSTARTSMARTAT+CWSTOPSMART: Stop SmartConfigï Execute Commandï
Command:
Response:
NoteïIrrespective of whether SmartConfig succeeds or not, please always call AT+CWSTOPSMART before executing any other AT commands to release the internal memory taken up by SmartConfig.
AT+CWMODE=1 AT+CWSTARTSMART AT+CWSTOPSMARTAT+WPS: Enable the WPS Functionï Set Commandï
Command:
AT+WPS=<enable>[,<auth floor>]
Response:
Parametersï<enable>:
1: Enable WPS (Wi-Fi Protected Setup) that uses PBC (Push Button Configuration) mode.
0: Disable WPS that uses PBC mode.
<auth floor>: Wi-Fi authentication mode floor. ESP-AT will not connect to the AP whose authmode is lower than this floor.
0: OPEN (Default)
1: WEP
2: WPA_PSK
3: WPA2_PSK
4: WPA_WPA2_PSK
5: WPA2_ENTERPRISE
6: WPA3_PSK
7: WPA2_WPA3_PSK
8: WAPI_PSK
9: OWE
10: WPA3_ENT_192
11: WPA3_EXT_PSK
12: WPA3_EXT_PSK_MIXED_MODE
13: DPP
14: WPA3_ENTERPRISE
15: WPA2_WPA3_ENTERPRISE
WPS can only be used when the ESP32 station is enabled.
WPS does not support WEP (Wired-Equivalent Privacy) encryption.
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> OKSet Commandï
Function:
Connect to the targeted Enterprise AP.
Command:
AT+CWJEAP=<"ssid">,<method>,<"identity">,<"username">,<"password">,<security>[,<jeap_timeout>]
Response:
or
Parametersï<âssidâ>: the SSID of the Enterprise AP.
Escape character syntax is needed if SSID or password contains any special characters, such as ,
, "
, or \\
.
<method>: WPA2 Enterprise authentication method.
0: EAP-TLS.
1: EAP-PEAP.
2: EAP-TTLS.
<âidentityâ>: identity for phase 1. String limited to 1 ~ 32.
<âusernameâ>: username for phase 2. Range: 1 ~ 32 bytes. For the EAP-PEAP and EAP-TTLS method, you must set this parameter. For the EAP-TLS method, you do not need to.
<âpasswordâ>: password for phase 2. Range: 1 ~ 32 bytes. For the EAP-PEAP and EAP-TTLS method, you must set this parameter. For the EAP-TLS method, you do not need to.
<security>:
Bit0: provide the certificate for the server to verify.
Bit1: load the CA certificate to verify the serverâs certificate.
[<jeap_timeout>]: maximum timeout for AT+CWJEAP command. Unit: second. Default: 15. Range: [3,600].
// 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ïThe configuration changes will be saved in the NVS partition if AT+SYSSTORE=1.
This command requires Station mode to be active.
TLS mode will use client certificate. Please make sure it is enabled.
If you want to use your own certificate at runtime, use the AT+SYSMFG command to update the WPA2 Enterprise certificate. If you want to pre-burn your own certificate, please refer to How to Update PKI Configuration.
If <security>
is configured to 2, in order to check the server certificate validity period, please make sure ESP32 has obtained the current time before sending the AT+CWJEAP command. (You can send AT+SYSTIMESTAMP command to configure the current time, and send AT+SYSTIMESTAMP? command to query the current time.)
Function:
Query the host name of ESP32 Station.
Command:
Response:
+CWHOSTNAME:<hostname> OKSet 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ï<âhostnameâ>: the host name of the ESP32 Station. Maximum length: 32 bytes.
The configuration changes are not saved in the flash.
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> OKSet Commandï
Function:
Set the Wi-Fi country code information.
Command:
AT+CWCOUNTRY=<country_policy>,<"country_code">,<start_channel>,<total_channel_count>
Response:
Parametersï<country_policy>:
0: will change the county code to be the same as the AP that the ESP32 is connected to.
1: the country code will not change, always be the one set by command.
<âcountry_codeâ>: country code. Maximum length: 3 characters. Refer to ISO 3166-1 alpha-2 for country codes.
<start_channel>: the channel number to start. Range: [1,14].
<total_channel_count>: total number of channels.
See Wi-Fi Country Code for more details.
The configuration changes are not saved in the flash.
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