Last Updated on : 2024-06-21 03:24:41download
This topic describes the offline voice I2C protocol of the Zigbee module. It is suitable for developers who use Tuya offline voice modules for MCU development.
Communication rate: 100 Kbit/s
Bus address: 0x64
Communication data line: SCL, SDA
Data interrupt pin: INT_PIN
(Pin is pulled up, when the voice module needs to actively send data to the IoT module, a low level of 100 ms is generated to inform the IoT module that there is data to send)
Data transfer volume: a single piece of data cannot exceed 256 bytes.
The Zigbee module acts as the primary, and the voice module acts as the secondary. The primary actively queries the status of the secondary, and the secondary responds to the primary with the latest status information after receiving the command.
Field | Length (byte) | Description |
---|---|---|
Header | 2 | It is fixed as 0x55aa. |
Version | 1 | It is used for update and extension. |
Command | 1 | Frame type. |
Data length | 2 | Big-endian. |
Data | N | - |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
The IoT module actively sends a command, and the voice module responds immediately after receiving the command (within 50 ms).
If the voice module wants to actively report messages to the IoT module, the following steps are required.
The voice module needs to pull the INT pin low for 100 ms to generate a 100 ms low-level pulse.
After the IoT module receives the interrupt signal, it uses the 0x88
command to query the status change of the voice module.
The voice module responds with information about the status change.
The IoT module replies to the voice module that it has received a state change message.
The table below lists commands for I2C communication.
Command | Feature | Description |
---|---|---|
0x00 | Heartbeat detection | The IoT module sends a heartbeat to the offline voice module every 5s. |
0x03 | Zigbee network status of IoT module | The IoT module sends the Zigbee network status to the voice module. |
0x05 | Reset Zigbee and switch network pairing mode | You can specify which pairing mode the IoT module enters when resetting. |
0x06 | DP status reporting | The offline voice module reports the DP control to the IoT module. After the IoT module receives the data, the command is forwarded to the MCU to control the DP execution. |
0x07 | DP status issuing | The IoT module synchronizes the DP information to the voice module. |
0x2B | Offline voice module queries network status | The offline voice module actively queries the network status of the IoT module. |
0x65 | Voice settings | Set offline voice module parameters. |
0x66 | Speech recognition text reporting | The voice module provides speech recognition text in Unicode format to the IoT module. |
0x67 | Issuing text verification results | The IoT module informs the voice module of the result of the voice and text verified by the platform in Unicode format. |
0x68 | Voice reporting | Voice module parameters are actively reported. |
0x88
query command to query the voice status after detecting the low level. The voice module will upload the changed information to the Zigbee module according to the status type.For example, Zigbee module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x88 |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, 0x55aa 00 88 0000 ff
The voice module will decide what data to send based on whether there is a current status change. For example, if there is a user’s voice request to reset the network, the voice module will send the 0x05
command. If the volume is modified, then the 0x09
command will be sent. If the current status of voice module has not changed, then send the 0x00
heartbeat command as the heartbeat to the Zigbee module as a reply.
After power-on, the IoT module sends heartbeats every 5 seconds. If the voice module does not respond within the 90-second timeout period, the module considers a communication exception occurred and will restart the software.
The voice module returns the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x00 |
Data length | 2 | 0x0001 |
Data | 1 | 0x00: the return value of the first heartbeat after the voice module reboots. It is only sent once, used for the module to determine whether the MCU reboots during the working process. 0x01: this value is returned except for the first return value of 0 after the voice module reboots. |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, the voice module returns 0x55aa 03 00 0001 00 03
after a restart.
Returns 0x55aa 03 00 0001 01 04
except for the first response after a restart. Reply the voice module that a heartbeat command is received.
For example, Zigbee module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x00 |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, 0x55aa 00 00 0000 03
With this frame, the MCU can select the required configuration mode after the Zigbee is reset.
The voice module returns the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x05 |
Data length | 2 | 0x0001 |
Data | 1 | 0x00: reset 0x01: network pairing |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, 0x55aa 03 05 0001 01 09
. The voice module makes Zigbee enter the network pairing mode.
Reply the voice module that a command of resetting Zigbee-selecting configuration mode is received.
For example, Zigbee module sends 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 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, 0x55aa 00 05 0000 03
Data point command and status data unit is shown as follows:
Data segment | Length (byte) | Description | |
---|---|---|---|
dpid | 1 | Data point serial number. | |
type | 1 | The specific data type of a data point on the Developer Platform, which is marked with the following “Value”. | |
Type | Value | Length (byte) | Description |
raw | 0x00 | N | Corresponding to raw data point (module pass-through). |
bool | 0x01 | 1 | Value range: 0x00/0x01. |
Value | 0x02 | 4 | Corresponding to the integer type, which is expressed in big-endian. |
string | 0x03 | N | Correspond to specific strings. |
enum | 0x04 | 1 | Enumeration data, ranging from 0 to 255. |
bitmap | 0x05 | 1/2/4 | Represented by big-endian when there is more than one byte. |
len | 2 | The length corresponds to the number of bytes of value. | - |
Value | 1/2/4/N | Expressed in the hexadecimal format. Use a big-endian representation when there is more than one byte. | - |
The voice module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x06 |
Data length | 2 | It depends on the type and number of the status data unit. |
Data | N | See the DP status data unit section. |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, the humidity corresponds to DP 5, valve variable is used, and the humidity is 30%.
0x55aa 03 06 0008 05 02 0004 0000001e 3a
Reply the voice module that a DP control reporting command is received.
For example, Zigbee 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 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, 0x55aa 00 06 0000 03
The voice module actively queries the network status of the Zigbee module through the command (0x2B
), and the Zigbee module informs the voice module of the network status through the 0x2B
command.
The MCU sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x2B |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, 0x55aa 03 2B 0000 05
The Zigbee module returns the device network status as follows.
Device network status | Description | Status value |
---|---|---|
Status 1 | Network not paired | 0x00 |
Status 2 | Pairing | 0x03 |
Status 3 | Paired (after the network pairing is successful, it has been in the paired status) | 0x01 |
For example, Zigbee module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x2B |
Data length | 2 | 0x0001 |
Data | 1 | The Zigbee module returns the device network status as follows. |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, 0x55aa 00 2B 0001 02 01
. The IoT module is connected to the cloud.
Device network status | Description | Status value |
---|---|---|
Status 1 | Network not paired | 0x00 |
Status 2 | Pairing | 0x03 |
Status 3 | Paired (after the network pairing is successful, it has been in the paired status) | 0x01 |
Note: The initial status of the Zigbee module is not paired. When the voice module sends a pairing command to the Zigbee module, it will send out a status notification of pairing, and then the Zigbee module will start the pairing. The timeout period is 3 minutes. If the network is successfully paired within 3 minutes, the network status will be reported. Otherwise, a failure will be reported when it expires.
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 | See above table. |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, 0x55aa 00 03 0001 00 03
The voice module returns the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x03 |
Data length | 2 | 0x0000 |
Data | 0 | None |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, 0x55aa 03 03 0000 09
. Reply to the pairing status command.
0x66
command, and the Zigbee module directly responds to the 0x66
command after receiving it to inform the voice module that the command has been received. After that, the text information is uploaded to the platform through the 501 protocol to verify the text. After receiving the reply from the platform, the Zigbee module informs the voice module of the result of the text verification through the 0x67
command.The voice module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x66 |
Data length | 2 | 0x0012 |
Data | 2 | Voice text ID. The voice module can correspond to unique scene commands through ID. For example, the ID corresponding to “home mode” is 00 01 . |
2 | Country code, used to identify the language of which country the following characters are, such as China “CN”, United States “US”. | - |
N | The total data length does not exceed 256 bytes. For example, Chinese: “回家场景”, English: “good night mode”. | - |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
Country code standards. See Mappings Between OEM App Accounts and Data Centers.
For example, home scene, ID is 00 01.
55 aa 03 66 00 10 00 01 43 4e e5 9b 9e e5 ae b6 e5 9c ba e6 99 af 44
After the Zigbee module receives the text information of the voice module, it will be sent to the platform to verify whether the scene is valid.
For example, Zigbee module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x66 |
Data length | 2 | 0x0000 |
Data | N | None |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, 55 aa 00 66 00 00 65
For example, Zigbee module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x67 |
Data length | 2 | 0x0013 |
1 | The result of the scene platform verification. 01: Verification succeeded. 00: Verification failed. 02: Network abnormality. |
|
2 | The unique voice scene ID. For example, the ID corresponding to “home mode” is 00 01 . |
|
Data | N | The total data length does not exceed 256 bytes. For example, Chinese: “回家场景”, English: “good night mode”. |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, return the verification result of the following “home scene”, which means that the platform verification of “home scene” is successful.
55 aa 00 67 00 0F 01 00 01 e5 9b 9e e5 ae b6 e5 9c ba e6 99 af 2f
The voice module returns the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x67 |
Data length | 2 | 0x0000 |
Data | N | None |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, 55 aa 03 67 00 00 69
For example, Zigbee sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x65 |
Data length | 2 | xx |
Data | N | It depends on the type and number of the status data unit. |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
The voice module returns the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x65 |
Data length | 2 | xx |
Data | N | It depends on the type and number of the status data unit. |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
Status notification: The offline voice module actively reports the status
The voice module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x68 |
Data length | 2 | N |
Data | 1 | It depends on the type and number of the status data unit. |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, Zigbee module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x68 |
Data length | 2 | 2 |
Data | 1 | Result: 0x00: indicates success. 0x01: indicates failure. |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, Zigbee module sends the following command:
Field | Length (byte) | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x07 |
Data length | 2 | It depends on the type and number of the status data unit. |
Data | N | See the DP status data unit section. |
Checksum | 1 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, the humidity corresponds to DP 5, valve variable is used, and the humidity is 30%.
0x55aa 03 07 0008 05 02 0004 0000001e 3a
The voice module 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 | Add up all bytes starting from the header and divide the sum by 256 to get the remainder. |
For example, return the mute status value:
55 aa 00 07 00 00 61
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback