ESP8266 AT 指令 - Ai-Thinker

18
版本 1.3 版权 © 2017 ESP8266 AT 指令 使示

Transcript of ESP8266 AT 指令 - Ai-Thinker

4B-ESP8266__AT Command Examples__CN.pages ESP8266_NONOS_SDK AT


1 AT
2 TCP Client ESP8266 TCP Client
3 UDP UDP
4
5 TCP Server ESP8266 TCP Server
6 AT

2017.08 V1.3
3. UDP 4 ................................................................................................................................
4. 8 .........................................................................................................................................
4.2. UDP 10 ..................................................................................................................................
6. 14...............................................................................................................................
! 1.
1. ESP8266_NONOS_SDK AT AT ESP8266_AT_Instruction_Set
• ESP8266 AT Binhttp://www.espressif.com/en/support/download/at
- README.md
- 115200
- AT CR LF “”

Espressif ! /!1 15 2017.08
AT+CWMODE=3 // softAP+station mode
:
OK
:
OK
AT+CIFSR
:
+CIFSR:APIP,"192.168.4.1"
+CIFSR:APMAC,"1a:fe:34:a5:8d:c6"
+CIFSR:STAIP,"192.168.3.133"
+CIFSR:STAMAC,"18:fe:34:a5:8d:c6"
OK
4. PC ESP8266 PC TCP
- PC IP 192.168.3.116 8080
5. ESP8266 TCP client
AT+CIPSTART="TCP","192.168.3.116",8080 //protocol, server IP and port
:
OK
6. ESP8266
AT+CIPSEND=4 // set date length which will be sent, such as 4 bytes
>test // enter the data, no CR
:
+IPD,n:xxxxxxxxxx // received n bytes, data=xxxxxxxxxxx

- busy n SEND OK
-
Espressif ! /!3 15 2017.08
! 3. UDP
3. UDP UDP server client AT+CIPSTART
1. WiFi
:
OK
:
OK
AT+CIFSR
:
+CIFSR:APIP,"192.168.4.1"
+CIFSR:APMAC,"1a:fe:34:a5:8d:c6"
+CIFSR:STAIP,"192.168.101.133"
+CIFSR:STAMAC,"18:fe:34:a5:8d:c6"
OK
4. PC ESP8266 PC UDP
- PC UDP IP 192.168.101.116 8080
5. UDP
3.1. UDP
UDP AT+CIPSTART 0 UDP
1.
AT+CIPSTART=4,"UDP","192.168.101.110",8080,1112,0
>UDPtest // enter the data, no CR
:
5. UDP
:
4,CLOSED
OK


• "192.168.101.110", 8080 UDP IP 4 PC UDP
• 1112 ESP8266 UDP
• 0 UDP UDP UDP ESP8266 UDP 1112ESP8266 4 UDP “AT+CIPSEND=4, X” PC

- busy n SEND OK
-
Espressif ! /!5 15 2017.08
3.2. UDP
AT+CIPSTART UDP 2 UDP
1. UDP
:
AT+CIPSEND=7,"192.168.101.111",1000 // Send 7 bytes
>UDPtest // enter the data, no CR
:


• "192.168.101.110", 8080 UDP IP PC UDP
• 1112 ESP8266 UDP
• 2 UDP UDP UDP ESP8266 UDP

- busy n SEND OK
-
Espressif ! /!6 15 2017.08
5. UDP
! 4.
4. ESP8266 AT TCP client UDP
4.1. TCP Client
ESP8266 station TCP client ESP8266 softAP
1. WiFi
:
OK
:
OK
AT+CIFSR
:
+CIFSR:APIP,"192.168.4.1"
+CIFSR:APMAC,"1a:fe:34:a5:8d:c6"
+CIFSR:STAIP,"192.168.3.133"
+CIFSR:STAMAC,"18:fe:34:a5:8d:c6"
OK
4. PC ESP8266 PC TCP
- PC IP 192.168.3.116 8080
5. ESP8266 TCP client
AT+CIPSTART="TCP","192.168.3.116",8080 //protocol, server IP and port
:
OK
AT+CIPSEND
> //From now on, data received from UART will be transmitted to server automatically.
8.
“+++”
- “+++” “+” “+++”
- 1 AT
9.
- busy n SEND OK
-

“+++“ AT TCP AT+CIPSEND
Espressif ! /!9 15 2017.08
4.2. UDP
ESP8266 softAP UDP ESP8266 station
1. WiFi
:
OK
2. PC ESP8266 softAP
3. PC UDP
- PC UDP IP 192.168.4.2 1001
4. ESP8266 PC UDP
AT+CIPSTART="UDP","192.168.4.2",1001,2233,0
AT+CIPSEND
> //From now on, data received from UART will be transmitted to server automatically.
Espressif ! /!10 15 2017.08
“+++”
- “+++” “+” “+++”
- 1 AT
8.
- busy n SEND OK
-

“+++“ AT TCP AT+CIPSEND
Espressif ! /!11 15 2017.08
! 5. TCP Server
5. TCP Server ESP8266 AT TCP TCP client
ESP8266 softAP TCP ESP8266 station
1. WiFi
:
OK
AT+CIPSERVER=1 // default port = 333
:
OK
4. PC ESP8266 softAP
5. PC TCP client ESP8266 TCP server
Espressif ! /!12 15 2017.08
! 5. TCP Server
AT+CIPSEND=0, 4 // send 4 bytes to connection NO.0
>test // enter the data, no CR
:
8. UDP
:
0,CLOSED
OK

ESP8266 TCP server ESP8266 TCP server TCP client PC TCP client ESP8266 TCP server 2s

- busy n SEND OK
-
Espressif ! /!13 15 2017.08
6. AT
• AT AT+GMR
• ESP-WROOM-02
SDK version:1.0.1
OK
ets Jan 8 2013,rst cause: 1, boot mode: (3,3)
load 0x40100000, len 26336, room 16
tail 0
chksum 0xde
tail 0
chksum 0x69
tail 4
chksum 0xcb
csum 0xcb
addr not ack when tx write cmd
mode : sta(18: fe: 34: 97: d5: 7b) + softAP(1a: fe: 34: 97: d5: 7b)
Espressif ! /!14 15 2017.08
URL
“”


Wi-Fi Wi-Fi Bluetooth SIG
© 2017
IoT