4G_2G DTU Products Function
- 40 -
WEBSOCKET: WebSocket mode, only Socket A support this
MQTT: MQTT mode, only Socket A support this
◆
iP: Target IP address, support domain name, max 50 bytes, default
【
nat2.iotworkshop.com
】
◆
port: Protocol port number, decimal number, 1 to 65535, default
【
3006
】
.
◆
mode: TCP connection type. This parameter is available only in TCP or HTTP mode. The
default
【
long
】
, includes the following parameters.
Long: Long connection.
Short: Short connection. connection is established when data is sent, and time is
disconnected when there is no data.
◆
time: TCP short connection disconnection delay time, this parameter is only available
under short connection, the range is 1~100 seconds, the default is
【
3
】
seconds.
Commend example:
1
、
SOCKA is set to TCP communication
a)
Long connection: AT+NETP=A,1,TCP,nat2.iotworkshop.com,3006,long
b)
Short connection: AT+NETP=A,1,TCP,nat2.iotworkshop.com,3006,short,3
2
、
SOCKA is set to WebSocket, MQTT
a)
AT+NETP=A,1,WEBSOCKET,123.56.240.XX,1883
b)
AT+NETP=A,1,MQTT,123.56.240.XX,1883
3
、
SOCKB is set to UDP communication
a)
AT+NETP=B,1,UDP,nat2.iotworkshop.com,3008
2.4.2.20.
AT+NETPLK
◼
Function: Set/query communication channel TCP connection status
◼
Format:
◆
Query Operation:
AT+NETPLK=<id><CR>
+ok=<id,status><CR><LF><CR><LF>
◆
Set Operation:
AT+NETPLK=<id,value><CR>
+ok<CR><LF><CR><LF>
◼
Parameter:
◆
id: Communication channel number, including the following parameters.
⚫
A: Socket A channel.
⚫
B: Socket B channel.
⚫
C: Socket C channel.
◆
status: Connection status.
⚫
On: Connected
⚫
Off: Not connected, default
【
off
】
◆
value: Manually open/close TCP connection.
⚫
on: Start TCP connection
⚫
off: Close TCP connection
2.4.2.21.
AT+TCPTO
◼
Function: Set/Query socket TCP timeout; Setting is valid after reset.
◼
Format:
◆
Query Operation:
AT+TCPTO=<id><CR>
+ok=<id,time><CR><LF><CR><LF>
◆
Set Operation:
AT+TCPTO=<id,time><CR>
+ok<CR><LF><CR><LF>
◼
Parameter:
◆
id: Communication channel number, including the following parameters.
⚫
A: Socket A channel.