Basic AT command set

This chapter introduces basic AT commands

AT:Test AT boot

description

  • Instructions to test whether the AT frame is working properly

Excuting an order

order:

AT

respond:

OK

AT+HELP:View AT command set

description

  • Query the list of AT command sets

Excuting an order

order:

AT+HELP

respond:

<command name>:<comment>
.......
<command name>:<comment>

OK

AT+RST:module restart

description

  • restart module

Excuting an order

order:

AT+RST

respond:

OK

AT+RESTORE:reset

description

  • Restore factory mode, erase configuration information (except triplet, IO mapping)

Excuting an order

order:

AT+RESTORE

respond:

OK

ATE1:turn on echo

description

  • turn on echo

comment

  • PB series echo is enabled by default

  • TB series echo is enabled by default

Excuting an order

order:

ATE1

respond:

OK

ATE0:turn off echo

description

  • turn off echo

Excuting an order

order:

ATE0

respond:

OK

AT+GMR:query version information

description

  • query version information

Excuting an order

order:

AT+GMR

respond:

<at version>:AT version information (combo version)
<sdk version>:SDK version information
<firmware version>:firmware version

OK

parameter

  • <at version>:AT version information (combo version)

  • <sdk version>:SDK version information

  • <firmware version>: firmware version

description

  • If you have any problems in using AiThinker-Combo firmware, please provide AT+GMR version information first. If you know the compilation time, it will be printed out automatically after the module is restarted.

example

AT+GMR

at version:release/V4.18_P2.19.1
sdk version:release_bl_iot_sdk_1.6.36
firmware version:V4.18_P1.4.4-e15d67b
OK

AT+SLEEP:sleep mode

description

  • set sleep mode

comment

  • The default mode of PB series is 3, normal mode

  • The default mode of TB series is 3, normal mode

  • Ai-WB2 series support mode 2/3, the default is 3

  • Note: The pin specified by param1 is not mapped during the GPIO wake-up configuration of the Ai-WB2 series, that is, the actual pin of the chip, and only supports the IO7 pin (IO7 is the RX pin, so we generally set IO7 low for serial port wake-up The level environment is enough, that is, AT+SLEEP=2,2,7,0)

Excuting an order

order:

AT+SLEEP=<mode>[,<wakeup source>,<param1>,<param2>]

respond:

OK

parameter

  • Mode:
    • 0:enter light sleep, power-on does not automatically enter light sleep state

    • 1:enter light sleep, power on automatically enter light sleep

    • 2:enter deep sleep

    • 3:normal mode

  • wakeup source:
    • Set wakeup source (only valid when mode=0/1/2)

    • 0:timer wake up

    • 2:GPIO wakeup

    param1:
    • only valid when wakeup source=0/2

    • when wakeup source=0, it means to use timing wakeup, this parameter indicates the timing time, the unit is ms

    • wakeup source=2 means to use GPIO to wake up, this parameter indicates the sequence number of the wakeup pin (sorted counterclockwise from the upper left corner of the module, the pin number starts from 1)

    Param2:
    • It is only valid when wakeup source=2, indicating the wakeup level when GPIO wakes up

    • 0:low level wake up

    • 1:high level wake-up

example

AT+SLEEP=2,2,7,0

OK

AT+UARTCFG:serial port settings

description

  • Query/set AT serial port configuration commands, 6212, 6252, 8258 only support baudrate, flow control is off by default and cannot be set

comment

  • PB series only supports baudrate

  • TB series only supports baudrate

Excuting an order

query command:

AT+UARTCFG?

respond:

+UARTCFG:<baudrate>,<databits>,<stopbits>,<parity>

OK

set command:

AT+UARTCFG=<baudrate>,<databits>,<stopbits>,<parity>

respond:

OK

parameter

  • baudrate:serial baud rate

  • databits:data bit
    • 5:5 bit data bit

    • 6:6 bit data bit

    • 7:7 bit data bit

    • 8:8 bit data bit

    stopbits:stop bit
    • 1:1 bit stop bit

    • 2:1.5 bit stop bit

    • 3:2 bit stop bit

    parity:Check Digit
    • 0:None

    • 1:Odd

    • 2:Even

example

AT+UARTCFG=9600,8,1,0

OK

AT+OTA:online upgrade

description

  • Start an OTA upgrade

  • Note: The upgrade is asynchronous. Displaying OK just means that the startup task is successful, not that the upgrade is successful. After the upgrade is successful, the module will be restarted and switched to the new firmware

Excuting an order

query command:

AT+OTA?

respond:

+OTA:<Mode>,<Host_name>,<Port>,<Route> (set the firmware upgrade method and firmware address)

OK

set command:

AT+OTA=<Mode>,<Host_name>,<Port>,<Route>

respond:

OK

parameter

  • Mode:download method
    • 1:HTTP

    • 2:HTTPS

  • Host_name:server domain name

  • Port:server port number

  • Route:resource address to download

example

1.Set the Wi-Fi working mode of the module and save it to flash
AT+WMODE=1,1

OK

2.Set the module to be connected to the Internet, and the parameters are filled with the Wi-Fi name and Wi-Fi password of the external network
AT+WJAP="Wi-Fi name","Wi-Fi password"

+EVENT:WIFI_CONNECT

OK

3.set the firmware upgrade method and firmware address
AT+OTA=2,chencongcc.oss-cn-beijing.aliyuncs.com,443,/bl_OTA-ComboV2.0.0.bin.xz

OK

4.start to upgrade
AT+OTA

OK