Last Updated on : 2024-05-14 08:00:14download
Tuya Wi-Fi serial port protocol is a customized protocol for Wi-Fi modules. It is used for serial port communication between Tuya Wi-Fi modules and other MCU serial ports.
The architecture diagram is shown as follows.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | It is fixed as 0x55aa |
Version | 1 | MCU software version number used for upgrading and extension |
Command | 1 | Specific command |
Data length | 2 | In big-endian mode |
Data | Depend on specific data | Data transmitted |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
Field | Bytes | 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 . |
value | 1/2/4/N | Represented in hexadecimal format. Data greater than one byte is transmitted in big-endian format. |
Product information consists of product ID (PID) and the MCU software version.
x.x.x
(0 ≤ x ≤ 99), and x is a decimal digit.The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | The following two versions are supported:
|
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 |
For example, 0x55aa 00 01 0000 00
The MCU returns the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 or 0x01 |
Command | 1 | 0x01 |
Data length | 2 | N |
Data | Depend on specific 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 |
For example, {"v":"1.0.0", "m":1, "cap":0, "p":"mhnmpqzf7ntzm***", "n":0, "s":0, "a":0}
V
: the version number of MCU. For example, 1.0.0.
m
: pairing method.
0
: default pairing1
: low power consumption2
: special pairingcap
: Capabilities supported by the device. The value has been converted from hexadecimal to decimal. The corresponding functions of the bits are as follows:
bit0
: local group
bit1
: local scenario
bit2
: data point (DP)
bit3
: SIG mesh
bit4
: MCU upgrade
bit5
: group control command with sub_id
bit6
: Bluetooth serial port pairing, with the access point (AP) mode by default
Note: For example, the device does not support local groups (
bit0
is 0) or local scenario (bit1
is 0), but supports DPs (bit2
is 1). The hexadecimal data is0000 0000 0000 0100
, that is, thecap
value is 4.
p
: product ID (PID). The PID in the example is mhnmpqzf7ntzm***.
n
(optional): pairing mode.
Without this field: Switch between SmartConfig and AP pairing modes.
0: Indicates that both SmartConfig and AP pairing modes are available.
Note: After this pairing mode is selected, the command operation in the Reset Wi-Fi and select the pairing mode section will be invalid. The SmartConfig and AP pairing mode will remain after reset.
1: Only supports AP pairing mode.
Note: In this mode, the pairing can only be implemented through AP connection. After this pairing mode is selected, the command operation in the Reset Wi-Fi and select the pairing mode section will be invalid. The AP pairing mode will remain after reset.
s
(optional): indicates whether the gateway is a security gateway and requires security capability support. Security capability is not supported by default.
a
(optional): device function capability value. The data is 1 byte, equivalent to 8 bits, and each bit corresponds to a function. The MCU must use the corresponding function.
bit0
: When it indicates the security gateway function, determine whether the security alarm message is displayed. 0 means not supported, and 1 means supported.Note: For the newly connected gateway,
bit0
shall be set to 1 to reduce the MCU development workload. The corresponding command is0xC104
.
bit1
–bit7
: reserved data points. 0 shall be entered by default.The working mode of the module mainly includes how to indicate Wi-Fi working status and how to reset the Wi-Fi network. There are two cases.
The coordinated processing of the MCU and module
The self-processing mode of the module
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x02 |
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 |
For example, 0x55aa 00 02 0000 01
The MCU returns the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x02 |
Data length | 2 |
|
Data | 0/2 | The data length is 4, and the port range is 0–3, which represents A–D respectively. The pin range is 0–7.
|
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 02 0000 04
(coordinated processing of the MCU and the mode)0x55aa 00 02 0004 0103 0102 0C
(self-processing of the module, indicator 0x0103: PB_3, and reset button 0x0102: PB_2)Note: If the working mode of the module is set to module self-processing, the MCU does not need to implement this protocol.
Network status of device | Description | Status value |
---|---|---|
Status 1 | SmartConfig pairing status | 0x00 |
Status 2 | AP pairing status | 0x01 |
Status 3 | Wi-Fi has been configured, but not connected to the router | 0x02 |
Status 4 | Wi-Fi has been configured, and connected to the router | 0x03 |
Status 5 | Wi-Fi has been connected to the router and the cloud | 0x04 |
Status 6 | Wi-Fi device is in the low power consumption mode | 0x05 |
Status 7 | Both SmartConfig and AP pairing status are available | 0x06 |
The status of LED indicator in module self-processing mode.
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x03 |
Data length | 2 | 0x0001 |
Data | 1 | Indicate the Wi-Fi working status. 0x00: status 1 0x01: status 2 0x02: status 3 0x03: status 4 0x04: status 5 0x05: status 6 0x06: status 7 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
For example, 0x55aa 00 03 0001 00 03
The MCU returns the following command:
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 |
For example, 0x55aa 00 03 0000 02
Note: If the working mode of the module is set to module self-processing, the MCU does not need to implement this protocol.
Status transfer of resetting Wi-Fi is shown as follows:
Reset Wi-Fi in self-processing mode: Wi-Fi detects the low level of GPIO input pin for more than 5 seconds to trigger Wi-Fi reset.
The MCU sends the following command:
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 |
For example, 0x55aa 00 04 0000 03
The module returns the following command:
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 |
For example, 0x55aa 00 04 0000 03
Note: If the working mode of the module is set to module self-processing, the MCU does not need to implement this protocol.
You can implement this protocol selectively.
The MCU sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x05 |
Data length | 2 | 0x0001 |
Data | 1 | 0x00: enter SmartConfig pairing mode 0x01: enter AP pairing mode |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
For example, 0x55aa 00 05 0001 00 05
, enter SmartConfig pairing mode.
The module returns the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x05 |
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 |
For example, 0x55aa 00 05 0000 04
The app sends a network access command to the gateway, enabling the sub-device to access the network within a specified time.
The module sends the following command:
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 command:
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, disabling the access of sub-devices.
The module sends the following command:
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 command:
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 sends the network access request of the sub-device to Wi-Fi.
pk_type
is an optional field, and the default value is 1.
The channel must be configured when the sub-device needs an OTA function. The default value is 10. Go to Hardware Development > Add custom firmware > Upgrade Channel.
Note: Incorrect channel configuration might cause exceptional OTA function.
The MCU sends the following command:
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x08 |
Data length | 2 | 0x0001 |
Data | 1 | 0x00: Receive request 0x01: Reject request (To check whether the sub-device is actually successfully connected to the network, see Return the result of adding a device) |
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, disabling the access of sub-devices.
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x09 |
Data length | 2 | None |
Data | Depend on specific 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 command:
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 Wi-Fi module regularly queries the heartbeat of the sub-device. The query cycle is related to the number of sub-devices. The more the sub-devices are, the more frequently the heartbeat of the sub-devices are queried.
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x0A |
Data length | 2 | None |
Data | Depend on specific 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 command:
Note: An online device shall return its heartbeat. If it does not respond for two consecutive heartbeat cycles, it is considered offline.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x0A |
Data length | 2 | None |
Data | Depend on specific data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
Synchronize the sub-device status.
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x0B |
Data length | 2 | None |
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 |
For the command returned by the MCU, see the Report status section.
Send a control command.
raw
type, all other types belong to the obj
type data points.DP command or status data unit is shown as follows.
Data segment | Length (byte) | Description |
---|---|---|
dpid | 1 | DP number |
type | 1 | The specific data type of a data point in the Tuya IoT Platform:
|
len | 2 | The length corresponds to the byte number of the value (big-endian) |
value | 1/2/4/N | Expressed with hex, and adopt big-endian transmission when there are more than 1 byte |
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x0C |
Data length | 2 | None |
Data | Depend on specific 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 after receiving the command, or actively pushes the command after receiving the status change.
The MCU sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x0D |
Data length | 2 | None |
Data | Depend on specific data |
|
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 to local groups.
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x0E |
Data length | 2 | None |
Data | Depend on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x0E |
Data length | 2 | None |
Data | Depend on specific data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
Remove a sub-device from a local group.
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x0F |
Data length | 2 | None |
Data | Depend on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x0F |
Data length | 2 | None |
Data | Depend on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x10 |
Data length | 2 | 0x0000 |
Data | 0 | For 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 command:
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 command:
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 command:
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 |
Note:
- If the device is activated in mainland China, the local time is Beijing time (GMT+08:00).
- If the device is activated in other countries or regions, the local time is the time zone in which the device is.
Add multiple sub-devices of the same PID in batches. Maximum 32 sub-devices can be added in a single batch.
The MCU sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x12 |
Data length | 2 | None |
Data | Depend on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x12 |
Data length | 2 | None |
Data | 1 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
After the device is added, notify the MCU of the result.
The module sends the following command:
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 command:
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x14 |
Data length | 2 | None |
Data | Depend on specific 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 command:
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 |
Scan the specific SSID: tuya_mdev_test
, and return the scanning result and signal strength percentage.
The MCU sends the following command:
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 command:
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 get the Wi-Fi status with this command. For specific Wi-Fi status, see Report device network status. The gateway will not return the Wi-Fi status before the network initialization is completed.
The MCU sends the following command:
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x16 |
Data length | 2 | 0x0001 |
Data | 1 | Wi-Fi working status: 0x00: status 1 0x01: status 2 0x02: status 3 0x03: status 4 0x04: status 5 0x05: status 6 0x06: status 7 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
If a local (offline) command is sent to restore factory defaults, the cloud information and the local information will be out of sync. The command must be used when the device is online or before the device is activated for the first time.
The MCU sends the following command:
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 |
When receiving the command to remove a sub-device or restore the factory defaults, the gateway will report the status to the MCU.
The module sends the following command:
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 |
MCU sends a command to delete a sub-device.
The MCU sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x19 |
Data length | 2 | None |
Data | Depend on specific data | For 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 command:
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 command:
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 command:
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 |
Get the remaining memory of the Wi-Fi module.
The MCU sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x1B |
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x1B |
Data length | 2 | 0x0004 |
Data | 4 | The data length is 4 bytes in big endian mode. For example, 00 00 28 00 represents the remaining memory is 10,240 bytes. |
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 the list of all sub-devices under the gateway. If greater than 255 bytes, the list data will be sent in packets.
The MCU sends the following command:
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x1C |
Data length | 2 | None |
Data | Depend on specific data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
The IoT Platform provides visualized configuration options, allowing users to choose the upgrade method. The module only serves as a data transmission channel that supports MCU upgrades and does not perform any data analysis.
Note: After all the upgrade packets are sent, the Wi-Fi module sends the command 0x01 to query product information. The MCU shall reply with the software version number and the upgraded MCU software version number in the product information within one minute. The version number shall be consistent with that configured and upgraded on the Tuya IoT Platform.
MCU remote upgrade methods:
Auto upgrade (former silent upgrade): The app does not prompt the user to upgrade. The upgrade detection will be performed within one minute after the firmware is powered on. If a higher version upgrade packet is detected, it will be automatically downloaded and installed. Since the first power-on, upgrade detection will be performed every 24 hours.
MCU upgrade flowchart:
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x1D |
Data length | 2 | 0x0004 |
Data | 4 | Upgrade file size in the big-endian mode |
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x1D |
Data length | 2 | 0x0001 |
Data | 1 | Upgrade packet transmission size:
|
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x1E |
Data length | 2 | 0x0004+m in which m is the offset byte |
Data | offset_addr (4 bytes)+ pack (m bytes) | offset_addr : packet offset address pack : packet content |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
For example, the file to be upgraded has 530 bytes. Under this circumstance, the MCU can skip the response to the last data packet.
For the first packet data, packet offset is 0x00000000, and the data packet length is 256.
0x55aa 00 1e 0104 00000000 xx…xx XX
For the second packet data, packet offset is 0x00000100, and data packet length is 256.
0x55aa 00 1e 0104 00000100 xx…xx XX
For the second to last packet data, packet offset is 0x00000200, and data packet length is 18.
0x55aa 00 1e 0016 00000200 xx…xx XX
For the last packet data, packet offset is 0x00000212, and data packet length is 0.
0x55aa 00 1e 0004 00000212 XX
The MCU returns the following command:
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x1F |
Data length | 2 | None |
Data | Depend on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x1F |
Data length | 2 | 0x0001 |
Data | 1 | Packet size of the upgrade packet: 0x00: 256 bytes by default (compatible with old firmware) 0x01: 512 bytes 0x02: 1,024 bytes 0x03: 128 bytes |
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x20 |
Data length | 2 | None |
Data | Depend on specific data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
Example: sub_id
is 1234, the file size to be upgraded is 530 bytes. Under this circumstance, the MCU can skip the response to the last data packet.
For the first packet data, packet offset is 0x00000000, and the data packet length is 256.
0x55aa 00 20 0109 04 31 32 33 34 00000000 xx…xx XX
For the second packet data, packet offset is 0x00000100, and data packet length is 256.
0x55aa 00 20 0109 04 31 32 33 34 00000100 xx…xx XX
For the second to last packet data, packet offset is 0x00000200, and data packet length is 18.
0x55aa 00 20 001B 04 31 32 33 34 00000200 xx…xx XX
For the last packet data, packet offset is 0x00000212, and data packet length is 0.
0x55aa 00 20 0009 04 31 32 33 34 00000212 XX
The MCU returns the following command:
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x21 |
Data length | 2 | None |
Data | Depend on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x21 |
Data length | 2 | None |
Data | Depend on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x22 |
Data length | 2 | None |
Data | Depend on specific 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 command:
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x23 |
Data length | 2 | None |
Data | Depend on specific 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 command:
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 data packet is passed from the Wi-Fi module to the MCU module for broadcast.
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x24 |
Data length | 2 | None |
Data | Depend on specific data | Broadcast packet 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x24 |
Data length | 2 | 0x0002 |
Data | 2 | Return status: data[0]: 0x00: success 0x01: failure data[1]: 0: success fail: failure reason |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
Data packets are transparently transmitted to Wi-Fi by the app through the MCU.
The MCU sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x25 |
Data length | 2 | None |
Data | data | Encryption 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x25 |
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 |
Data packets are transparently transmitted to the app by the Wi-Fi through the MCU.
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x26 |
Data length | 2 | N |
Data | Depend on specific data | Encryption 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x26 |
Data length | 2 | 0x0000 |
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 MCU will actively push the connection status with the mobile phone to the Wi-Fi module.
The MCU sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x27 |
Data length | 2 | 0x0001 |
Data | 1 | Connection status: 0x00: disconnected 0x01: connection established |
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x28 |
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x28 |
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x29 |
Data length | 2 | N |
Data | Depend on specific 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 report.
The MCU sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2A |
Data length | 2 | N |
Data | Depend on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2A |
Data length | 2 | 0x0001 |
Data | 1 | 0x00: success 0x01: failure |
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 command:
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2B |
Data length | 2 | 0x0007 |
Data | Depend on specific 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 sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2C |
Data length | 2 | None |
Time | 7 |
|
Data | Depend on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2C |
Data length | 2 | 0x0001 |
Data | 1 | 0: success 1: failure |
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2D |
Data length | 2 | None |
Data | Depend on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2D |
Data length | 2 | 0x0007 |
Data | Depend on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2E |
Data length | 2 | N |
Data | Depends on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2E |
Data length | 2 | None |
Data | Depend on specific data | For 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2F |
Data length | 2 | N |
Data | Depend on specific 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 command:
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 module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x30 |
Data length | 2 | None |
Data | Depend on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x30 |
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 module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x31 |
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 returns the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x31 |
Data length | 2 | N |
Data | Depend on specific data |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
Example:
The module sends the following command:
55 AA 00 31 00 02 00 1E 50
The MCU returns the following command:
55 AA 00 31 00 75 00 00 00 94 FC 00 36 00 00 236f 236f 068e 0226 068e 0226 068e 0226 0226 0226 0226 0226 068e 0226 0226 0226 0226 0226 0226 0226 068e 0226 068e 0226 068e 0226 0226 0226 068e 0226 068e 0226 068e 0226 068e 0226 0226 0226 0226 0226 0226 0226 068e 0226 0226 0226 0226 0226 a9cf 236f 08ce 0226 82d5 82d5 85
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x32 |
Data length | 2 | 0 |
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x32 |
Data length | 2 | 0x0001 |
Data | MCU status of receiving control codes:
|
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
w.temp,w.pm25
and only w.temp
is returned, the return parameters are less than the request parameters. In this case, check whether the request parameter name is correct. For more information, see the detailed parameter description of weather service.w.condition
, see Weather UTF-8 code table.Example:
w.humidity: 69, w.temp: 32, w.pm25: 10, w.condition: cloudy (UTF-8 code E5A49A E4BA91)
55 AA 00 21 00 40 01 0A 77 2E 68 75 6D 69 64 69 74 79 00 04 00 00 00 45 06 77 2E 74 65 6D 70 00 04 00 00 00 20 06 77 2E 70 6D 32 35 00 04 00 00 00 10 0B 77 2E 63 6F 6E 64 69 74 69 6F 6E 01 06 E5 A4 9A E4 BA 91 1E
Input parameter: {"codes":"w.temp","w.humidity", "w.sunRise", "w.sunSet", "t.local","w.date.3"}
Return: {"codes": "w.temp.0":13,"w.humidity.0":100, "w.sunRise.0":2019-12-28 06:54,""w.sunSet.0":2019-12-28 17:05,"w.temp.1":13,"w.humidity.1":100, "w.sunRise.1":2019-12-28 06:54,""w.sunSet.1":2019-12-28 17:05,"w.temp.2":13,"w.humidity.2":100,"w.sunRise.2":2019-12-28 06:54,""w.sunSet.2":2019-12-28 17:05,}
Enable to get the weather data. The update cycle is set by the MCU. The minimum update interval is 10 minutes, while the recommended standard update interval is 60 minutes. Considering the real-time nature of weather data, the maximum interval is 240 minutes.
The MCU sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x33 |
Data length | 2 | (1+1+(L+K)+(L+K)…) |
Data | Depend on specific data |
|
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 2C 00 00 06 77 2E 74 65 6D 70 0A 77 2E 68 75 6D 69 64 69 74 79 0A 77 2E 70 72 65 73 73 75 72 65 06 77 2E 70 6D 32 35 05 77 2E 73 6F 32 B0
The module returns the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x33 |
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 |
After the weather data function is enabled, the module regularly sends the weather data. After the function is enabled, the data sending will be triggered immediately, and the data will be sent subsequently at the set time interval.
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x33 |
Data length | 2 | (1+(LKTLV)+(LKTLV)+…) |
Data | Depend on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x33 |
Data length | 2 | 0x0001 |
Data | 1 | Sub-command: 0x01 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
0x3301
.The MCU sends the following command:
Field | Length | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x33 |
Data length | 2 | (1+1+(L+K)+(L+K)…) |
Data | Depend on specific data |
|
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 2B 02 06 77 2E 74 65 6D 70 0A 77 2E 68 75 6D 69 64 69 74 79 0A 77 2E 70 72 65 73 73 75 72 65 06 77 2E 70 6D 32 35 05 77 2E 73 6F 32 B1
The module returns the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x33 |
Data length | 2 | 0x0002 |
Data | 1 | Sub-command: 0x02 |
1 | Result: 0x00: success 0x01: failure |
|
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 command:
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 |
For example, 55 AA 00 33 00 01 03 36
The module returns the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x33 |
Data length | 2 | 1+2+1+7 |
Data | 11 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
For scenarios that do not require heartbeat query, you can use this command to pause the heartbeat query.
The MCU sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x33 |
Data length | 2 | 0x0002 |
Data | 1 | Sub-command: 0x04 |
1 | Heartbeat query status 0x01: recover heartbeat query 0x00: Disable heartbeat query |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
For example, 55 AA 00 33 00 02 04 00 38
The module returns the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x33 |
Data length | 2 | 1 |
Data | 1 | Sub-command: 0x04 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
This protocol contains security-related function commands, which only describes their content. For the detailed integration process, download the Connection Process of Security Gateway on the IoT Platform.
Set the current arming and disarming mode.
The MCU sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC0 |
Data length | 2 | 1+N |
Data | Depend on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC0 |
Data length | 2 | 2 |
Data | 1 | Sub-command: 0x00 |
1 | Result: 00: success Others: failure |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
Get the current security information.
The MCU sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC0 |
Data length | 2 | 1 |
Data | 1 | Sub-command: 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC0 |
Data length | 2 | 1+N |
Data | 1 | Sub-command: 0x01 |
Depend on specific data |
|
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
After the security information is set through the app, the module synchronizes the status to the MCU through this command.
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC0 |
Data length | 2 | 1+N |
Data | 1 | Sub-command: 0x02 |
Depend on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC0 |
Data length | 2 | 1 |
Data | 1 | Sub-command: 0x02 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
The security event module synchronizes the status to the MCU through this command.
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC0 |
Data length | 2 | 1+N |
Data | Sub-command | 0x03 |
Depend on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC0 |
Data length | 2 | 1 |
Data | Sub-command | 0x03 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
In case of status change through the security standard DP32, the MCU shall synchronize the status to the module.
The MCU sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 2 |
Data | Sub-command | 0x00 |
Alarm status | 0: normal. Non-0: alarming |
|
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 2 |
Data | Sub-command | 0x00 |
Action result | 0: success Others: failure |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
When the alarm is canceled through the app, the module synchronizes the status with this command to the MCU, and the MCU reports false
through the security standard DP 2.
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 2 |
Data | 1 | Sub-command: 0x01 |
1 | 0: cancel the alarm | |
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 1 |
Data | 1 | Sub-command: 0x01 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
When the environmental device DP or non-environmental device DP triggers a device alarm, the module uses this command to synchronize the alarm information to the MCU, and the MCU reports it through the security standard DP 26.
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 1+N |
Data | Sub-command | 0x02 |
Depend on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 1 |
Data | 1 | Sub-command: 0x02 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
When the device is in the alarm delay status, the alarm delay status will be synchronized to the MCU through this command.
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 2 |
Data | 1 | Sub-command: 0x03 |
1 | Alarm delay status 0: alarm delay is not created 1: alarm delay is in progress 2: alarm delay is over |
|
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 1 |
Data | 1 | Sub-command: 0x03 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
This command is to synchronize the new device alarm information. It is enabled with the bit 0 of the A
field in the 01 command. After enabled, the security 0xc101
and 0xc102
commands do not need to be processed.
GP
field.Currently, fields for multi-zone gateway function are reserved. The field could not be returned.
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 1+N |
Data | 1 | Sub-command: 0x04 |
Depend on specific 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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 1 |
Data | Sub-command | 0x04 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
This command is to synchronize the new device alarm information. It is enabled with the bit 0 of the A
field in the 01 command.
The module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 2 |
Data | 1 | Sub-command: 0x05 |
Data | 0: cancel the alarm 1: alarm in progress |
|
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 command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xC1 |
Data length | 2 | 1 |
Data | 1 | Sub-command: 0x05 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder |
Text | Hexadecimal | Text | Hexadecimal |
---|---|---|---|
Sunny | E699B4 | Heavy rain | E5A4A7 E99BA8 |
Thunderstorm | E99BB7 E69AB4 | Sandstorm | E6B299 E5B098 E69AB4 |
Light snow | E5B08F E99BAA | Snow | E99BAA |
Freezing fog | E586BB E99BBE | Rainstorm | E69AB4 E99BA8 |
Isolated showers | E5B180 E983A8 E998B5 E99BA8 | Dust | E6B5AE E5B098 |
Thunder and lightning | E99BB7 E794B5 | Light showers | E5B08F E998B5 E99BA8 |
Rain | E99BA8 | Sleet | E99BA8 E5A4B9 E99BAA |
Dust devil | E5B098 E58DB7 E9A38E | Ice pellet | E586B0 E7B292 |
Strong sandstorm | E5BCBA E6B299 E5B098 E69AB4 | Sand blowing | E689AC E6B299 |
Light to moderate rain | E5B08F E588B0 E4B8AD E99BA8 | Mostly clear | E5A4A7 E983A8 E699B4 E69C97 |
Fog | E99BBE | Showers | E998B5 E99BA8 |
Heavy showers | E5BCBA E998B5 E99BA8 | Heavy snow | E5A4A7 E99BAA |
Extraordinary rainstorm | E789B9 E5A4A7 E69AB4 E99BA8 | Blizzard | E69AB4 E99BAA |
Hail | E586B0 E99BB9 | Light to moderate snow | E5B08F E588B0 E4B8AD E99BAA |
Partly cloudy | E5B091 E4BA91 | Light snow shower | E5B08F E998B5 E99BAA |
Moderate snow | E4B8AD E99BAA | Overcast | E998B4 |
Needle ice | E586B0 E99288 | Downpour | E5A4A7 E69AB4 E99BA8 |
Thundershower and hail | E99BB7 E998B5 E99BA8 E4BCB4 E69C89 E586B0 E99BB9 | Freezing rain | E586BB E99BA8 |
Snow showers | E998B5 E99BAA | Light rain | E5B08F E99BA8 |
Haze | E99CBE | Moderate rain | E4B8AD E99BA8 |
Cloudy | E5A49A E4BA91 | Thundershower | E99BB7 E998B5 E99BA8 |
Moderate to heavy rain | E4B8AD E588B0 E5A4A7 E99BA8 | Heavy to rainstorm | E5A4A7 E588B0 E69AB4 E99BA8 |
Weather data parameter | Description | Mainland China | Outside mainland China | Forecast | Hexadecimal value |
---|---|---|---|---|---|
w.temp | Atmospheric temperature | Yes | Yes | 7-day forecast in mainland China | 77 2e 74 65 6d 70 |
w.thigh | The highest temperature | No | Yes | 7-day forecast | 77 2e 74 68 69 67 68 |
w.tlow | The lowest temperature | No | Yes | 7-day forecast | 77 2e 74 6c 6f 77 |
w.humidity | Air humidity | Yes | Yes | 7-day forecast | 77 2e 68 75 6d 69 64 69 74 79 |
w.condition | Weather conditions, such as sunny day, rain, and snow | Yes | Yes | 7-day forecast | 77 2e 63 6f 6e 64 69 74 69 6f 6e |
w.conditionNum | Weather conditions, indicated by digital codes | Yes | Yes | 7-day forecast | 77 2e 63 6f 6e 64 69 74 69 6f 6e 4e 75 6d |
w.pressure | Atmospheric pressure | No | Yes | 7-day forecast | 77 2e 70 72 65 73 73 75 72 65 |
w.realFeel | Apparent temperature | No | Yes | 7-day forecast | 77 2e 72 65 61 6c 46 65 65 6c |
w.uvi | Ultraviolet index | No | Yes | 7-day forecast | 77 2e 75 76 69 |
w.sunRise | Sunrise | Yes | Yes | 7-day forecast | 77 2e 73 75 6e 52 69 73 65 |
w.sunSet | Sunset | Yes | Yes | 7-day forecast | 77 2e 73 75 6e 53 65 74 |
t.unix | Greenwich Mean Time (GMT), used with sunrise and sunset time | 74 2e 75 6e 69 78 | |||
t.local | Local time, used with sunrise and sunset time | 74 2e 6c 6f 63 61 6c | |||
w.windSpeed | Wind speed | Yes | Yes | 7-day forecast | 77 2e 77 69 6e 64 53 70 65 65 64 |
w.windDir | Wind direction | Yes | No | 7-day forecast | 77 2e 77 69 6e 64 44 69 72 2e 6e |
w.windLevel | Wind scale | Yes | No | 7-day forecast | 77 2e 77 69 6e 64 4c 65 76 65 6c |
w.aqi | Air quality index | Yes | No | Only data of the day | 77 2e 61 71 69 |
w.tips | Notify live weather and professional live conditions with one sentence. | Yes | No | Only data of the day | 77 2e 74 69 70 73 |
w.rank | Detailed AQI status and national ranking | Yes | No | Only data of the day | 77 2e 72 61 6e 6b |
w.pm10 | PM10 (inhalable particulate matter) | Yes | No | Only data of the day | 77 2e 70 6d 31 30 |
w.pm25 | PM2.5 (fine particulate matter) | Yes | No | Only data of the day | 77 2e 70 6d 32 35 |
w.o3 | Ozone concentration | Yes | No | Only data of the day | 77 2e 6f 33 |
w.no2 | Nitrogen dioxide concentration | Yes | No | Only data of the day | 77 2e 6e 6f 32 |
w.co | Carbon monoxide concentration | Yes | No | Only data of the day | 77 2e 63 6f |
w.so2 | Sulfur dioxide concentration | Yes | No | Only data of the day | 77 2e 73 6f 32 |
w.date.n (n means the number of days to be forecasted, 1 ≤ n ≤ 7) | The number of days to forecast | Yes | Yes | 77 2e 64 61 74 65 2e 6e |
Version | Date | Description |
---|---|---|
1.1.9 | September 25, 2020 |
|
1.1.8 | July 9, 2020 |
|
1.1.7 | April 23, 2020 |
|
1.1.6 | April 9, 2020 |
|
1.1.5 | February 20, 2020 |
|
1.1.4 | September 12, 2019 |
|
1.1.3 | September 2, 2019 |
|
1.1.2 | July 13, 2019 |
|
1.1.1 | May 29, 2019 |
|
1.1.0 | May 20, 2019 |
|
1.0.9 | April 13, 2019 |
|
1.0.8 | March 19, 2019 |
|
1.0.7 | January 18, 2019 |
|
1.0.6 | January 11, 2019 |
|
1.0.5 | November 7, 2018 |
|
1.0.4 | November 7, 2018 |
|
1.0.3 | October 30, 2018 |
|
1.0.2 | October 27, 2018 |
|
1.0.1 | October 25, 2018 |
|
1.0.0 | October 18, 2018 |
|
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback