
!
5. TCP/IP-Related AT Commands
5.2.3. AT+CIPSTART—Establishes TCP Connection, UDP Transmission or SSL Connection
Establish TCP Connection
Set
Command
Single TCP connection (
AT+CIPMUX=0
):
AT+CIPSTART=<type>,<remote IP>,<remote
port>[,<TCP keep alive>]
Multiple TCP Connections (
AT+CIPMUX=1
):
AT+CIPSTART=<link ID>,<type>,<remote
IP>,<remote port>[,<TCP keep alive>]
Response
OK
or
ERROR
If the TCP connection is already established, the response is:
ALREADY CONNECT
Parameters
•
<link ID>
: ID of network connection (0~4), used for multiple connections.
•
<type>
: string parameter indicating the connection type:
"TCP"
,
"UDP"
or
"SSL"
.
•
<remote IP>
: string parameter indicating the remote IP address.
•
<remote port>
: the remote port number.
•
[<TCP keep alive>]
: detection time interval when TCP is kept alive; this function is disabled by
default.
‣
0
: disable TCP keep-alive.
‣
1 ~ 7200
: detection time interval; unit: second (s).
Examples
AT+CIPSTART="TCP","iot.espressif.cn",8000
AT+CIPSTART="TCP","192.168.101.110",1000
For more information please see:
ESP8266 AT Command Examples
.
Establish UDP Transmission
Set
Command
Single connection (
AT+CIPMUX=0
):
AT+CIPSTART=<type>,<remote IP>,<remote port>[,
(<UDP local port>),(<UDP mode>)]
Multiple connections (
AT+CIPMUX=1
):
AT+CIPSTART=<link ID>,<type>,<remote
IP>,<remote port>[,(<UDP local port>),
(<UDP mode>)]
Response
OK
or
ERROR
If the UDP transmission is already established, the response is:
ALREADY CONNECT
Espressif
!
/
!
43 58
2017.05