Appearance
Data Interaction Commands
Data Interaction Command Overview
These AT commands realize the feature of data interaction after the device is connected to Developer Center, including sending and receiving transparent transmission data, sending and receiving TSL data and reporting request information.
AT Command | Description |
---|---|
AT+QIOTSEND | Send Transparent Transmission Data to Developer Center |
AT+QIOTRD | Read Transparent Transmission Data Issued by Developer Center |
AT+QIOTMODELTD | Send TSL Data to Developer Center |
AT+QIOTMODELRD | Read TSL Data Issued by Developer Center |
AT+QIOTINFO | Request QuecThing to Report Device Information |
AT Command Description
AT+QIOTSEND (Send Transparent Transmission Data to Developer Center)
- Description: This command sends transparent transmission data to Developer Center.
- Maximum Response Time: 300 ms.
- Characteristics: The command takes effect immediately.
Test Command
Issue
cAT+QIOTSEND=?
Response
Return the supported sending modes and range of data length.
c+QIOTSEND: (range of supported <mode>s),(range of supported <length>s),<data> OK
Write Command
Issue
cAT+QIOTSEND=<mode>,<length>[,<data>]
Response
If the optional parameter is specified and the connection is established,
- If a Package ID has been configured to respond to the uplink message:
c+QIOTSEND: <txid> OK
- If not:
cOK
If the optional parameter is omitted and the connection is established,
c>
After ">" is responded, input the data with the length equal to <length>
- If it is required to configure a Package ID for the device to report a message to Developer Center:
c+QIOTSEND: <txid> OK
- If not:
cOK
If there is any error:
cERROR
Parameter
<mode>
: Integer type. Data sending mode.0
: Send NON data and the set the carried RAI to 01
: Send NON data and the set the carried RAI to 12
: Send NON data and the set the carried RAI to 2100
: Send CON data and the set the carried RAI to 0101
: Send CON data and the set the carried RAI to 1102
: Send CON data and the set the carried RAI to 2
Explanation of sending modes:
In NON mode, the server ACK is not required for sending data.
In CON mode, after the module sends data and receives the server ACK, it will notify the application layer by URC.
Explanation of RAI:
0: No indication
1: No further uplink or downlink data is expected after the data is sent and the core network can be released immediately.
2: A single downlink data packet with corresponding reply is expected after the data is sent and the core network can be released immediately.
<length>
: Integer type. The length of data to be sent. Unit: byte.- If <data> in Write Command is specified, the length range is the actual value returned by Test Command.
- If <data> in Write Command is omitted, the length range depends on the performance of the specific module.
<data>
: Data to be sent.- If <data> in Write Command is specified, the data to be sent can only be a string.
- If <data> in Write Command is omitted, the data to be sent can be any byte stream type data, which depends on the performance of the specific module.
<txid>
: Integer type. Uplink data ID.- If QoS = 0, this value is 0.
- If QoS > 0, range: 1–65535.
NOTE
- This command is supported in SDK versions 2.1.2 and above.
There will be event callback when <mode> is equal to 100, 101 or 102.
Example 1 (Send transparent transmission data.)
Note: Ensure that the device is online during business data interaction.
Send transparent transmission data "ABCabc123456" to Developer Center. Send “ABCabc123456” after > is returned.
c
[TX]AT+QIOTSEND=1,12
[RX]>
[TX]ABCabc123456
[RX]OK
[RX]+QIOTEVT: 4,10200
AT+QIOTRD (Read Transparent Transmission Data Issued by Developer Center)
- Description: This command reads transparent transmission data issued by Developer Center.
- Maximum Response Time: 300 ms.
- Characteristics: The command takes effect immediately.
Test Command
Issue
cAT+QIOTRD=?
Response
Return the data length to be read.
c+QIOTRD: (range of supported <req_length>s) OK
Read Command
Issue
cAT+QIOTRD?
Response
Return the number of remaining data packages.
c+QIOTRD: <remain_pieces> OK
Write Command
Issue
cAT+QIOTRD=<req_length>
Response
Successfully read the transparent transmission data.
c+QIOTRD: <cur_len>,<remain_len>,<remain_pieces> <data>
If not:
cERROR
Parameter
<req_length>
: Integer type. Length of data to be read. Length range is subject to the value returned by the Test Command.<cur_len>
: Integer type. Length of data actually read.<data>
: Byte stream type. Data actually read.<remain_len>
: Integer type. Length of unread data remaining in the current data packet. Unit: byte.<remain_pieces>
: Integer type. The number of remaining data package.
NOTE
- This command is supported in SDK versions 2.1.2 and above.
Example
Note: Ensure that the device is online during business data interaction.
Example 1 (Read the downlink data in buffer mode.)
i. Developer Center issues transparent transmission data "123456".
ii. The module prints the callback event {+QIOTEVT: 5,10200}.
iii. Send AT+QIOTRD? to query the number of remaining data packages.
iiii. Send AT+QIOTRD=1024 to query the data actually read.
c
[RX]+QIOTEVT: 5,10200
[TX]AT+QIOTRD?
[RX]+QIOTRD: 1
[RX]OK
[TX]AT+QIOTRD=1024
[RX]+QIOTRD: 6,0,0
[RX]123456
[RX]OK
Example 2 (Read the downlink data in unbuffered mode.) In unbuffered mode, the module will print the transparent transmission data issued by Developer Center to the port.
c
[RX]+QIOTEVT: 5,10200,6
123456
AT+QIOTMODELTD (Send TSL Data to Developer Center)
- Description: This command sends TSL data to Developer Center. If <pkgID> is specified in Write Command, this command responds to Developer Center request. If <pkgID> is omitted in Write Command, this command sends data to Developer Center. If the data is sent and QoS level is 1 or 2, +QIOTEVT: 4,10210 will be returned to indicate that TSL data was sent successfully.
- Maximum Response Time: 300 ms.
- Characteristics: The command takes effect immediately.
Test Command
Issue
cAT+QIOTMODELTD=?
Response
Return the parameter range supported to be configured.
c+QIOTMODELTD: (range of supported <mode>s),<length>,(range of supported <pkgID>s) OK
Write Command
Issue
cAT+QIOTMODELTD=<mode>,<length>[,<pkgID>]
Response
c> After > is returned, input the byte stream data with the length equal to <length>.
If response Package ID is required when you configure an uplink message, this command responds to Developer Center request.
cOK
If response Package ID is not required when you configure an uplink message, this command sends data to Developer Center.
- When AT+QIOTCFG="txid_mode",1 is executed, it returns
c+QIOTMODELTD: <txid> OK
- Otherwise
cOK
If there is any error:
cERROR
Parameter
<mode>
Integer type. Data sending mode.0
: Send NON data and the set the carried RAI to 01
: Send NON data and the set the carried RAI to 12
: Send NON data and the set the carried RAI to 2100
: Send CON data and the set the carried RAI to 0101
: Send CON data and the set the carried RAI to 1102
: Send CON data and the set the carried RAI to 2
Explanation of sending modes:
In NON mode, the server ACK is not required for sending data.
In CON mode, after the module sends data and receives the server ACK, it will notify the application layer by URC.
Explanation of RAI:
0: No indication
1: No further uplink or downlink data is expected after the data is sent and the core network can be released immediately.
2: A single downlink data packet with corresponding reply is expected after the data is sent and the core network can be released immediately.
<length>
: Integer type. Length of data to be sent. Length range depends on the performance of the specific module model.<pkgID>
: Integer type. Request Package ID. Range: 1–65534. This parameter is required only when the device responds to the Developer Center request.<txid>
: Integer type.- If QoS = 0,
<txid>
is 0. - If QoS = 1 or 2,
<txid>
- range is 1–65535.
- If QoS = 0,
NOTE
- This command is supported in SDK versions 2.1.2 and above. Parameter <txid> is not supported
Example
Note: Add TSL model on Developer Center according to actual project requirement. Ensure that the device is online during business data interaction.
Example 1 (Send TSL properties)
- Feature ID: 1. Data Format: BOOL. Value: true.
- Feature ID: 2. Data Format: INT. Value: 100.
- Feature ID: 3. Data Format: FLOAT. Value: 28.56.
- Feature ID: 4. Data Format: ENUM. Value: 1.
- Feature ID: 5. Data Format: TEXT. Value: Hello World.
- Feature ID: 6. Data Format: DATE. Value: 1658030723000.
- Feature ID: 7. Data Format: STRUCT. Value: {"1":true,"2":100}.
c
[TX]AT+QIOTMODELTD=1,93
[RX]>
[TX]{"1":true,"2":100,"3":28.56,"4":1,"5":"Hello World","6":1658030723000,"7":{"1":true,"2":100}}
[RX]OK
[RX]+QIOTEVT: 4,10210
Example 2 (Sending TSL event.)
Feature ID: 2; { Output Parameter ID: 1; Data Format: FLOAT; Value: 25.86 };
c
[TX]AT+QIOTMODELTD=1,17
[RX]>
[TX]{"2":{"1":25.86}}
[RX]OK
[RX]+QIOTEVT: 4,10210
Example 3 (Respond to the Developer Center request package)
i. Click "View" on the "Define Feature" Definition" Page of Developer Center. ii. The module prints callback function {+QIOTEVT: 5,10211,7,1}. iii. Respond to the TSL data whose Package ID is 7.
c
[TX]AT+QIOTMODELTD=1,11,7
[RX]>
[TX]{"1":25.14}
[RX]OK
Example 4 (Send an ARRAY of TSL properties in STRUCT format)
- Feature ID: 8. Data Format: ARRAY. Maximum number of elements: 3.
- Element type: STRUCT
- Feature ID: 1. Data Format: BOOL.
- Feature ID: 2. Data Format: INT.
- Feature ID: 3. Data Format: ENUM.
- Feature ID: 4. Data Format: TEXT.
- Element type: STRUCT
c
[TX]AT+QIOTMODELTD=1,120
[RX]>
[TX]{"8":[{"1":true,"2":10,"3":1,"4":"ABC123"},{"1":false,"2":10,"3":1,"4":"ABC123"},{"1":false,"2":10,"3":1,"4":"ABC123"}]}
[RX]OK
[RX]+QIOTEVT: 4,10210
AT+QIOTMODELRD (Read TSL data issued by Developer Center)
- Description: This command reads the TSL data issued by Developer Center.
- Maximum Response Time: 300 ms.
- Characteristics: The command takes effect immediately.
Test Command
Issue
cAT+QIOTMODELRD=?
Response
Return the data range supported to be read.
c+QIOTMODELRD: (range of supported <req_length>s) OK
Read Command
Issue
cAT+QIOTMODELRD?
Response
Return the number of remaining data packets.
c+QIOTMODELRD: <remain_pieces> OK
Write Command
Issue
cAT+QIOTMODELRD=<req_length>
Response
If the optional parameter is specified and the connection is established:
c+QIOTMODELRD: <cur_len>,<remain_len>,<remain_pieces> <data> OK
If there is any error:
cERROR
Parameter
<req_length>
: Integer type. Length of the data to be read. Length range is subject to the value returned by Test Command.<cur_len>
: Integer type. Length of the data actually read.<data>
: Byte stream type. Data actually read.<remain_len>
: Integer type. Length of unread data remaining in the current data packet. Unit: byte.<remain_pieces>
: Integer type. Number of remaining data packets.
NOTE
- This command is supported in SDK versions 2.1.2 and above.
Example
Note: Add TSL model on Developer Center according to actual project requirement. Ensure that the device is online during business data interaction.
Example 1 (Read TSL data in unbuffered mode.)
- Feature ID: 1. Data Format: BOOL. Value: true.
- Feature ID: 2. Data Format: INT. Value: 100.
- Feature ID: 3. Data Format: FLOAT. Value: 28.56.
- Feature ID: 4. Data Format: ENUM. Value: 1.
- Feature ID: 5. Data Format: TEXT. Value: Hello World.
- Feature ID: 6. Data Format: DATE. Value: 1658030723000.
- Feature ID: 7. Data Format: STRUCT. Value: {"1":true,"2":100}.
c
[RX]+QIOTEVT: 5,10210,93
[RX]{"1":true,"2":100,"3":28.56,"4":1,"5":"Hello World","6":1658030723000,"7":{"1":true,"2":100}}
Example 2 (Read TSL data in buffer mode.)
- Feature ID: 1. Data Format: BOOL. Value: true.
- Feature ID: 2. Data Format: INT. Value: 100.
- Feature ID: 3. Data Format: FLOAT. Value: 28.56.
- Feature ID: 4. Data Format: ENUM. Value: 1.
- Feature ID: 5. Data Format: TEXT. Value: Hello World.
- Feature ID: 6. Data Format: DATE. Value: 1658030723000.
- Feature ID: 7. Data Format: STRUCT. Value: {"1":true,"2":100}.
c
[RX]+QIOTEVT: 5,10210
[TX]AT+QIOTMODELRD=1024
[RX]+QIOTMODELRD: 93,0,0
[RX]{"1":true,"2":100,"3":28.56,"4":1,"5":"Hello World","6":1658030723000,"7":{"1":true,"2":100}}
[RX]OK
AT+QIOTINFO (Request QuecThing to Report Device Information)
- Description: This command requests QuecThing to report device information.
- Maximum Response Time: 300 ms.
- Characteristics: The command takes effect immediately.
Test Command
Issue
cAT+QIOTINFO=?
Response
c+QIOTINFO: "up" OK
Read Command
Issue
cAT+QIOTINFO?
Response
Return the keywords and data of the reported information.
c+QIOTINFO: <item1>,<value1> [+QIOTINFO: <item2>,<value2> [...]] OK
If there is any error:
cERROR
Write Command
Issue
cAT+QIOTINFO="up"
Response
If device information is successfully reported:
cOK
If there is any error:
cERROR
Parameter
<itemN>
: String type. Keywords of reported information.<valueN>
: String type. Information data.
NOTE
- This command is supported in SDK versions 2.1.2 and above.
Example
Example 1 (Report device information)
c
[TX]AT+QIOTINFO="up"
[RX]OK