Voice Service

Last Updated on : 2024-05-11 04:29:48download

This topic describes the voice service that applies to the VWXR2 voice module only.

Basic commands

Get voice status (0x60)

The MCU requests the voice status from the module.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x60
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: 55 aa 03 60 00 00 62

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x60
Data length 2 0x0001
Data 1 Voice status:
  • 0: Idle.
  • 1: Mic muted.
  • 2: Woken up.
  • 3: Recording.
  • 4: Recognizing.
  • 5: Successful recognition.
  • 6: Failed recognition.
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 60 00 01 00 60

Mute the mic (0x61)

The MCU can use this command to mute the mic or query the mic status.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x61
Data length 2 0x0001
Data 1 Mute settings:
  • 0: Turn on the mic.
  • 1: Mute the mic.
  • 0xA0: Query the mute status.
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 03 61 00 01 00 64

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x61
Data length 2 0x0001
Data 1 Mute status:
  • 0: Mic is on.
  • 1: Mic is muted.
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 61 00 01 00 61

Adjust speaker volume (0x62)

The MCU can use this command to adjust the speaker volume or query the current volume.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x62
Data length 2 0x0001
Data 1
  • Volume: 0 to 10.
  • Query volume: 0xA0
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 03 62 00 01 03 68

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x62
Data length 2 0x0001
Data 1 Volume: 0 to 10.
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 62 00 01 03 65

Test audio functionality (0x63)

Record voices while playing back the recording. Use acoustic equipment to compare the input and output audio signals.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x63
Data length 2 0x0001
Data 1 Valid values for audio testing:
  • 0: Disable audio testing.
  • 1: Perform audio loop test on mic1.
  • 2: Perform audio loop test on mic2.
  • 0xA0: Query the testing status.
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 03 63 00 01 02 68

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x63
Data length 2 0x0001
Data 1 Audio testing status:
  • 0: Disable audio testing.
  • 1: Perform audio loop test on mic1.
  • 2: Perform audio loop test on mic2.
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 63 00 01 02 65

Test waking up (0x64)

After the voice module enters test mode, the wake word must be delivered within 10 seconds. If the module is not woken up within 10 seconds, it returns a failure result.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x64
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: 55 aa 03 64 00 00 66

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x64
Data length 2 0x0001
Data 0 The result of waking up.
  • 0: Failure.
  • 1: Success.
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 64 00 01 01 65

Extended features (0x65)

You can implement the extended features for your voice modules, including notifications, play/pause, Bluetooth on/off, local alarm clocks, and grouped voice controls.

  • Play/pause: applies to songs, jokes, and more.
  • Bluetooth on/off: turns on or off Bluetooth of a Bluetooth speaker.
  • Local alarm: sync alarms set by the voice control to the mobile app.
  • Grouped voice controls: notifications of voice control commands. For example, play next or previous media.

MCU sets features (subcommand 0x00)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x65
Data length 2 N
Data 1 Subcommand: 0x00
Data:
{
“play”:true,
“bt_play”:true
,“ctrl_group”:“xxxx”}
  • play: Play/pause. true: Play. false: Pause.
  • bt_play: Turn on or off Bluetooth. true: On. false: Off.
  • ctrl_group: Playback control. next: Play the next track. pre: Play the previous track.
You can only implement the play/pause and Bluetooth on/off features on the MCU.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example: {"play":true,"bt_play":true,"ctrl_group":"next"}

55 aa 03 65 00 31 00 7b 22 70 6c 61 79 22 3a 74 72 75 65 2c 22 62 74 5f 70 6c 61 79 22 3a 74 72 75 65 2c 22 63 74 72 6c 5f 67 72 6f 75 70 22 3a 22 6e 65 78 74 22 7d c7

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x65
Data length 2 0x0002
Data 1 Subcommand: 0x00
1 Operation 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.

Example: 55 aa 00 65 00 02 00 00 66

Sync status (subcommand 0x01)

