Sleep AT example

This document briefly introduces and illustrates using AT commands to set sleep mode.

Introduction

Currently, Combo-AT supports the following two power consumption modes: 1. Light sleep mode: currently only supports Bluetooth slave mode settings, you can choose to enter or not enter shallow sleep after power on, and keep Bluetooth broadcasting during sleep. 2. Deep sleep mode: There are two wake-up methods: scheduled wake-up and GPIO wake-up. After entering sleep, both Bluetooth and Wi-Fi stop working.

Measurement methods

In order to avoid some unnecessary interference during the power consumption test, it is recommended to test the single module.

Set to light sleep mode in bluetooth connection state

#.Initialize the role as a Bluetooth slave.

command:

AT+BLEMODE=1

respond:

OK

#.Start broadcasting. (enabled by default)

command:

AT+BLEADVEN=1

respond:

OK

#.Update Bluetooth connection parameters. Set the Bluetooth connection interval to 10ms.

command:

AT+BLECONINTV=8,8,99,400

respond:

OK

#.Set sleep mode to light sleep mode.

command:

AT+SLEEP=0

respond:

OK

#.Waiting for connection.

If the connection is established successfully, AT will prompt:

+EVENT:BLE_CONNECTED //Bluetooth connection is successful


OK

Set to deep sleep mode

  1. Set the sleep mode to deep sleep mode, GPIO wakes up.

    command:

    AT+SLEEP=2,2,7,0
    
    OK
    

    respond:

    OK
    

    explanation:

    • The Ai-WB2 series only supports IO7 pin wake-up, that is, it wakes up automatically when the serial port receives data

  2. Set the sleep mode to deep sleep mode, and wake up at a fixed time of 5 seconds.

    command:

    AT+SLEEP=2,0,5000
    
    OK
    

    respond:

    OK