Tcp/Udp Transparent Transmission Channel Function Configuration - Ebyte EA01-S User Manual

Nb-iot module
Table of Contents

Advertisement

Chengdu Ebyte Electronic Technology Co., Ltd

3.10 TCP/UDP transparent transmission channel function configuration

3.10.1 TCP/UDP address and port configuration
AT Command
AT+SOCKADDR =<addr>,<port>,<local_port>,<type>
\r\n
AT+SOCKADDR \r\n
(1) Socket0 address supports IP address and domain name, and the maximum byte length supports 50 bytes. Device
software restart, hardware reset and normal power-on automatically connect to socket0. To wake up the device from
deep sleep, you need to enter the command AT+SOCKONOFF to connect to socket0. If the server does not release the
link before connecting, the terminal needs to successfully disconnect the link first and then connect to socket 0.
(2) Configuration parameter description:
<addr>: Support IP address or domain name, the maximum byte length is 50 bytes.
<Port>: The port of the remote server.
<local_port>: Local port, 0 means freely selected by tcpip, the default is 0.
<type>: 0 means TCP protocol, 1 means UDP protocol.
Note: When you need to save after power-off, input AT+NRB command to save the parameters to the flash, and
automatically restart to take effect..
(2) Socket connection status changes will be actively reported: AT+XSSTATE:<id>,<state>:
<id>: It means the created socket id, currently only supports 0 and 1, TCP/UDP channel can only use 0, COAP, MQTT,
Ebyte cloud uses 1.
<state>: It represents the socket connection status, 1 means connected, 0 means disconnected.
3.10.2 Open and close TCP/UDP socket0 connection
AT command
AT+SOCKONOFF=<enable>,<on-off>\r\n
<enable>: It indicates whether to enable the TCP/UDP channel, 1 indicates enable, and 0 indicates disable. The default is
to enable TCP/UDP channel opening.
Copyright ©2012–2020,Chengdu Ebyte Electronic Technology Co., Ltd
Response
OK
address:< addr >,port:< port >,local
port: <local_port>,type:<type>
OK
Respond
+XSSTATE:< id>,<state>
OK
EA01-S User Manual
10

Advertisement

Table of Contents
loading

Table of Contents