.. _TCPIP-AT: TCP/IP AT Commands ================== :link_to_translation:`zh_CN:[中文]` - :ref:`AT+CIPV6 `: Enable/disable the network of Internet Protocol Version 6 (IPv6). - :ref:`AT+CIPSTATE `: Obtain the TCP/UDP/SSL connection information. - :ref:`AT+CIPSTATUS (deprecated) `: Obtain the TCP/UDP/SSL connection status and information. - :ref:`AT+CIPDOMAIN `: Resolve a Domain Name. - :ref:`AT+CIPSTART `: Establish TCP connection, UDP transmission, or SSL connection. - :ref:`AT+CIPSTARTEX `: Establish TCP connection, UDP transmission, or SSL connection with an automatically assigned ID. - :ref:`[Passthrough Mode Only] +++ `: Exit the :term:`passthrough mode`. - :ref:`AT+CIPSEND `: Send data in the :term:`normal transmission mode` or Wi-Fi :term:`passthrough mode`. - :ref:`AT+CIPSENDEX `: Send data in the :term:`normal transmission mode` in expanded ways. - :ref:`AT+CIPCLOSE `: Close TCP/UDP/SSL connection. - :ref:`AT+CIFSR `: Obtain the local IP address and MAC address. - :ref:`AT+CIPMUX `: Enable/disable the multiple connections mode. - :ref:`AT+CIPSERVER `: Delete/create a TCP/SSL server. - :ref:`AT+CIPSERVERMAXCONN `: Query/Set the maximum connections allowed by a server. - :ref:`AT+CIPMODE `: Query/Set the transmission mode. - :ref:`AT+SAVETRANSLINK `: Set whether to enter Wi-Fi :term:`passthrough mode` on power-up. - :ref:`AT+CIPSTO `: Query/Set the local TCP Server Timeout. - :ref:`AT+CIPSNTPCFG `: Query/Set the time zone and SNTP server. - :ref:`AT+CIPSNTPTIME `: Query the SNTP time. - :ref:`AT+CIUPDATE `: Upgrade the firmware through Wi-Fi. - :ref:`AT+CIPDINFO `: Set "+IPD" message mode. - :ref:`AT+CIPSSLCCONF `: Query/Set SSL clients. - :ref:`AT+CIPSSLCCN `: Query/Set the Common Name of the SSL client. - :ref:`AT+CIPSSLCSNI `: Query/Set SSL client Server Name Indication (SNI). - :ref:`AT+CIPSSLCALPN `: Query/Set SSL client Application Layer Protocol Negotiation (ALPN). - :ref:`AT+CIPSSLCPSK `: Query/Set SSL client Pre-shared Key (PSK). - :ref:`AT+CIPRECONNINTV `: Query/Set the TCP/UDP/SSL reconnection interval for the Wi-Fi :term:`passthrough mode`. - :ref:`AT+CIPRECVMODE `: Query/Set socket receiving mode. - :ref:`AT+CIPRECVDATA `: Obtain socket data in passive receiving mode. - :ref:`AT+CIPRECVLEN `: Obtain socket data length in passive receiving mode. - :ref:`AT+PING `: Ping the remote host. - :ref:`AT+CIPDNS `: Query/Set DNS server information. - :ref:`AT+CIPTCPOPT `: Query/Set the socket options. .. _cmd-IPV6: :ref:`AT+CIPV6 `: Enable/disable the network of Internet Protocol Version 6 (IPv6) -------------------------------------------------------------------------------------------- Query Command ^^^^^^^^^^^^^ **Function:** Query whether IPv6 is enabled. **Command:** :: AT+CIPV6? **Response:** :: +CIPV6: OK Set Command ^^^^^^^^^^^ **Function:** Enable/Disable IPv6 network. **Command:** :: AT+CIPV6= **Response:** :: OK Parameters ^^^^^^^^^^ - ****: status of IPv6 network. Default: 0. - 0: disable IPv6 network. - 1: enable IPv6 network. Notes ^^^^^ - You should enable IPv6 network before using IPv6 related upper layer AT commands (TCP/UDP/SSL/PING/DNS based on IPv6 network, also known as TCP6/UDP6/SSL6/PING6/DNS6 or TCPv6/UDPv6/SSLv6/PINGv6/DNSv6). .. _cmd-IPSTATE: :ref:`AT+CIPSTATE `: Obtain the TCP/UDP/SSL Connection Information ---------------------------------------------------------------------------------------- Query Command ^^^^^^^^^^^^^^^ **Command:** :: AT+CIPSTATE? **Response:** When there is a connection, AT returns: :: +CIPSTATE:,<"type">,<"remote IP">,,, OK When there is no connection, AT returns: :: OK Parameters ^^^^^^^^^^ - ****: ID of the connection (0~4), used for multiple connections. - **<"type">**: string parameter showing the type of transmission: "TCP", "TCPv6", "UDP", "UDPv6", "SSL", or "SSLv6". - **<"remote IP">**: string parameter showing the remote IPv4 address or IPv6 address. - ****: the remote port number. - ****: the local port number. - ****: - 0: ESP runs as a client. - 1: ESP runs as a server. .. _cmd-STATUS: :ref:`AT+CIPSTATUS (deprecated) `: Obtain the TCP/UDP/SSL Connection Status and Information ----------------------------------------------------------------------------------------------------- Execute Command ^^^^^^^^^^^^^^^ **Command:** :: AT+CIPSTATUS **Response:** :: STATUS: +CIPSTATUS:,<"type">,<"remote IP">,,, OK Parameters ^^^^^^^^^^ - ****: status of the ESP station interface. - 0: The ESP station is not initialized. - 1: The ESP station is initialized, but not started a Wi-Fi connection yet. - 2: The ESP station is connected to an AP and its IP address is obtained. - 3: The ESP station has created a TCP/SSL transmission. - 4: All of the TCP/UDP/SSL connections of the ESP device station are disconnected. - 5: The ESP station started a Wi-Fi connection, but was not connected to an AP or disconnected from an AP. - ****: ID of the connection (0~4), used for multiple connections. - **<"type">**: string parameter showing the type of transmission: "TCP", "TCPv6", "UDP", "UDPv6", "SSL", or "SSLv6". - **<"remote IP">**: string parameter showing the remote IPv4 address or IPv6 address. - ****: the remote port number. - ****: the local port number. - ****: - 0: ESP device runs as a client. - 1: ESP device runs as a server. .. _cmd-DOMAIN: :ref:`AT+CIPDOMAIN `: Resolve a Domain Name ------------------------------------------------------ Set Command ^^^^^^^^^^^ **Command:** :: AT+CIPDOMAIN=<"domain name">[,] **Response:** :: +CIPDOMAIN:<"IP address"> OK Parameter ^^^^^^^^^^ - **<"domain name">**: the domain name. - ****: preferred IP network. Default: 1. - 1: preferred resolution of IPv4 address - 2: resolve IPv4 address only - 3: resolve IPv6 address only - **<"IP address">**: the resolved IPv4 address or IPv6 address. Example ^^^^^^^^ :: AT+CWMODE=1 // set the station mode AT+CWJAP="SSID","password" // access to the internet AT+CIPDOMAIN="iot.espressif.cn" // Domain Name Resolution function // Domain Name Resolution Function for IPv4 address only AT+CIPDOMAIN="iot.espressif.cn",2 // Domain Name Resolution Function for IPv6 address only AT+CIPDOMAIN="ipv6.test-ipv6.com",3 // Domain Name Resolution Function for compatible IP address AT+CIPDOMAIN="ds.test-ipv6.com",1 .. _cmd-START: :ref:`AT+CIPSTART `: Establish TCP Connection, UDP Transmission, or SSL Connection -------------------------------------------------------------------------------------------- Establish TCP Connection ^^^^^^^^^^^^^^^^^^^^^^^^ Set Command """""""""""" **Command:** :: // Single connection (AT+CIPMUX=0): AT+CIPSTART=<"type">,<"remote host">,[,][,<"local IP">] // Multiple Connections (AT+CIPMUX=1): AT+CIPSTART=,<"type">,<"remote host">,[,][,<"local IP">] **Response:** :: CONNECT OK Parameters """"""""""" - ****: ID of network connection (0~4), used for multiple connections. - **<"type">**: string parameter showing the type of transmission: "TCP", or "TCPv6". Default: "TCP". - **<"remote host">**: string parameter showing the IPv4 address or IPv6 address or domain name of remote host. - ****: the remote port number. - ****: TCP keep-alive interval. Default: 0. - 0: disable TCP keep-alive function. - 1 ~ 7200: detection interval. Unit: second. - **<"local IP">**: the local IPv4 address or IPv6 address that the connection binds. This parameter is useful when you are using multiple network interfaces or multiple IP addresses. By default, it is disabled. If you want to use it, you should specify it first. Null is also valid. Notes """""" - If you want to establish TCP connection based on IPv6 network, set :ref:`AT+CIPV6=1 ` first, and ensure the connected AP by :ref:`AT+CWJAP ` supports IPv6 and esp-at got the IPv6 address which you can check it by AT+CIPSTA. - ```` parameter will eventually be configured to the socket option ``TCP_KEEPIDLE``. As for other socket options of keepalive, ``TCP_KEEPINTVL`` will use ``1`` by default, and ``TCP_KEEPCNT`` will use ``3`` by default. Example """"""""" :: AT+CIPSTART="TCP","iot.espressif.cn",8000 AT+CIPSTART="TCP","192.168.101.110",1000 AT+CIPSTART="TCP","192.168.101.110",1000,,"192.168.101.100" AT+CIPSTART="TCPv6","test-ipv6.com",80 AT+CIPSTART="TCPv6","fe80::860d:8eff:fe9d:cd90",1000,,"fe80::411c:1fdb:22a6:4d24" // esp-at has obtained an IPv6 global address by AT+CWJAP before AT+CIPSTART="TCPv6","2404:6800:4005:80b::2004",80,,"240e:3a1:2070:11c0:32ae:a4ff:fe80:65ac" Establish UDP Transmission ^^^^^^^^^^^^^^^^^^^^^^^^^^ Set Command """""""""""" **Command:** :: // Single connection (AT+CIPMUX=0): AT+CIPSTART=<"type">,<"remote host">,[,,,<"local IP">] // Multiple connections (AT+CIPMUX=1): AT+CIPSTART=,<"type">,<"remote host">,[,,,<"local IP">] **Response:** :: CONNECT OK Parameters """"""""""" - ****: ID of network connection (0~4), used for multiple connections. - **<"type">**: string parameter showing the type of transmission: "UDP", or "UDPv6". Default: "TCP". - **<"remote host">**: string parameter showing the IPv4 address or IPv6 address or domain name of remote host. - ****: remote port number. - ****: UDP port of ESP devices. - ****: In the UDP Wi-Fi passthrough, the value of this parameter has to be 0. - 0: After UDP data is received, the parameters ``<"remote host">`` and ```` will stay unchanged (default). - 1: Only the first time that UDP data is received from an IP address and port that are different from the initially set value of parameters ```` and ````, will they be changed to the IP address and port of the device that sends the data. - 2: Each time UDP data is received, the ``<"remote host">`` and ```` will be changed to the IP address and port of the device that sends the data. - **<"local IP">**: the local IPv4 address or IPv6 address that the connection binds. This parameter is useful when you are using multiple network interfaces or multiple IP addresses. By default, it is disabled. If you want to use it, you should specify it first. Null is also valid. Notes """""" - If the remote host over the UDP is an IPv4 multicast address (224.0.0.0 ~ 239.255.255.255), the ESP device will send and receive the UDPv4 multicast. - If the remote host over the UDP is an IPv4 broadcast address (255.255.255.255), the ESP device will send and receive the UDPv4 broadcast. - If the remote host over the UDP is an IPv6 multicast address (FF00:0:0:0:0:0:0:0 ~ FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF), the ESP device will send and receive the UDP multicast based on IPv6 network. - To use the parameter ````, parameter ```` must be set first. - If you want to establish UDP connection based on IPv6 network, set :ref:`AT+CIPV6=1 ` first, and ensure the connected AP by :ref:`AT+CWJAP ` supports IPv6 and esp-at got the IPv6 address which you can check it by AT+CIPSTA. Example """"""""" :: // UDP unicast AT+CIPSTART="UDP","192.168.101.110",1000,1002,2 AT+CIPSTART="UDP","192.168.101.110",1000,,,"192.168.101.100" // UDP unicast based on IPv6 network AT+CIPSTART="UDPv6","fe80::32ae:a4ff:fe80:65ac",1000,,,"fe80::5512:f37f:bb03:5d9b" // UDP multicast based on IPv6 network AT+CIPSTART="UDPv6","FF02::FC",1000,1002,0 Establish SSL Connection ^^^^^^^^^^^^^^^^^^^^^^^^ Set Command """"""""""""" **Command:** :: AT+CIPSTART=[,]<"type">,<"remote host">,[,,<"local IP">] **Response:** :: OK Parameters """"""""""" - ****: ID of network connection (0~4), used for multiple connections. - **<"type">**: string parameter showing the type of transmission: "SSL", or "SSLv6". Default: "TCP". - **<"remote host">**: string parameter showing the IPv4 address or IPv6 address or domain name of remote host. - ****: the remote port number. - ****: reserved item for SSL. Default: 0. - **<"local IP">**: the local IPv4 address or IPv6 address that the connection binds. This parameter is useful when you are using multiple network interfaces or multiple IP addresses. By default, it is disabled. If you want to use it, you should specify it first. Null is also valid. Notes """""" - The number of SSL connections depends on available memory and the maximum number of connections. For ESP8266 devices, only one SSL connection can be established due to limited memory. - SSL connection needs a large amount of memory. Insufficient memory may cause the system reboot. - If the ``AT+CIPSTART`` is based on an SSL connection and the timeout of each packet is 10 s, the total timeout will be much longer depending on the number of handshake packets. - If you want to establish SSL connection based on IPv6 network, set :ref:`AT+CIPV6=1 ` first, and ensure the connected AP by :ref:`AT+CWJAP ` supports IPv6 and esp-at got the IPv6 address which you can check it by AT+CIPSTA. - ```` parameter will eventually be configured to the socket option ``TCP_KEEPIDLE``. As for other socket options of keepalive, ``TCP_KEEPINTVL`` will use ``1`` by default, and ``TCP_KEEPCNT`` will use ``3`` by default. Example """""""" :: AT+CIPSTART="SSL","iot.espressif.cn",8443 AT+CIPSTART="SSL","192.168.101.110",1000,,"192.168.101.100" // esp-at has obtained an IPv6 global address by AT+CWJAP before AT+CIPSTART="SSLv6","240e:3a1:2070:11c0:6972:6f96:9147:d66d",1000,,"240e:3a1:2070:11c0:55ce:4e19:9649:b75" .. _cmd-STARTEX: :ref:`AT+CIPSTARTEX `: Establish TCP connection, UDP transmission, or SSL connection with an Automatically Assigned ID -------------------------------------------------------------------------------------------------------------------------------- This command is similar to :ref:`AT+CIPSTART ` except that you don't need to assign an ID by yourself in multiple connections mode (:ref:`AT+CIPMUX=1 `). The system will assign an ID to the new connection automatically. .. _cmd-PLUS: :ref:`[Passthrough Mode Only] +++ `: Exit from :term:`Passthrough Mode` ----------------------------------------------------------------------------------- Special Execute Command ^^^^^^^^^^^^^^^^^^^^^^^^ **Function:** Exit from :term:`Passthrough Mode` and enter the :term:`Passthrough Receiving Mode`. **Command:** :: // Only for passthrough mode +++ Notes """""" - This special execution command consists of three identical ``+`` characters (0x2b ASCII), and no CR-LF appends to the command tail. - Make sure there is more than 20 ms interval before the first ``+`` character, more than 20 ms interval after the third ``+`` character, less than 20 ms interval among the three ``+`` characters. Otherwise, the ``+`` characters will be sent out as normal passthrough data. - This command returns no reply. .. _cmd-SEND: :ref:`AT+CIPSEND `: Send Data in the :term:`Normal Transmission Mode` or Wi-Fi :term:`Passthrough Mode` ----------------------------------------------------------------------------------------------------------------- Set Command ^^^^^^^^^^^ **Function:** Set the data length to be send in the :term:`Normal Transmission Mode`. **Command:** :: // Single connection: (AT+CIPMUX=0) AT+CIPSEND= // Multiple connections: (AT+CIPMUX=1) AT+CIPSEND=, // Remote host and port can be set for UDP transmission: AT+CIPSEND=[,][,<"remote host">,] **Response:** :: OK > This response indicates that AT is ready for receiving serial data. You should enter the data, and when the data length reaches the ```` value, the transmission of data starts. If the connection cannot be established or is disrupted during data transmission, the system returns: :: ERROR If data is transmitted successfully, the system returns: :: SEND OK Execute Command ^^^^^^^^^^^^^^^ **Function:** Enter the Wi-Fi :term:`Passthrough Mode`. **Command:** :: AT+CIPSEND **Response:** :: OK > or :: ERROR Enter the Wi-Fi :term:`Passthrough Mode`. The ESP8266 devices can receive 2048 bytes and send 1460 bytes at most each time; the other ESP devices can receive 8192 bytes and send 2920 bytes at most each time. If the length of the currently received data is greater than the maximum number of bytes that can be sent, AT will send the received data immediately; Otherwise, the received data will be sent out within 20 ms. When a single packet containing :ref:`+++ ` is received, the ESP device will exit the data sending mode under the Wi-Fi :term:`Passthrough Mode`. Please wait for at least one second before sending the next AT command. This command can only be used for single connection in the Wi-Fi :term:`Passthrough Mode`. For UDP Wi-Fi passthrough, the ```` parameter has to be 0 when using :ref:`AT+CIPSTART `. Parameters ^^^^^^^^^^ - ****: ID of the connection (0~4), for multiple connections. - ****: data length. Maximum: 2048 bytes. - **<"remote host">**: IPv4 address or IPv6 address or domain name of remote host, can be set in UDP transmission. - ****: the remote port number. .. _cmd-SENDEX: :ref:`AT+CIPSENDEX `: Send Data in the :term:`Normal Transmission Mode` in Expanded Ways ---------------------------------------------------------------------------------------------------- Set Command ^^^^^^^^^^^ **Function:** Set the data length to be send in :term:`Normal Transmission Mode`, or use ``\0`` (0x5c, 0x30 ASCII) to trigger data transmission. **Command:** :: // Single connection: (AT+CIPMUX=0) AT+CIPSENDEX= // Multiple connections: (AT+CIPMUX=1) AT+CIPSENDEX=, // Remote host and port can be set for UDP transmission: AT+CIPSENDEX=[,][,<"remote host">,] **Response:** :: OK > This response indicates that AT is ready for receiving data. You should enter the data of designated length. When the data length reaches the ```` value, or when the string ``\0`` appears in the data, the transmission starts. If the connection cannot be established or gets disconnected during transmission, the system returns: :: ERROR If the data are successfully transmitted, the system returns: :: SEND OK Parameters ^^^^^^^^^^ - ****: ID of the connection (0~4), for multiple connections. - ****: data length. Maximum: 2048 bytes. - **<"remote host">**: IPv4 address or IPv6 address or domain name of remote host, can be set in UDP transmission. - ****: remote port can be set in UDP transmission. Notes ^^^^^^ - When the requirement of data length is met, or when the string ``\0`` (0x5c, 0x30 in ASCII) appears, the transmission of data starts. Go back to the normal command mode and wait for the next AT command. - If the data contains the ``\``, it means that drop backslash symbol and only use ```` character. - When sending ``\0``, please use a backslash to escape it as ``\\0``. .. _cmd-CLOSE: :ref:`AT+CIPCLOSE `: Close TCP/UDP/SSL Connection ----------------------------------------------------------- Set Command ^^^^^^^^^^^^^ **Function:** Close TCP/UDP/SSL connection in the multiple connections mode. **Command:** :: AT+CIPCLOSE= Execute Command ^^^^^^^^^^^^^^^^^ **Function:** Close TCP/UDP/SSL connection in the single connection mode. :: AT+CIPCLOSE **Response:** :: OK Parameter ^^^^^^^^^^ - ****: ID of the connection that you want to close. If you set it to 5, all connections will be closed. .. _cmd-IFSR: :ref:`AT+CIFSR `: Obtain the Local IP Address and MAC Address ----------------------------------------------------------------------- Execute Command ^^^^^^^^^^^^^^^ **Command:** :: AT+CIFSR **Response:** :: +CIFSR:APIP,<"APIP"> +CIFSR:APIP6LL,<"APIP6LL"> +CIFSR:APIP6GL,<"APIP6GL"> +CIFSR:APMAC,<"APMAC"> +CIFSR:STAIP,<"STAIP"> +CIFSR:STAIP6LL,<"STAIP6LL"> +CIFSR:STAIP6GL,<"STAIP6GL"> +CIFSR:STAMAC,<"STAMAC"> +CIFSR:ETHIP,<"ETHIP"> +CIFSR:ETHIP6LL,<"ETHIP6LL"> +CIFSR:ETHIP6GL,<"ETHIP6GL"> +CIFSR:ETHMAC,<"ETHMAC"> OK Parameters ^^^^^^^^^^ - **<"APIP">**: IPv4 address of Wi-Fi softAP interface - **<"APIP6LL">**: Linklocal IPv6 address of Wi-Fi softAP interface - **<"APIP6GL">**: Global IPv6 address of Wi-Fi softAP interface - **<"APMAC">**: MAC address of Wi-Fi softAP interface - **<"STAIP">**: IPv4 address of Wi-Fi station interface - **<"STAIP6LL">**: Linklocal IPv6 address of Wi-Fi station interface - **<"STAIP6GL">**: Global IPv6 address of Wi-Fi station interface - **<"STAMAC">**: MAC address of Wi-Fi station interface - **<"ETHIP">**: IPv4 address of ethernet interface - **<"ETHIP6LL">**: Linklocal IPv6 address of ethernet interface - **<"ETHIP6GL">**: Global IPv6 address of ethernet interface - **<"ETHMAC">**: MAC address of ethernet interface Note ^^^^^ - Only when the ESP device has the valid interface information can you query its IP address and MAC address. .. _cmd-MUX: :ref:`AT+CIPMUX `: Enable/disable Multiple Connections ---------------------------------------------------------------- Query Command ^^^^^^^^^^^^^ **Function:** Query the connection type. **Command:** :: AT+CIPMUX? **Response:** :: +CIPMUX: OK Set Command ^^^^^^^^^^^ **Function:** Set the connection type. **Command:** :: AT+CIPMUX= **Response:** :: OK Parameter ^^^^^^^^^^ - ****: connection mode. Default: 0. - 0: single connection. - 1: multiple connections. Notes ^^^^^ - This mode can only be changed after all connections are disconnected. - If you want to set the multiple connections mode, ESP devices should be in the :term:`Normal Transmission Mode` (:ref:`AT+CIPMODE=0 `). - If you want to set the single connection mode when the TCP/SSL server is running, you should delete the server first. (:ref:`AT+CIPSERVER=0 `). Example ^^^^^^^^ :: AT+CIPMUX=1 .. _cmd-SERVER: :ref:`AT+CIPSERVER `: Delete/create a TCP/SSL Server -------------------------------------------------------------- Query Command ^^^^^^^^^^^^^ **Function:** Query the TCP/SSL server status. **Command:** :: AT+CIPSERVER? **Response:** :: +CIPSERVER:[,,<"type">][,] OK Set Command ^^^^^^^^^^^ **Command:** :: AT+CIPSERVER=[,][,<"type">][,] **Response:** :: OK Parameters ^^^^^^^^^^ - ****: - 0: delete a server. - 1: create a server. - ****: It means differently depending on the parameter ````: - If ```` is 1, ```` represents the port number. Default: 333. - If ```` is 0, ```` represents whether the server closes all connections. Default: 0. - 0: shutdown the server and keep existing connections. - 1: shutdown the server and close all connections. - **<"type">**: server type: "TCP", "TCPv6", "SSL", or "SSLv6". Default: "TCP". This parameter is **NOT** applicable to ESP8266 platform due to memory limitation. - ****: not applicable to ESP8266 devices. - 0: disable CA. - 1: enable CA. Notes ^^^^^ - A TCP/SSL server can only be created when multiple connections are activated (:ref:`AT+CIPMUX=1 `). - A server monitor will be created automatically when the server is created. Only one server can be created at most. - When a client is connected to the server, it will take up one connection and be assigned an ID. - If you want to create a TCP/SSL server based on IPv6 network, set :ref:`AT+CIPV6=1 ` first, and obtain an IPv6 address. Example ^^^^^^^^ :: // To create a TCP server AT+CIPMUX=1 AT+CIPSERVER=1,80 // To create an SSL server AT+CIPMUX=1 AT+CIPSERVER=1,443,"SSL",1 // To create an SSL server based on IPv6 network AT+CIPMUX=1 AT+CIPSERVER=1,443,"SSLv6",0 // To delete an server and close all clients AT+CIPSERVER=0,1 .. _cmd-SERVERMAX: :ref:`AT+CIPSERVERMAXCONN `: Query/Set the Maximum Connections Allowed by a Server --------------------------------------------------------------------------------------------- Query Command ^^^^^^^^^^^^^ **Function:** Obtain the maximum number of clients allowed to connect to the TCP/SSL server. **Command:** :: AT+CIPSERVERMAXCONN? **Response:** :: +CIPSERVERMAXCONN: OK Set Command ^^^^^^^^^^^ **Function:** Set the maximum number of clients allowed to connect to the TCP/SSL server. **Command:** :: AT+CIPSERVERMAXCONN= **Response:** :: OK Parameter ^^^^^^^^^^ - ****: the maximum number of clients allowed to connect to the TCP/SSL server. Note ^^^^^ - You should call the command ``AT+CIPSERVERMAXCONN=`` before creating a server. Example ^^^^^^^^ :: AT+CIPMUX=1 AT+CIPSERVERMAXCONN=2 AT+CIPSERVER=1,80 .. _cmd-IPMODE: :ref:`AT+CIPMODE `: Query/Set the Transmission Mode ------------------------------------------------------------- Query Command ^^^^^^^^^^^^^ **Function:** Query the transmission mode. **Command:** :: AT+CIPMODE? **Response:** :: +CIPMODE: OK Set Command ^^^^^^^^^^^ **Function:** Set the transmission mode. **Command:** :: AT+CIPMODE= **Response:** :: OK Parameter ^^^^^^^^^^ - ****: - 0: :term:`Normal Transmission Mode`. - 1: Wi-Fi :term:`Passthrough Receiving Mode`, or called transparent receiving transmission, which can only be enabled in TCP single connection mode, UDP mode when the remote host and port do not change, or SSL single connection mode. Notes ^^^^^ - The configuration changes will NOT be saved in flash. Example ^^^^^^^^ :: AT+CIPMODE=1 .. _cmd-SAVET: :ref:`AT+SAVETRANSLINK `: Set Whether to Enter Wi-Fi :term:`Passthrough Mode` on Power-up ---------------------------------------------------------------------------------------------------- For TCP/SSL Single Connection ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Set Command """""""""""""" **Command:** :: AT+SAVETRANSLINK=,<"remote host">,[,<"type">,] **Response:** :: OK Parameters """""""""""""" - ****: - 0: ESP will NOT enter Wi-Fi :term:`Passthrough Mode` on power-up. - 1: ESP will enter Wi-Fi :term:`Passthrough Mode` on power-up. - **<"remote host">**: string parameter showing the IPv4 address or IPv6 address or domain name of remote host. - ****: the remote port number. - **<"type">**: string parameter showing the type of transmission: "TCP", "TCPv6", "SSL", or "SSLv6". Default: "TCP". - ****: TCP keep-alive interval. Default: 0. - 0: disable the keep-alive function. - 1 ~ 7200: detection interval. Unit: second. Notes """"""" - This command will save the Wi-Fi :term:`Passthrough Mode` configuration in the NVS area. If ```` is set to 1, ESP device will enter the Wi-Fi :term:`Passthrough Mode` in any subsequent power cycles. The configuration will take effect after ESP reboots. - As long as the remote host and port are valid, the configuration will be saved in flash. - If you want to establish TCP/SSL connection based on IPv6 network, set :ref:`AT+CIPV6=1 ` first, and ensure the connected AP by :ref:`AT+CWJAP ` supports IPv6 and esp-at got the IPv6 address which you can check it by AT+CIPSTA. Example """""""" :: AT+SAVETRANSLINK=1,"192.168.6.110",1002,"TCP" AT+SAVETRANSLINK=1,"www.baidu.com",443,"SSL" AT+SAVETRANSLINK=1,"240e:3a1:2070:11c0:55ce:4e19:9649:b75",8080,"TCPv6" AT+SAVETRANSLINK=1,"240e:3a1:2070:11c0:55ce:4e19:9649:b75",8080,"SSLv6" For UDP Transmission ^^^^^^^^^^^^^^^^^^^^ Set Command """""""""""""" **Command:** :: AT+SAVETRANSLINK=,<"remote host">,,[<"type">,] **Response:** :: OK Parameters """""""""""""" - ****: - 0: ESP will NOT enter Wi-Fi :term:`Passthrough Mode` on power-up. - 1: ESP will enter Wi-Fi :term:`Passthrough Mode` on power-up. - **<"remote host">**: string parameter showing the IPv4 address or IPv6 address or domain name of remote host. - ****: the remote port number. - **<"type">**: string parameter showing the type of transmission: "UDP" or "UDPv6". Default: "TCP". - ****: local port when UDP Wi-Fi passthrough is enabled on power-up. Notes """"""" - This command will save the Wi-Fi :term:`Passthrough Mode` configuration in the NVS area. If ```` is set to 1, ESP device will enter the Wi-Fi :term:`Passthrough Mode` in any subsequent power cycles. The configuration will take effect after ESP reboots. - As long as the remote host and port are valid, the configuration will be saved in flash. - If you want to establish UDP transmission based on IPv6 network, set :ref:`AT+CIPV6=1 ` first, and ensure the connected AP by :ref:`AT+CWJAP ` supports IPv6 and esp-at got the IPv6 address which you can check it by AT+CIPSTA. Example """"""""" :: AT+SAVETRANSLINK=1,"192.168.6.110",1002,"UDP",1005 AT+SAVETRANSLINK=1,"240e:3a1:2070:11c0:55ce:4e19:9649:b75",8081,"UDPv6",1005 .. _cmd-STO: :ref:`AT+CIPSTO `: Query/Set the local TCP/SSL Server Timeout ----------------------------------------------------------------------- Query Command ^^^^^^^^^^^^^ **Function:** Query the local TCP/SSL server timeout. **Command:** :: AT+CIPSTO? **Response:** :: +CIPSTO: