
ESP-01/07/12 Series Modules User's Manual V1.4
Copyright © 2017 Shenzhen Ai-Thinker Technology Co., Ltd All Rights Reserved
Page 20 of
23
OK
>
//After the emergence of the symbol serial port to send
Ai-Thinker (without carriage return line)
Recv 10 bytes
//The serial port receives the data
SEND OK
//sent successfully
CLOSED
//TCP connection is closed
5.2.2 UDP Communication Test
One is in AP mode , the local port is 8001, and the other is Station mode. the
local port is 8002.
AP Configuration
:
Ai-Thinker Technology Co. Ltd.
ready
AT+CWMODE=2
//configured for AP mode
OK
AT+CWSAP_DEF="TCP_Server","12345678",5,4
//AP information
OK
AT+CIFSR
//Query the local IP address
+CIFSR:APIP,"192.168.4.1"
+CIFSR:APMAC,"a2:20:a6:19:c7:0a"
OK
AT+CIPSTART="UDP","192.168.4.2",8002,8001,0
//Open UDP
connection
CONNECT
OK
+IPD,10:Ai-Thinker
//received 10 data (Ai-Thinker)
AT+CIPSEND=10
//send 10 bytes of data to the server
OK