The module sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x65
Data length 2 1 + N
Data 1 Subcommand: 0x01
Data: {
“play”:true,
“bt_play”:true,“
alarm”:“xxxx”, “
ctrl_group”:“xxxx”
}
  • play: Play/pause. true: Play. false: Pause.
  • bt_play: Turn on or off Bluetooth. true: On. false: Off.
  • alarm: Local alarms. "xxx" is a string.
  • ctrl_group: Grouped voice controls. "xxx" is a string.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example: {"play":true,"bt_play":true,"ctrl_group":"next", "alarm":"xxx"}

55 aa 00 65 00 3f 01 7b 22 70 6c 61 79 22 3a 74 72 75 65 2c 22 62 74 5f 70 6c 61 79 22 3a 74 72 75 65 2c 22 63 74 72 6c 5f 67 72 6f 75 70 22 3a 22 6e 65 78 74 22 2c 22 61 6c 61 72 6d 22 3a 22 78 78 78 22 7d 36

The MCU returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x65
Data length 2 2
Data 1 Subcommand: 0x01
1 Operation 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.

Example: 55 aa 03 65 00 02 01 00 6a

Wake up module (subcommand 0x02)

  • The MCU can send this command to wake up the module.

  • This command only applies to Linux-based modules.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x65
Data length 2 0x01
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.

Example: 55 aa 03 65 00 01 02 6a

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x65
Data length 2 0x02
Data 1 Subcommand: 0x02
1 Operation 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.

Example: 55 aa 00 65 00 02 02 00 68

Turn on ASR notifications (subcommand 0x03)

With this feature enabled, automatic speech recognition (ASR) processed texts will be transmitted through the command 0x6504.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x65
Data length 2 0x02
Data 1 Subcommand: 0x03
1
  • 0x00: Disable
  • 0x01: Enable
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 03 65 00 02 03 00 6c

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x65
Data length 2 0x02
Data 1 Subcommand: 0x03
1 Operation 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.

Example: 55 aa 00 65 00 02 03 00 69

Sync ASR result (subcommand 0x04)

The module sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x65
Data length 2 0xXX
Data 1 Subcommand: 0x04
1 {
“text”:“content in UTF-8”,
“speaker”:“human”,//robot
“id”:1171
}
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example: {"text":"xx", "speaker":"human", "id":1171}

55 aa 03 65 00 2b 04 7b 22 74 65 78 74 22 3a 22 78 78 22 2c 22 73 70 65 61 6b 65 72 22 3a 22 68 75 6d 61 6e 22 2c 20 22 69 64 22 3a 31 31 37 31 7d 69

The MCU returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x65
Data length 2 0x01
Data 1 Subcommand: 0x04
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 65 00 01 04 69

Query the current track (subcommand 0x05)

  • The MCU can use this command to query the track that is being played.
  • The returned content is represented in UTF-8 format and transmitted in hex.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x65
Data length 2 0x01
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.

Example: 55 aa 03 65 00 01 05 6d

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x65
Data length 2 0x0002 + N
Data 1 Subcommand: 0x05
1 Operation result:
Data[0]:
  • 0x00: Success.
  • 0x01: Failure.
N When the operation result is 0x01, this field will be empty.
{
“artist”:“Beethoven”,
“trackTitle”:“Serenade in D major, Op.8”
}// Chinese characters are encoded in UTF-8.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example: {"artist":"Beethoven", "trackTitle":"Serenade in D major, Op.8"}

55 aa 00 65 00 34 05 00 7b 22 61 72 74 69 73 74 22 3a 22 e8 96 9b e4 b9 8b e8 b0 a6 22 2c 22 74 72 61 63 6b 54 69 74 6c 65 22 3a 22 e5 8a a8 e7 89 a9 e4 b8 96 e7 95 8c 22 7d dc

Report module status (subcommand 0x06)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x65
Data length 2 0x02
Data 1 Subcommand: 0x06
Status
  • 0x00: Online
  • 0x01: Bluetooth
  • 0x02: On a call
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 03 65 00 02 06 00 6f

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x65
Data length 2 0x02
Data 1 Subcommand: 0x06
1 Operation 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.

Example: 55 aa 00 65 00 02 06 00 6c

