Last Updated on : 2025-02-18 01:59:52download
This topic describes how to implement the sleep and wake-up service.
dtm
to 10
).sm
field in the Query product information command.Set sm
to 0
. The MCU controls the module’s power-on and power-off logic.
Set sm
to 1
. Also, you need to configure wk
and wkp
to wake up the module. If the wake-up GPIO (wk
) is at an active level, the module will not enter sleep mode. If the wake-up GPIO (wk
) is at an inactive level, check whether an OTA update (or file download) task is in progress. If no OTA update (or file download) task is in progress, the module enters sleep mode. When the module is woken up after sleeping in this mode, it will restart.
Set sm
to 2
. Also, you need to configure wk
and wkp
to wake up the module.
wk
) is at an active level, the module will not enter sleep mode.wk
) is at an inactive level, check whether an OTA update (or file download) task is in progress.wk
) to an active level. The MCU can communicate with the module only after receiving the module’s wake-up status notification. If the MCU supports sleep mode, you can configure mwk
and mwkpt
to allow the module to wake up the MCU.low
field).m
to 1
and use timeout pairing to reduce standby power consumption.The following table lists commands used in the sleep and wake-up service.
Command | Description |
---|---|
0x91 (subcommand: 0x00) | Send a sleep status notification |
0x91 (subcommand: 0x01) | Send a wake-up status notification |
0x91 (subcommand: 0x02) | Request to enter sleep mode |
Notify the MCU that the module will enter sleep mode, and the MCU will reply whether the module can enter sleep mode. If the MCU does not return a response, the module will automatically enter sleep mode after five seconds.
The module sends the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x91 |
Data length | 2 | 0x0001 |
Data | 1 | Subcommand: 0x00 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x91 |
Data length | 2 | 0x0002 |
Data | 1 | Subcommand: 0x00 |
1 |
|
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
After being woken up, the module proactively sends the wake-up status to the MCU.
The module sends the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x91 |
Data length | 2 | 0x0001 |
Data | 1 | Subcommand: 0x01 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU returns the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x91 |
Data length | 2 | 0x0001 |
Data | 1 | Subcommand: 0x01 |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
The MCU can use this command to quickly request the module to enter sleep mode.
The MCU sends the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x91 |
Data length | 2 | 0x0001 |
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. |
The module returns the following data.
Field | Length | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x91 |
Data length | 2 | 0x0002 |
Data | 1 | Subcommand: 0x02 |
1 | The 8 bits in 1 byte indicate different tasks. 0 means allowing to enter sleep mode, and the device will enter sleep mode after one second. Other bits indicate that a task is being processed and sleep is not allowed. Please try again after five seconds.
|
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback