
!
4. Wi-Fi AT Commands
4.2.16. AT+CWDHCP_DEF—Enables/Disables DHCP; Configuration Saved in the Flash
Parameters
•
Bit0
:
‣
0
: Station DHCP is disabled.
‣
1
: Station DHCP is enabled.
•
Bit1
:
‣
0
: SoftAP DHCP is disabled.
‣
1
: SoftAP DHCP is enabled.
•
<mode>
:
‣
0
: Sets ESP8266 SoftAP
‣
1
: Sets ESP8266 Station
‣
2
: Sets both SoftAP and Station
•
<en>
:
‣
0
: Disables DHCP
‣
1
: Enables DHCP
Notes
•
The configuration changes will be stored in the user parameter area in the flash.
•
This Set Command interacts with static-IP-related AT commands (
AT+CIPSTA
-related
and
AT+CIPA
-related commands):
‣
If DHCP is enabled, static IP will be disabled;
‣
If static IP is enabled, DHCP will be disabled;
‣
Whether it is DHCP or static IP that is enabled depends on the last configuration.
Example
AT+CWDHCP_CUR=0,1
Commands
Query Command:
AT+CWDHCP_DEF?
Set Command:
AT+CWDHCP_DEF=<<mode>,<en>
Function: to enable/disable DHCP.
Response
DHCP disabled or enabled now?
OK
Parameters
•
Bit0
:
‣
0
: Station DHCP is disabled.
‣
1
: Station DHCP is enabled.
•
Bit1
:
‣
0
: SoftAP DHCP is disabled.
‣
1
: SoftAP DHCP is enabled.
•
<mode>
:
‣
0
: Sets ESP8266 SoftAP
‣
1
: Sets ESP8266 Station
‣
2
: Sets both SoftAP and Station
•
<en>
:
‣
0
: Disables DHCP
‣
1
: Enables DHCP
Notes
•
The configuration changes will be stored in the user parameter area in the flash.
•
This Set Command interacts with static-IP-related AT commands (
AT+CIPSTA
-related
and
AT+CIPA
-related commands):
‣
If DHCP is enabled, static IP will be disabled;
‣
If static IP is enabled, DHCP will be disabled;
‣
Whether it is DHCP or static IP that is enabled depends on the last configuration.
Example
AT+CWDHCP_DEF=0,1
Espressif
!
/52
30
2017.05