Report recording (auto) (subcommand 0x07)

The MCU can send this command to trigger voice recording. The module will pick up voices and automatically end the recording. The recording can be up to 10 seconds long in one go.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x65
Data length 2 0x02
Data 1 Subcommand: 0x07
0x01: Recording is started.
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 03 65 00 02 07 01 71

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x65
Data length 2 0x02
Data 1 Subcommand: 0x07
1 Operation 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.

Example: 55 aa 00 65 00 02 07 00 6d

Report recording (manual) (subcommand 0x08)

The MCU can send this command to trigger voice recording but the recording must be ended manually. The recording can be up to 10 seconds long in one go.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x65
Data length 2 0x02
Data 1 Subcommand: 0x08
1 Status
  • 0x00: Recording is ended.
  • 0x01: Recording is started.
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 03 65 00 02 08 00 71

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x65
Data length 2 0x02
Data 1 Subcommand: 0x08
1 Operation 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.

Example: 55 aa 00 65 00 02 08 00 6e

Turn on alarm notifications (subcommand 0x09)

With this feature enabled, alarm data will be transmitted through the command 0x650A.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x65
Data length 2 0x02
Data 1 Subcommand: 0x09
1
  • 0x00: Disable
  • 0x01: Enable
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 03 65 00 02 09 01 73

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x65
Data length 2 0x02
Data 1 Subcommand: 0x09
1 Operation 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.

Example: 55 aa 00 65 00 02 09 00 6f

Send alarms (subcommand 0x0A)

The module sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x65
Data length 2 0xXX
Data 1 Subcommand: 0x0A
  • Data[0]: The number of alarms.
  • Data[1]: The operation type. 0: Poll. 1: Add. 2: Delete. 3: Update. The following is the data format for the alarm.
  • Data[2 to 7]: The alarm ID.
  • Data[8]: Year
  • Data[9]: Month
  • Data[10]: Day
  • Data[11]: Hour
  • Data[12]: Minute
  • Data[13]: Bit 7 to bit 1 represent the repetition rule for Sunday through Saturday, where 1 indicates on and 0 indicates off. For example, 0111000 indicates the alarm repeats every Monday, Tuesday, and Wednesday. 0000000indicates the alarm rings once. Bit 0 indicates the alarm on/off status, 0 for on and 1 for off.
  • Data[14]: The alarm ringtone. 0: Online ringtone. Other values: Local ringtone.
  • Data[15 to 35]: The ringtone description. For online ringtones, the description is used to match a song.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example: A one-time alarm with ID 1 is scheduled to go off at 17:32 on August 23, 2021.

55 aa 00 65 00 24 0a 01 01 00 00 00 00 00 01 15 08 17 11 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa

The MCU returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x65
Data length 2 0x01
Data 1 Subcommand: 0x0A
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 03 65 00 01 0a 72

Get alarm list (subcommand 0x0B)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x65
Data length 2 0x01
Data 1 Subcommand: 0x0B
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 03 65 00 01 0b 73

The module returns the list of alarms through the command 0x650A.

Turn off local alarms (subcommand 0x0C)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x65
Data length 2 0x02
Data 1 Subcommand: 0x0C
Status
  • 0x00: Off
  • 0x01: On
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 03 65 00 02 0c 00 75

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x65
Data length 2 0x02
Data 1 Subcommand: 0x0C
1 Operation 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.

Example: 55 aa 00 65 00 02 0c 00 72

Manage alarms (subcommand 0x0D)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x65
Data length 2 0xXX
Data 1 Subcommand: 0x0D
Status
  • 0x01: Set an alarm.
  • 0x02: Edit an alarm.
  • 0x03: Delete an alarm.
  • 0x04: Turn on an alarm.
  • 0x05: Turn off an alarm.
Data is in JSON format.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example: {"date":"20210326", "time":"17:05", "loops":"0000000", "timeZone":"+08:00", "bell":0}

