Basic AT Command Set
This chapter introduces basic AT commands
AT: Test AT startup
AT+HELP: View AT command set
AT+RST: Restart module
AT+RESTORE: Restore factory settings
ATE1: Enable echo
ATE0: Disable echo
AT+GMR: Query version information
AT+SLEEP: Sleep mode
AT+UARTCFG: UART configuration
AT+OTA: Online upgrade
AT: Test AT startup
Description
Command to test whether the AT framework is working properly
Execute Command
Command:
AT
Response:
OK
AT+HELP: View AT command set
Description
Query the AT command list
Execute Command
Command:
AT+HELP
Response:
<指令名称>:<注释>
.......
<指令名称>:<注释>
OK
AT+RST: Restart module
Description
Restart the module
Execute Command
Command:
AT+RST
Response:
OK
AT+RESTORE: Restore factory settings
Description
Restore factory mode and erase configuration (except credentials and IO mapping)
Execute Command
Command:
AT+RESTORE
Response:
OK
ATE1: Enable echo
Description
Enable echo
Note
PB series has echo enabled by default
TB series has echo enabled by default
Execute Command
Command:
ATE1
Response:
OK
ATE0: Disable echo
Description
Disable echo
Execute Command
Command:
ATE0
Response:
OK
AT+GMR: Query version information
Description
Query version information
Execute Command
Command:
AT+GMR
Response:
<at version>:AT版本信息(combo版本)
<sdk version>:SDK版本信息
<firmware version>:固件版本
OK
Parameters
<at version>: AT version information (Combo version)
<sdk version>: SDK version information
<firmware version>: Firmware version information
Notes
If you encounter any issues while using Combo-AT firmware, please provide the
AT+GMRversion information first. The build time is printed automatically after the module restarts.
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
Configure sleep mode
Note
PB series default mode is 3 (normal mode)
TB series default mode is 3 (normal mode)
Ai-WB2 series supports mode 2/3; default is 3
Note: For Ai-WB2 series GPIO wake-up configuration, the pin specified by param1 is not mapped; it refers to the actual chip pin. Only IO7 is supported (IO7 is the RX pin, so for UART wake-up, set IO7 to a low-level environment, e.g., AT+SLEEP=2,2,7,0)
Execute Command
Command:
AT+SLEEP=<mode>[,<wakeup source>,<param1>,<param2>]
Response:
OK
Parameters
- Mode:
0: Enter light sleep; do not auto-enter light sleep on power-up
1: Enter light sleep; auto-enter light sleep on power-up
2: Enter deep sleep
3: Normal mode
- wakeup source:
Set wake-up source (valid only when mode=0/1/2)
0: Timer wake-up
2: GPIO wake-up
- param1:
Valid only when wakeup source=0/2
When wakeup source=0, timer wake-up is used; this parameter specifies the timer interval in ms
When wakeup source=2, GPIO wake-up is used; this parameter specifies the wake-up pin number (counted counterclockwise from the upper-left corner of the module, starting from 1)
- Param2:
Valid only when wakeup source=2; specifies the GPIO wake-up level
0: Wake on low level
1: Wake on high level
Example
AT+SLEEP=2,2,7,0
OK
AT+UARTCFG: UART configuration
Description
Query/set AT UART configuration. Models 6212, 6252, and 8258 support baudrate only; flow control is disabled by default and cannot be configured
Note
PB series supports baudrate only
TB series supports baudrate only
Execute Command
Query Command:
AT+UARTCFG?
Response:
+UARTCFG:<baudrate>,<databits>,<stopbits>,<parity>
OK
Set Command:
AT+UARTCFG=<baudrate>,<databits>,<stopbits>,<parity>
Response:
OK
Parameters
baudrate: UART baud rate
- databits: Data bits
5: 5 data bits
6: 6 data bits
7: 7 data bits
8: 8 data bits
- stopbits: Stop bits
1: 1 stop bit
2: 1.5 stop bits
3: 2 stop bits
- parity: Parity
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. OK indicates that the task started successfully, not that the upgrade completed. On success, the module reboots and switches to the new firmware
Execute Command
Query Command:
AT+OTA?
Response:
+OTA:<Mode>,<Host_name>,<Port>,<Route> (Configure firmware upgrade method and firmware address)
OK
Set Command:
AT+OTA=<Mode>,<Host_name>,<Port>,<Route>
Response:
OK
Parameters
- Mode: Download method
1: HTTP
2: HTTPS
Host_name: Server domain name
Port: Server port number
Route: Resource URL to download
Example
1.设置模块的Wi-Fi 工作模式并保存到flash
AT+WMODE=1,1
OK
2.设置模块联网,参数填写有外网的Wi-Fi 名称和Wi-Fi 密码
AT+WJAP="Wi-Fi 名称","Wi-Fi 密码"
+EVENT:WIFI_CONNECT
OK
3.设置固件升级方式及固件地址
AT+OTA=2,chencongcc.oss-cn-beijing.aliyuncs.com,443,/bl_OTA-ComboV2.0.0.bin.xz
OK
4.开始升级
AT+OTA
OK