Last Updated on : 2024-06-21 03:23:35download
The Wi-Fi serial port protocol for offline voice modules is based on Tuya Standard MCU Wi-Fi Serial Communication Protocol, and some commands dedicated to offline voice are added. Its architecture frame is shown in the figure below.
The MCU sends the following command:
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x36 |
Data length | 2 | 0x0002 |
Data | 1 | Sub-command: 0x00 |
1 | 0x00: disable the extended DP service. 0x01: enable the extended DP service. |
- |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, 0x55aa 03 36 0002 00 01 3c
The module returns the following command:
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x36 |
Data length | 2 | 0x0002 |
Data | 1 | Sub-command: 0x00 |
1 | 0x00: The service is enabled or disabled. 0x01: Failed to enable or disable the service. |
- |
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 36 0002 00 00 38
The module sends the following command:
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x36 |
Data length | 2 | It depends on the type and number (N+2) of the command data units. |
Data | 1 | Sub-command: 0x01 |
1 | The source of data sending: 0x00: unknown sources. 0x01: LAN. 0x02: WAN 0x03: scheduled tasks in LAN. 0x04: local scene linkage. 0x05: scene linkage in LAN. 0x06: Bluetooth. 0x07: offline voice modules. |
- |
N | Command data units | - |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, in LAN, if DP 3 of a boolean type is used for on/off control, and 1
means to turn on the device, the module will send the following command.
0x55aa 00 36 0007 01 01 03 01 0001 01 44
The MCU sends the following command:
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x36 |
Data length | 2 | It depends on types and the number (N+3) of status data units. |
Data | 1 | Sub-command: 0x02 |
1 | 0x00: The MCU proactively reports status. 0x01: The MCU responds to status queries. 0x02: The MCU responds to commands of extended DPs. |
- |
1 | When the MCU proactively reports DP status or responds to status queries, it responds to the data source requested by Send commands of extended DPs with 0x00 . 0x00: unknown sources. 0x01: LAN. 0x02: WAN 0x03: scheduled tasks in LAN. 0x04: local scene linkage. 0x05: scene linkage in LAN. 0x06: Bluetooth. 0x07: offline voice modules. |
- |
N | Status data units | - |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, in WAN, if the DP 5 of value type indicates the current humidity of 30%, the MCU sends the following command to the module.
0x55aa 03 36 000b 02 02 02 05 02 0004 0000001e 6f
Name | Description | Options | Get | Setting |
---|---|---|---|---|
cc | Country code | 0 : applies to China, Korea, Singapore, Australia, Japan (1-13), and others 1 : applies to the United States, Taiwan (China), and Canada 2 : applies to Japan (1-14) 3 : applies to Europe |
Supported | Not supported |
ap | Access point (AP) | - | Supported | Not supported |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback