!
Notes
Example
5.2.8.
AT+CIPSTART—Establishes TCP Connection, UDP Transmission or SSL
Connection
Set
Command
Response
Parameters
Messages
Note
Examples
Set
Command
Espressif
The configuration changes will be saved in the NVS area.
•
Currently, ESP32 only supports class C IP addresses.
•
The set command interacts with DHCP-related AT commands (AT+CWDHCP-related
•
commands):
‣ If static IP is enabled, DHCP will be disabled;
‣ If DHCP is enabled, static IP will be disabled;
‣ Whether it is DHCP or static IP that is enabled depends on the last configuration.
AT+CIPAP="192.168.5.1","192.168.5.1","255.255.255.0"
Establish TCP Connection
Single TCP connection (AT+CIPMUX=0):
AT+CIPSTART=<type>,<remote IP>,<remote
port>[,<TCP keep alive>]
OK
<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>: remote port number.
•
[<TCP keep alive>] (optional parameter): detection time interval when TCP is kept alive.
•
This function is disabled by default. Users are recommended to enable this function when
establishing a TCP connection.
‣ 0: disable TCP keep-alive.
‣ 1 ~ 7200: detection time interval, unit: second(s).
// If the TCP connection is established, a message appears as below:
[<link ID>,] CONNECT
// If the TCP connection ends, a message appears as below:
[<link ID>,] CLOSED
Users are recommended to enable this function when establishing a TCP connection.
AT+CIPSTART="TCP","iot.espressif.cn",8000
AT+CIPSTART="TCP","192.168.101.110",1000
For more information please see Chapter 9: AT Command Examples.
Establish UDP Transmission
Single connection (AT+CIPMUX=0):
AT+CIPSTART=<type>,<remote IP>,<remote
port>[,<UDP local port>,<UDP mode>]
27 97
!
5. TCP/IP-Related AT Commands
Multiple TCP Connections (AT+CIPMUX=1):
AT+CIPSTART=<link ID>,<type>,<remote
IP>,<remote port>[,<TCP keep alive>]
Multiple connections (AT+CIPMUX=1):
AT+CIPSTART=<link ID>,<type>,<remote
IP>,<remote port>[,<UDP local
port>,<UDP mode>]
/!
2019.06
Need help?
Do you have a question about the ESP32 and is the answer not in the manual?
Questions and answers