55 aa 03 65 00 53 0d 01 7b 22 64 61 74 65 22 3a 22 32 30 32 31 30 33 32 36 22 2c 22 74 69 6d 65 22 3a 22 31 37 3a 30 35 22 2c 22 6c 6f 6f 70 73 22 3a 22 30 30 30 30 30 30 30 22 2c 22 74 69 6d 65 5a 6f 6e 65 22 3a 22 2b 30 38 3a 30 30 22 2c 22 62 65 6c 6c 22 3a 30 7d 9e

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x65
Data length 2 0x09
Data 1 Subcommand: 0x0D
1 Opcode
  • 0x01: Set an alarm.
  • 0x02: Edit an alarm.
  • 0x03: Delete an alarm.
  • 0x04: Turn on an alarm.
  • 0x05: Turn off an alarm.
1 Operation result:
  • 0x00: Success.
  • 0x01: Invalid JSON format.
  • 0x02: Parameter missing.
  • 0x03: Failed service request.
  • 0x04: Other errors.
6 The timerId of the operation.
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 65 00 09 0d 01 00 00 00 00 00 00 0a 85

Manage alarms in JSON format

Set an alarm

Name Type Description Optional
time String Set the time for the alarm, such as 08:30. N
loops String The repetition rule for Sunday through Saturday, where 1 indicates on and 0 indicates off. For example, 0100001 indicates the alarm goes off every Monday and Saturday. N
date String Set the date for the alarm. This field defaults to 00000000 for repeated alarms. For one-time alarms, enter the specific date when the alarm should go off. For example, 20181126. N
timeZone String The timezone, such as +08:00. N
bell Integer The alarm ringtone, a positive integer.
  • 0: Online ringtone.
  • Other values: Local ringtone, defaulting to 1.
Y
bellDesc String The ringtone description, used to match a song. Y
  • One-time alarm: { "date": "20181126", "time": "20:30", "loops": "0000000", "timeZone": "+08:00", "bell":1 }
  • Recurring alarm: { "date": "00000000", "time": "08:00", "loops": "0111110", "timeZone": "+08:00", "bell":1 }

Edit an alarm

Name Type Description Optional
time String Set the time for the alarm, such as 08:30. N
loops String The repetition rule for Sunday through Saturday, where 1 indicates on and 0 indicates off. For example, 0100001 indicates the alarm goes off every Monday and Saturday. N
date String Set the date for the alarm. This field defaults to 00000000 for repeated alarms. For one-time alarms, enter the specific date when the alarm should go off. For example, 20181126. N
timerId Long The alarm ID. N
timeZone String The timezone, such as +08:00. N
bell Integer The alarm ringtone, a positive integer.
  • 0: Online ringtone.
  • Other values: Local ringtone, defaulting to 1.
Y
bellDesc String The ringtone description, used to match a song. Y
  • One-time alarm: { "timerId": 10164075, "date": "20210322", "time": "14:30", "loops": "0000000", "timeZone": "+08:00", "bell":1 }
  • Recurring alarm: { "timerId": 10164075, "date": "20210322", "time": "14:30", "loops": "0111110", "timeZone": "+08:00", "bell":1 }

Delete an alarm

Request parameters

Name Type Description Optional
timerId Long The alarm ID. N

Sample request

{"timerId": 1002}

Turn off an alarm

Request parameters

Name Type Description Optional
timerId Long The alarm ID. N

Sample request

{"timerId": 1002}

Turn on an alarm

Request parameters

Name Type Description Optional
timerId Long The alarm ID. N

Sample request

{"timerId": 1002}

Get the number of reminders (subcommand 0x0E)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x65
Data length 2 0x01
Data 1 Subcommand: 0x0E
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 03 65 00 01 0e 76

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x65
Data length 2 0x02
Data 1 Subcommand: 0x0E
1 The number of reminders: 0 to 30.
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 65 00 02 0e 02 76

Send online content proactively (subcommand 0x0F)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x65
Data length 2 0x0001 + N
Data 1 Subcommand: 0x0F
N {
“text”: “xxx”, // The text or text command stored on the device.
“type”: “tts/music”, // tts indicates the text the speaker reads out. music indicates the custom ringtone to be set.
“target”: “alert/clock”, // Indicates this is an alarm or a reminder.
}
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example: {"text":"Play Beethoven", "type":"music", "target":"alert"}

55 aa 03 65 00 41 0f 7b 22 74 65 78 74 22 3a 22 e6 92 ad e6 94 be e6 9e 97 e4 bf 8a e6 9d b0 e7 9a 84 e6 ad 8c 22 2c 22 74 79 70 65 22 3a 22 6d 75 73 69 63 22 2c 22 74 61 73 67 65 74 22 3a 22 61 6c 65 72 74 22 7d 91

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x65
Data length 2 0x0002
Data 1 Subcommand: 0x0F
1 Operation result:
  • 0x00: Success.
  • 0x01: Invalid JSON format.
  • 0x02: Parameter missing.
  • 0x03: Other errors.
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 65 00 02 0f 00 75

Extended DP reporting and sending (0x36)

Enable extended DP service (subcommand 0x01)

  • This service extends the source of data sending to LAN, WAN, and Bluetooth.

  • This service conflicts with the ordinary command sending.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x36
Data length 2 0x0002
Data 1 Subcommand: 0x01
1
  • 0x00: Disable the extended DP service.
  • 0x01: Enable the extended DP service.
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 03 36 00 02 01 01 3c

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x36
Data length 2 0x0002
Data 1 Subcommand: 0x01
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.

Example: 55 aa 00 36 00 02 01 00 38

Send DP command via extended source (subcommand 0x02)

  • For more information about the DP data unit, see Data units.

  • One command can contain data units of multiple DPs.

  • Asynchronous communication applies when the module sends control commands and the MCU reports DP status.

  • The extended source of sending DP data must be set manually, which conflicts with the ordinary command sending.

  • The supported extended sources are listed below. Any sources other than these are not supported.

The module sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x36
Data length 2 It depends on the types and the number of data units. (N + 2)
Data 1 Subcommand: 0x02
1 The sources of sending DP data:
  • 0x00: Unknown source.
  • 0x01: LAN.
  • 0x02: WAN.
  • 0x03: Local schedule.
  • 0x04: Cloud scene.
  • 0x05: Reliable channel.
  • 0x06: Bluetooth.
  • 0x07: Local scene.
  • 0xF0: Offline voice module.
N Data units
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example: Suppose that DP 3 of Boolean type is used for on/off control over LAN, and 1 means to turn on the device. The module sends the following to the MCU.

Example: 55 aa 00 36 0007 02 01 03 01 0001 01 45

Report DP status via extended source (subcommand 0x03)

This feature only applies to offline voice modules. For modules where it does not apply, use the standard status reporting command.

  • For more information about the DP data unit, see Data units.

  • This is an asynchronous command. The MCU uses it to report device status to the module, which can be triggered by three mechanisms.

    • After the MCU executes the command received from the module, it reports the changed DP status to the module.

    • When the MCU proactively detects status changes of DPs, it reports the changed DP status to the module.

    • When the MCU receives the DP status query, it sends the status of all DPs to the module.

    • The MCU can report the status of multiple DPs.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x36
Data length 2 It depends on the types and the number of data units. (N + 3)
Data 1 Subcommand: 0x03
1
  • 0x00: The MCU proactively reports data.
  • 0x01: The MCU responds to a status query.
  • 0x02: The MCU responds to a DP command sent via an extended source.
1 When the MCU proactively reports data or responds to a status query, this field is set to 0x00. When the MCU responds to a DP command sent via an extended source, it returns the specific source.
  • 0x00: Unknown source.
  • 0x01: LAN.
  • 0x02: WAN.
  • 0x03: Local schedule.
  • 0x04: Cloud scene.
  • 0x05: Reliable channel.
  • 0x06: Bluetooth.
  • 0x07: Local scene.
  • 0xF0: Offline voice module.
N Data units
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example: The MCU responds to a command sent over WAN. Suppose that DP 5 of a value type describes the humidity. When the current humidity is 30%, the MCU reports the following data.

Example: 55 aa 03 36 000b 03 02 02 05 02 0004 0000001e 73