Last Updated on : 2024-07-01 08:47:27download
This topic describes the serial protocol that is used to implement serial communication between Tuya’s Wi-Fi module and the third-party MCU.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | It is fixed to 0x55aa . |
Version | 1 | The firmware version number of your MCU. |
Command | 1 | A specific command to instruct the hardware to act and perform certain tasks. |
Data length | 2 | Data in big-endian format. |
Data | Depends on data | The payload. |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Product information consists of the product ID and the MCU software version number.
x.x.x
. x
is a decimal digit between 0 and 99.The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | Valid values:
|
Command | 1 | 0x01 |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Example: 0x55aa 00 01 0000 00
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | Valid values:
|
Command | 1 | 0x01 |
Data length | 2 | N |
Data | Depends on data | See the example. |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Example: {"v":"1.0.0", "m":0, "cap":0, "p":"mhnmpqzf7ntzm***", "s":0,}
v
: the MCU firmware version. Example: 1.0.0
m
: the pairing mode. The gateway pro only supports the default pairing mode.
cap
: the capability that a gateway has. The value of this parameter is a decimal value to which a hexadecimal value converts. The feature represented by each bit:
Bit2: support for data point (DP).
Bit4: support for updating MCU’s firmware.
Bit5: support for group control command sub_id
.
The unused bits are padded with zeros.
Assume a gateway does not support the local group control (bit0 is 0) and the local scenes (bit1 is 0) but supports the data point (bit2 is 1). The value of cap
is 0000 0000 0000 0100
in hex, which is 4 in decimal.
p
: the product ID (PID). In the example, the PID is mhnmpqzf7ntz****
.
(Optional) s
: specifies whether a gateway supports the security feature. Its value defaults to 0
.
When the network status of the module changes, the module will proactively send its current status to the MCU.
Network status | Description | Status value |
---|---|---|
Status 2 | Pair a gateway in AP mode. | 0x01 |
Status 3 | The Wi-Fi network is set up, but the device is not connected to the router. | 0x02 |
Status 4 | The Wi-Fi network is set up, and the device is connected to the router. | 0x03 |
Status 5 | The device is connected to the router and the cloud. | 0x04 |
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x03 |
Data length | 2 | 0x0001 |
Data | 1 | Valid values that represent the Wi-Fi network status:
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Example: 0x55aa 00 03 0001 00 03
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x03 |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Example: 0x55aa 00 03 0000 02
After a gateway is unbound from the mobile app, it will enter the AP pairing mode (status value 0x01
).
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x04 |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Example: 0x55aa 00 04 0000 03
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x04 |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Example: 0x55aa 00 04 0000 03
The app sends a command to the gateway to allow a sub-device to join the network within a specified time period.
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x06 |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x06 |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The app sends a command to the gateway to stop allowing a device to join the network.
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x07 |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x07 |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
pk_type
: default to 1
.channel
is required if you enable the OTA update feature for the sub-device. Its value defaults to 10
. Go to the Tuya IoT Development Platform > Hardware Development > Add Custom Firmware > Update Channel to set the channel for OTA update.channel
might cause the OTA feature to fail.The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x08 |
Data length | 2 | N |
Data | N |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x08 |
Data length | 2 | 0x0001 |
Data | 1 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module sends the MCU the information about deleting a sub-device.
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x09 |
Data length | 2 | N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x09 |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module sends a heartbeat packet to the MCU regularly to check the status of its connection to sub-devices. The heartbeat check interval depends on the number of connected sub-devices. The more the sub-devices are connected, the shorter the interval is.
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x0A |
Data length | 2 | N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
The online device must respond to the heartbeat packet. If the module does not receive a response in two consecutive intervals, it will declare that a device is offline.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x0A |
Data length | 2 | N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
This module sends this command to the MCU to get the current status of the sub-device.
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x0B |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns status by using the data reporting command.
The module sends a command to instruct the MCU to perform a specific task.
raw
type are the object
types.The following table lists the format and type of the data unit.
Data segment | Length (byte) | Description |
---|---|---|
dpid | 1 | The identifier of a DP (DP ID). |
type | 1 | It indicates the data type of a DP defined on the Tuya IoT Development Platform.
|
len | 2 | The length is the number of bytes of the value , in big-endian format. |
value | 1/2/4/N | Represented in hexadecimal format. Data greater than one byte is transmitted in big-endian format. |
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x0C |
Data length | 2 | N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The sub-device responds to a status query from the gateway or proactively sends the current status of DPs to the module on the gateway.
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x0D |
Data length | 2 | N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Add a sub-device to a local group.
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x0E |
Data length | 2 | N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x0E |
Data length | 2 | N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Delete a sub-device from a local group.
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x0F |
Data length | 2 | N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x0F |
Data length | 2 | N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x10 |
Data length | 2 | 0x0000 |
Data | 0 | Example: 0x55aa 00 10 0000 0F |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x10 |
Data length | 2 | 0x0007 |
Data | 7 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x11 |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x11 |
Data length | 2 | 0x0008 |
Data | 8 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Add sub-devices with the same PID in bulk. Up to 32 sub-devices can be added at a time.
The current version of the SDK does not support updating sub-devices by using OTA.
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x12 |
Data length | 2 | N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x12 |
Data length | 2 | N |
Data | 1 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module sends the result of adding sub-devices to the MCU.
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x13 |
Data length | 2 | N |
Data | N |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x13 |
Data length | 2 | 0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x14 |
Data length | 2 | N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x14 |
Data length | 2 | 0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module scans the router whose SSID is tuya_mdev_test
and returns the scanning result and signal strength in percentage.
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x15 |
Data length | 2 | 0x0000 |
Data | Data | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x15 |
Data length | 2 | 0x0002 |
Data | 2 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU can send this command to the module to get the Wi-Fi status. For more information about the types of Wi-Fi status, see Report network status. The module does not respond to the network status query until the network initialization is completed.
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x16 |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x16 |
Data length | 2 | 0x0001 |
Data | 1 | Valid values that represent the Wi-Fi network status:
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU uses this command to perform a local factory reset. This command should be sent when the device is online or before the device is activated for the first time. Otherwise, it will cause the information on the local device to be out of sync with the cloud server.
After a local factory reset, Bluetooth sub-devices will be directly deleted from the app rather than added to the device list on the home page of the app.
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x17 |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
After receiving a command to disconnect from or perform a factory reset on a sub-device, the module will report the removal status to the MCU.
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x18 |
Data length | 2 | 0x0001 |
Data | 1 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU sends a command to the module to delete a sub-device.
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x19 |
Data length | 2 | N |
Data | Depends on data | Example: { “sub_id”:“xxx” } |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x19 |
Data length | 2 | 0x0001 |
Data | 1 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x1A |
Data length | 2 | 0x0003 |
Data | 3 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x1A |
Data length | 2 | 0x0001 |
Data | 1 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU can query all the sub-devices connected to the gateway. If the length of the list is greater than 255 bytes, the payload will be delivered in multiple packets.
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x1C |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x1C |
Data length | 2 | N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
You can choose the desired update options for the OTA firmware update. The module only serves as the channel for OTA data transmission, without any data parsing operation.
After the module has sent all update packets, it will send the command 0x01
to request the product information. The MCU must reply with the new MCU firmware version number within one minute. The new version number should be consistent with that configured on the Tuya IoT Development Platform.
The update options:
The following flowchart shows how the OTA firmware update works.
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x1D |
Data length | 2 | 0x0004 |
Data | 4 | The size of the update, in big-endian format. |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x1D |
Data length | 2 | 0x0001 |
Data | 1 | The options on the maximum size of each packet:
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x1E |
Data length | 2 | 0x0004+m m : the offset in bytes. |
Data | offset_addr(4byte) + pack(mbyte) | offset_addr : the offset address. pack : the payload. |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Assume that the size of the update is 530 bytes. The MCU does not need to respond to the last packet.
For the first packet, the packet offset is 0x00000000
, and the packet length is 256 bytes.
0x55aa 00 1e 0104 00000000 xx … xx XX
For the second packet, the packet offset is 0x00000100
, and the packet length is 256 bytes.
0x55aa 00 1e 0104 00000100 xx … xx XX
For the third packet, the packet offset is 0x00000200
, and the packet length is 18 bytes.
0x55aa 00 1e 0016 00000200 xx … xx XX
For the last packet, the packet offset is 0x00000212
, and the packet length is 0 bytes.
0x55aa 00 1e 0004 00000212 XX
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x1E |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x1F |
Data length | 2 | None |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x1F |
Data length | 2 | 0x0001 |
Data | 1 | The options on the maximum size of each packet:
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x20 |
Data length | 2 | None |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Assume that the sub_id
is 1234 and the size of the update is 530 bytes. The MCU does not need to respond to the last packet.
For the first packet, the packet offset is 0x00000000
, and the packet length is 256 bytes.
0x55aa 00 20 0109 04 31 32 33 34 00000000 xx…xx XX
For the second packet, the packet offset is 0x00000100
, and the packet length is 256 bytes.
0x55aa 00 20 0109 04 31 32 33 34 00000100 xx…xx XX
For the third packet, the packet offset is 0x00000200
, and the packet length is 18 bytes.
0x55aa 00 20 001B 04 31 32 33 34 00000200 xx…xx XX
For the last packet, the packet offset is 0x00000212
, and the packet length is 0 bytes.
0x55aa 00 20 0009 04 31 32 33 34 00000212 XX
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x20 |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x21 |
Data length | 2 | None |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x21 |
Data length | 2 | None |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
sub_id
)The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x22 |
Data length | 2 | N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x22 |
Data length | 2 | 0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x23 |
Data length | 2 | None |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x23 |
Data length | 2 | 0x0001 |
Data | None |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x29 |
Data length | 2 | N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns status by using the data reporting command.
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2A |
Data length | 2 | N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2A |
Data length | 2 | 0x0001 |
Data | 1 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the MAC address of the wireless network interface.
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2B |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2B |
Data length | 2 | 0x0007 |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2C |
Data length | 2 | N |
Time | 7 |
|
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2C |
Data length | 2 | 0x0001 |
Data | 1 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2D |
Data length | 2 | N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2D |
Data length | 2 | 0x0007 |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2E |
Data length | 2 | N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2E |
Data length | 2 | N |
Data | Depends on data | Example: {"gid":"xxx","sub_id":"xxxx" } |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2F |
Data length | 2 | N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2F |
Data length | 2 | 0x0001 |
Data | 1 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x33 |
Data length | 2 | 0x0001 |
Data | 1 | Command: 0x03 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Example: 55 AA 00 33 00 01 03 36
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x33 |
Data length | 2 | 1+2+1+7 |
Data | 11 | -750 represents the GMT-7 time zone.
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x34 |
Data length | 2 | 2 |
Data | 1 | Subcommand: 0x09 |
Status | 0: Restart device | |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x34 |
Data length | 2 | 2 |
Data | 1 | Subcommand: 0x09 |
Result |
|
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
This command only applies to modules that support 4G network.
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x72 |
Data length | 2 | 2 |
Data | 1 | Subcommand: 0x01 |
Status |
|
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x72 |
Data length | 2 | 2 |
Data | 1 | Subcommand: 0x01 |
Result |
|
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
This section describes the commands specific to the security feature. For more information about implementing the feature, see Security Gateway Capability.
This command is used to arm or disarm the security system.
0
. The arm delay setup on the mobile app prevails.sub_id
: NULL
means the gateway itself.The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC0 |
Data length | 2 | 1+N |
Data | Depends on data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC0 |
Data length | 2 | 2 |
Data | 1 | Subcommand: 0x00 |
1 | Operation result:
|
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU sends this command to get the current status of the security system.
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC0 |
Data length | 2 | 1 |
Data | 1 | Subcommand: 0x01 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC0 |
Data length | 2 | 1+N |
Data | 1 | Subcommand: 0x01 |
Depends on data |
|
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
After receiving the security mode settings from the mobile app, the module uses this command to sync the information with the MCU.
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC0 |
Data length | 2 | 1+N |
Data | 1 | Subcommand: 0x02 |
Depends on data |
|
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC0 |
Data length | 2 | 1 |
Data | 1 | Subcommand: 0x02 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
After receiving a disarming event, the module should notify the MCU to cancel the alarm through the DP 32. You need to set the alarm status.
The module syncs the security events with the MCU by using this command.
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC0 |
Data length | 2 | 1+N |
Data | Subcommand | 0x03 |
Depends on data |
|
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC0 |
Data length | 2 | 1 |
Data | Subcommand | 0x03 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The alarm delay is set by using the mobile app. After the countdown is done, the module should send the alarm status to the app. If the alarm status is not set, the cloud will also send a message to the app because of the fault tolerance mechanism. We recommend you set the alarm status.
The MCU syncs the alarm status with the module through the DP 32.
The MCU sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 2 |
Data | Subcommand | 0x00 |
The alarm status. |
|
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The module returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 2 |
Data | Subcommand | 0x00 |
Operation result |
|
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
When alarm delay is running, the module syncs the current alarm status to the MCU.
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 2 |
Data | 1 | Subcommand: 0x03 |
1 | Alarm delay status
|
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 1 |
Data | 1 | Subcommand: 0x03 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
This is a new command used to sync alarm information. It works with bit0
of the A
field in the 0x01
command. If bit0
is enabled, processing 0xc101
and 0xc102
is not necessary.
GP
field is not supported.The gp
field is reserved for the feature of multi-protection areas. The MCU does not return the value of this field.
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 1+N |
Data | 1 | Subcommand: 0x04 |
Depends on data |
|
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 1 |
Data | Subcommand | 0x04 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
This is a new command used to sync alarm status. It works with the enabled bit0
of the A
field in the 0x01
command.
The module sends the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 2 |
Data | 1 | Subcommand: 0x05 |
Data |
|
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 1 |
Data | 1 | Subcommand: 0x05 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback