Instructions
" " ! "
Espressif Systems
ESP8266
AT Instruction Set
6.
AT+CWJAP_DEF – Connect to AP, save as default
AT+CWJAP_DEF – Connect to AP and save AP info to flash
Example
•
AT+CWJAP_DEF="abc", "0123456789"
•
If SSID is "ab\, c" and password is "0123456789"\"
AT+CWJAP_DEF="ab\\\, c", "0123456789\"\\"
•
If several APs have the same SSID as "abc", target AP can be found by bssid:
AT+CWJAP_DEF ="abc", "0123456789", "ca:d7:19:d8:a6:44"
Command
AT+CWJAP_DEF?
Response
+CWJAP_DEF:<ssid>, <bssid>, <channel>, <rssi>
OK
Parameters
<ssid> string, AP’s SSID
Command
AT+CWJAP_DEF=<ssid>, <pwd>[, <bssid>]
Response
OK
or
+CWJAP:<error code>
FAIL
Parameters
<ssid> string, AP’s SSID
<pwd> string, MAX: 64 bytes ASCII
[<bssid>] string, AP’s bssid(MAC address), for several APs may have the same
SSID
<error code> only for reference, it is not reliable
1 : connection timeout
2 : wrong password
3 : cannot find target AP
4 : connection failed
This command requires station mode to be active.
Escape character syntax is needed if "SSID" or "password" contains any special
characters ( ’ , ’ or ’ " ’or ’ \ ’)
Notes
Configuration changes will be stored in flash system parameter area.
Espressif Systems / Friday, July 15, 201628 73