HCM511S AT Commands Manual
Introduction
This document outlines general and BLE-related AT commands supported by Quectel HCM511S module.
Definitions
- <CR> Carriage return character.
- <LF> Line feed character.
- <...> Parameter name. Angle brackets do not appear on the command line.
- [...] Optional parameter of a command or an optional part of TA information response. Square brackets do not appear on the command line. When an optional parameter is not given in a command, the new value equals its previous value or the default settings, unless otherwise specified.
- Underline Default setting of a parameter.
AT Command Syntax
All command lines must start with AT or at and end with <CR>. Information responses and result codes always start and end with a carriage return character and a line feed character:
AT commands implemented by the module can be separated into two categories syntactically: "Basic" and "Extended", as listed below:
Basic Command
These AT commands have the format of AT
, or AT& , where <x> is the command, and <n> is/are the argument(s) for that command. An example of this is ATE, which tells the DCE (Data Circuit-terminating Equipment) whether received characters should be echoed back to the DTE (Data Terminal Equipment) according to the value of <n>. <n> is optional and a default will be used if it is omitted. Extended Command
Extended commands can be executed in several modes, as shown in the following table.
Types of AT Commands:
| Command Type | Syntax | Description |
|---|---|---|
| Test Command | AT+<cmd>=? |
Tests if the command exists and returns info about its type, value, or range. |
| Read Command | AT+<cmd>? |
Reads the current parameter value of the command. |
| Write Command | AT+<cmd>=<p1>[,<p2>[,<p3>]] |
Sets user-definable parameter values. |
| Execution | AT+<cmd> |
Returns specific info or performs an action. |
AT Command Input and Responses
Spaces should be ignored when you enter AT commands, except in the following cases:
- Within quoted strings, where spaces are preserved;
- Within an unquoted string or numeric parameter;
- Within an IP address;
- Within the AT command name up to and including a =, ? or =?.
On input, at least a carriage return is required. A newline character is ignored so it is permissible to use carriage return/line feed pairs on the input.
If no command is entered after the AT token, OK will be returned. If an invalid command is entered, ERROR will be returned.
Optional parameters, unless explicitly stated, need to be provided up to the last parameter being entered.
AT Command Responses
When the AT command processor has finished processing a line, it will output OK, ERROR or +CME ERROR:
Responses will be in the format of:
Or
Declaration of AT Command Examples
The AT command examples in this document are provided to help you learn about the use of the AT commands introduced herein. The examples, however, should not be taken as Quectel's recommendations or suggestions about how to design a program flow or what status to set the module into. Sometimes multiple examples may be provided for one AT command. However, this does not mean that there is a correlation among these examples, or that they should be executed in a given sequence. The URLs, domain names, IP addresses, usernames/accounts, and passwords (if any) in the AT command examples are provided for illustrative and explanatory purposes only, and they should be modified to reflect your actual usage and specific needs.
AT Command Description
Description of General AT Commands
AT+QRST
Description: Reboots the module.
Command Format:
AT+QRST
Response:
- OK (success)
- ERROR (failure)
Maximum Response Time: 300 ms
Characteristics: None
ATI
Description: Displays the MT identification information.
Command Format:
ATI
Response:
- Quectel
<objectID>
Revision: <revision>
OK (success) - ERROR (failure)
Parameter:
<objectID>: String type without double quotation marks. Identifier of device type.<revision>: String type without double quotation marks. Identification text of MT firmware version.
Maximum Response Time: 300 ms
Characteristics: None
AT+QVERSION
Description: Gets the firmware version of the module.
Command Format:
AT+QVERSION
Response:
- +QVERSION:
\nOK (success) - ERROR (failure)
Parameter:
<version>: String type without double quotation marks. Firmware version number.
Maximum Response Time: 300 ms
Characteristics: None
AT+QECHO
Description: Enables or disables echo function.
Command Format:
AT+QECHO=<mode>
Response:
- OK (success)
- ERROR (failure)
Parameter:
<enable>: Integer type. Enable/Disable echo function. 0 = Disable, 1 = Enable.
Maximum Response Time: 300 ms
Characteristics: Takes effect immediately. Configuration is not saved.
AT+QSETBAUD
Description: Sets serial port baud rate and writes the baud rate to Flash.
Command Format:
AT+QSETBAUD=<baud>
Response:
- OK (success)
Or - ERROR (failure)
Parameter:
<baud_rate>: Integer type. Serial port baud rate. The values of the baud rate are 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400, 460800 and 921600. Default value: 115200. Unit: bps.
Maximum Response Time: 300 ms
Characteristics: Takes effect immediately. Configuration is saved automatically.
AT+QTXPOWER
Description: Sets TX power and writes the TX power to Flash.
Command Format:
AT+QTXPOWER? (read)
or
AT+QTXPOWER=<power> (write)
Response:
- +QTXPOWER: <TX_power>
OK (read)
- OK (write success)
- ERROR (failure)
Parameter:
<TX_power>: Integer type. TX power. Range: -16--6. Default value: 0. Unit: dBm.
Maximum Response Time: 300 ms
Characteristics: Takes effect after the module is rebooted. Configuration is saved automatically.
AT+QCFGRI
Description: Enables or disables RI pin, configures the latency of URC output after the RI pin level flip and sets the duration of the RI pin low-level state.
Command Format:
AT+QCFGRI=<RI_enable>[,<URC_delay>[,<RI_hold>]]
Response:
- OK (success)
- ERROR (failure)
Parameter:
<RI_enable>: Integer type. Enable or disable RI pin. The module's RI pin is GPIO5. 0 = Disable, 1 = Enable.<URC_delay>: Integer type. The latency of URC output after the RI pin level flip. The parameter is only valid when<RI_enable>is 1. Range: 10--50. Default value: 20. Unit: ms.<RI_hold>: Integer type. The duration of the RI pin low-level state. The parameter is only valid when<RI_enable>is 1. Range: 10--50. Default value: 20. Unit: ms.
Maximum Response Time: 300 ms
Characteristics: Takes effect immediately. Configurations are not saved.
Note:
The RI pin level is high by default. After the RI pin is enabled through AT+QCFGRI=1,20,20, it switches to a low level for 20 ms. When the state of the RI pin in low level is ended and then after 20 ms, the URC is output.
Description of BLE-Related AT Commands
AT+QBLEINIT
Description: Initializes BLE functionality. You only need to execute the command once to initialize BLE functionality after the module is booted.
Command Format:
AT+QBLEINIT? (read)
or
AT+QBLEINIT=<role>[,<auto_adv>] (write)
Response:
- +QBLEINIT:
<role>\nOK (read) - OK (write success)
- ERROR (failure)
Parameter:
<role>: Integer type. Set module role when initializing BLE functionality.- 1: Set module as a central device
- 2: Set module as a peripheral device. The advertisement is turned on automatically by default after the BLE disconnection. If you do not need this feature, you can execute
AT+QBLEINIT=2,0during BLE functionality initialization to turn it off. - 4: Set module as a dual-role device. Two central devices and three peripheral devices can be connected to the module at most simultaneously.
<auto_adv>: Integer type. Whether the advertisement is turned on automatically after the BLE disconnection when the module is operating as a peripheral device or a dual-role device. 0 = Not turn on advertisement, 1 = Turn on advertisement.
Maximum Response Time: 300 ms
Characteristics: Takes effect immediately. Configurations are not saved.
AT+QBLEADDR
Description: Queries BLE device address.
Command Format:
AT+QBLEADDR?
Response:
- +QBLEADDR:
<BLE_addr>\nOK (success) - ERROR (failure)
Parameter:
<BLE_addr>: String type. BLE device address. 48-bit address as hexadecimal string, e.g. "90395E8A70D1".
Maximum Response Time: 300 ms
Characteristics: None
AT+QBLENAME
Description: Sets the BLE device name.
Command Format:
AT+QBLENAME? (read)
or
AT+QBLENAME=<BLE_name> (write)
Response:
- +QBLENAME:
<BLE_name>\nOK (read) - OK (write success)
- ERROR (failure)
Parameter:
<BLE_name>: String type. BLE device name. Max length: 25 bytes. Default: "QUEC_HCM511S".
Maximum Response Time: 300 ms
Characteristics: Takes effect immediately. Configuration is not saved.
AT+QBLEADVPARAM
Description: Configures BLE advertising parameters when the module is operating as a peripheral device or a dual-role device.
Command Format:
AT+QBLEADVPARAM? (read)
or
AT+QBLEADVPARAM=<adv_int_min>,<adv_int_max> (write)
Response:
- +QBLEADVPARAM:
<adv_int_min>,<adv_int_max>\nOK (read) - OK (write success)
- ERROR (failure)
Parameter:
<adv_int_min>: Integer type. Minimum advertising interval for non-directional and low duty cycle directional advertising. Range: 32--16384 (Time range: 20 ms--10.24 s). Default value: 1600 (100 ms). Unit: timeslot (1 timeslot = 0.625 ms).<adv_int_max>: Integer type. Maximum advertising interval for non-directional advertising and low duty cycle directional advertising. Range: 32--16384 (Time range: 20 ms--10.24 s). Default value: 160 (100 ms). Unit: timeslot (1 timeslot = 0.625 ms).
Maximum Response Time: 300 ms
Characteristics: Takes effect immediately. Configurations are not saved.
Note:
The BLE advertising parameters configured by AT+QBLEADVPARAM can only take effect after the BLE advertising is started again.
AT+QBLEADVDATA
Description: Sets BLE advertising data when the module is operating as a peripheral device or a dual-role device.

Command Format:
AT+QBLEADVDATA=<adv_data>
Response:
- OK (success)
- ERROR (failure)
Parameter:
<adv_data>: Hexadecimal string type. Advertising data (AD). It consists of multiple AD Structure fields and should comply with the BLE advertising format. The fields included are as follows:- Length: Length of AD Structure. The length includes AD Type and AD Data but not 1-byte length of the Length field itself. The maximum length is 0x1e, i.e., the maximum length of a Data field is 30 bytes.
- AD Type: Advertising data type, such as TX Power Level (0x0A), Local Name (0x09), Le Role (0x1C) and Service UUIDs (0x16). After the peer scans the advertisement, the meaning of the advertising data can be determined from the AD Type.
- AD Data: Advertising data in big-endian byte order.
Maximum Response Time: 300 ms
Characteristics: Takes effect immediately. Configuration is not saved.
Note:
For details of AD types, see Core Specification 5.2 (https://www.bluetooth.com/specifications/specs/core-specification/).
AT+QBLESRDATA
Description: Sets BLE scan response data when the module is operating as a peripheral device.
Command Format:
AT+QBLESRDATA=<sr_data>
Response:
- OK (success)
- ERROR (failure)
Parameter:
<sr_data>: String type. Scan response data, which is similar to<adv_data>.
Maximum Response Time: 300 ms
Characteristics: Takes effect immediately. Configuration is not saved.
AT+QBLEGATTSSRV
Description: Establishes a BLE service when the module is operating as a peripheral device or a dual-role device.
Command Format:
AT+QBLEGATTSSRV=<srv_UUID>
Response:
- OK (success)
- ERROR (failure)
Parameter:
<srv_UUID>: String type. BLE service UUID. Length: 4 bytes or 32 bytes.
Maximum Response Time: 300 ms
Characteristics: Takes effect immediately. Configuration is not saved.
Note:
Only two BLE services can be established at most through the command.
You must first initialize the BLE functionality through AT+QBLEINIT to set the module as a peripheral device or a dual-role device, and then establish a BLE service through AT+QBLEGATTSSRV. Otherwise, the Bluetooth advertising, scan and connection functions cannot be used normally.
AT+QBLEGATTSCHAR
Description: Sets BLE characteristic UUID when the module is operating as a peripheral device or a dual-role device.
Command Format:
AT+QBLEGATTSCHAR=<char_UUID>[,<att_cfg>]
Response:
- OK (success)
- ERROR (failure)
Parameter:
<char_UUID>: String type. Characteristic UUID. Length: 4 bytes or 32 bytes.<att_cfg>: Integer type. Property configuration of characteristic UUID. Range: 0--FF. bit7--bit0 represent different properties:- bit2: Notify
- bit1: Write no response
- bit0: Write
- bit7--bit3: Reserve
Maximum Response Time: 300 ms
Characteristics: Takes effect immediately. Configurations are not saved.
Note:
Only two BLE characteristic UUIDs can be set at most through the command. When <att_cfg> is omitted, the property of each characteristic UUID is Notify and Write no response by default.
When the module is operating as a peripheral device or a dual-role device, you must establish a BLE service, and then set BLE characteristic UUID through the command. Otherwise, the Bluetooth advertising, scan and connection functions cannot be used normally.
AT+QBLEGATTSSRVDONE
Description: Completes the BLE service establishment when the module is operating as a peripheral device or a dual-role device.
Command Format:
AT+QBLEGATTSSRVDONE
Response:
- OK (success)
- ERROR (failure)
Maximum Response Time: 300 ms
Characteristics: None
Note:
When the module is operating as a peripheral device or a dual-role device, you must set BLE characteristic UUID through AT+QBLEGATTSCHAR, and then complete the BLE service establishment through the command. Otherwise, the Bluetooth advertising, scan and connection functions cannot be used normally.
AT+QBLEADVSTART
Description: Starts BLE advertising when the module is operating as a peripheral device or a dual-role device.
Command Format:
AT+QBLEADVSTART? (read)
or
AT+QBLEADVSTART (execute)
Response:
- +QBLEADVSTART:
<adv_state>\nOK (read) - OK (execute success)
- ERROR (failure)
Parameter:
<adv_state>: Integer type. Advertising state. 1 = The advertising is stopped, 2 = The advertising is started.
Maximum Response Time: 1000 ms
Characteristics: None
AT+QBLEADVSTOP
Description: Stops BLE advertising when the module is operating as a peripheral device or a dual-role device.
Command Format:
AT+QBLEADVSTOP
Response:
- OK (success)
- ERROR (failure)
Maximum Response Time: 300 ms
Characteristics: None
AT+QBLEADV
Description: Quick starts BLE advertising.
Command Format:
AT+QBLEADV? (read)
or
AT+QBLEADV=<adv_state> (write)
Response:
- +QBLEADV:
<adv_state>\nOK (read) - OK (write success)
- ERROR (failure)
Parameter:
<adv_state>: Integer type. Advertising state. 0 = The advertising is stopped, 1 = The advertising is started.
Maximum Response Time: 1000 ms
Characteristics: None
Note:
If BLE functionality is not initialized and BLE service is not established, you can start the advertising directly through the command and the default BLE service is established by the module. The default service is as follows:
Service UUID: 0x6E400001B5A3F393E0A9E50E24DCCA9E
Characteristic UUID for receiving data: 0x6E400002B5A3F393E0A9E50E24DCCA9E (Properties: Write and Write no response)
Characteristic UUID for sending data: 0x6E400003B5A3F393E0A9E50E24DCCA9E (Property: Notify)
After the module is booted, the module is configured as a peripheral device automatically if you execute the command to start the advertising directly.
AT+QBLEGATTSNTFY
Description: Sends GATT data by notification when the module is operating as a peripheral device or a dual-role device.
Command Format:
AT+QBLEGATTSNTFY=<conn_idx>,<UUID>[,<hex_length>],<data>
Response:
- OK (success)
- ERROR (failure)
Parameter:
<conn_idx>: Integer type. The peer device index assigned by the module automatically when the BLE connection is established. Range: 0--4. Default value: 0.<UUID>: String type. Characteristic UUID. Length: 4 bytes or 32 bytes.<hex_length>: Integer type. Hex data length. The module will convert<data>to hexadecimal format before sending data when this optional parameter is used.<data>: String type. GATT data.
Maximum Response Time: 300 ms
Characteristics: None
AT+QBLESCAN
Description: Enables or disables BLE scan when the module is operating as a central device or a dual-role device.
Command Format:
AT+QBLESCAN? (read)
or
AT+QBLESCAN=<scan>[,<timeout>] (write)
Response:
- +QBLESCAN:
<scan_state>\nOK (read) - OK (write success)
- +QBLESCAN:
<name>,<address_type>,<BLE_addr>(when<scan>=1) - +QBLESCAN:
<name>,<address_type>,<BLE_addr>,<RSSI>,<adv_data>(when<scan>=2 or 3) - ERROR (failure)
Parameter:
<scan_state>: Integer type. The current scan state. 1 = The scan is disabled, 2 = The scan is enabled.<scan>: Integer type. Enable/disable BLE scan.- 0: Disable
- 1: Enable BLE scan but do not output
<adv_data> - 2: Enable BLE scan and output
<adv_data>. It is required to specify<timeout>in this mode. - 3: Enable BLE scan and output
<adv_data>. Only the connectable advertising is scanned in this mode.
<timeout>: Integer type. Scan duration. Range: 100--10000. Unit: ms. It must be set when<scan>is 2.<name>: String type. Scanned BLE device name.<address_type>: Integer type. BLE device address type. 0 = Public address, 1 = Random address.<BLE_addr>: String type. BLE device address. 48-bit address as hexadecimal string.<RSSI>: Integer type. The signal strength value.<adv_data>: String type. Scanned BLE data and response data.
Maximum Response Time: 1000 ms
Characteristics: None
Note:
If you execute the command to enable the BLE scan directly after the module is booted, the module is configured as a central device automatically.
AT+QBLESCANPARAM
Description: Queries or sets BLE scan parameters when the module is operating as a central device or a dual-role device.
Command Format:
AT+QBLESCANPARAM? (read)
or
AT+QBLESCANPARAM=<scan_interval>,<scan_window> (write)
Response:
- +QBLESCANPARAM:
<scan_interval>,<scan_window>\nOK (read) - OK (write success)
- ERROR (failure)
Parameter:
<scan_interval>: Integer type. BLE scan interval. Range: 18--4096 (Time range: 11.25 ms to 2.56 s). Unit: timeslot (1 timeslot = 0.625 ms). Default value: 100.<scan_window>: Integer type. BLE scan duration.<scan_window>shall be less than or equal to<scan_interval>. Range: 17--4096 (Time range: 10.625 ms--2.56 s). Unit: timeslot (1 timeslot = 0.625 ms). Default value: 30.
Maximum Response Time: 300 ms
Characteristics: Takes effect immediately. Configurations are not saved.
Note:
The configured scan parameters do not take effect immediately during the scan process. You must disable the scan and then enable the scan again. After that, the parameters can take effect.
AT+QBLESCANKWSET
Description: Sets the keyword filtering.
Command Format:
AT+QBLESCANKWSET=<enable>[,<keyword_num>[,<keyword1>[,<keyword2>[,...[,<keyword5>]]]]]
Response:
- OK (success)
- ERROR (failure)
Parameter:
<enable>: Integer type. Enable or disable keyword filtering. 0 = Disable, 1 = Enable.<keyword_num>: Integer type. Number of keywords. Range: 0--5.<keywordx>: String type. The keywords of the target device advertisement data.
Maximum Response Time: 1000 ms
Characteristics: Takes effect immediately. Configurations are not saved.
AT+QBLECONN
Description: Connects to a peripheral device when the module is operating as a central device or a dual-role device.
Command Format:
AT+QBLECONN=<addr_type>,<peer_addr>[,<timeout>]
Response:
- OK (success)
- ERROR (failure)
Parameter:
<addr_type>: Integer type. Peripheral device address type. 0 = Public address, 1 = Random address.<peer_addr>: String type. Peripheral device address.<timeout>: Integer type. The timeout from the connection initiation to connection completion. Range: 1000--60000. Unit: ms. Default value: 15000.
Maximum Response Time: 300 ms
Characteristics: Takes effect immediately. Configurations are not saved.
Note:
If you execute the command to connect to a peripheral device directly after the module is booted, the module is configured as a central device automatically.
AT+QBLECONNPARAM
Description: Configures connection parameters when the module is operating as a peripheral device or a central device.
Command Format:
AT+QBLECONNPARAM? (read)
or
AT+QBLECONNPARAM=<conn_idx>,<con_interval>,<timeout>,<latency> (write)
Response:
- +QBLECONNPARAM:
<conn_idx>,<con_interval>,<timeout>,<latency>\nOK (read) - OK (write success)
- ERROR (failure)
Parameter:
<conn_idx>: Integer type. The peer device index assigned by the module automatically when the BLE connection is established. Range: 0--4. Default value: 0.<con_interval>: Integer type. Connection interval. Range: 6--3200 (Time range: 7.5 ms to 4 s). Unit: 1.25 ms.<timeout>: Integer type. BLE Link supervision timeout. Range: 10--3200 (Time range: 100 ms to 32 s). Unit: 10 ms.<latency>: Integer type. Number of connection events skipped by the peripheral device. Range: 0--499 (0x0000 to 0x01F3).
Maximum Response Time: 300 ms
Characteristics: None
Note:
The relationship among <con_interval>, <timeout> and <latency> should be as follows: <con_interval> × <latency> is less than the value of <timeout>.
AT+QBLEGATTCWRCMD
Description: Sends GATT data by writing commands when the module is operating as a central device or a dual-role device.
Command Format:
AT+QBLEGATTCWRCMD=<conn_idx>,<UUID>[,<hex_length>],<data>
Response:
- OK (success)
- ERROR (failure)
Parameter:
<conn_idx>: Integer type. The peer device index assigned by the module automatically when the BLE connection is established. Range: 0--4. Default value: 0.<UUID>: String type. Characteristic UUID. Length: 4 bytes or 32 bytes.<hex_length>: Integer type. Hex data length. The module will convert<data>to hexadecimal format before sending data when this optional parameter is used.<data>: String type. GATT data.
Maximum Response Time: 300 ms
Characteristics: None
AT+QBLEGATTCWRREQ
Description: Sends GATT data by writing requests when the module is operating as a central device or a dual-role device.
Command Format:
AT+QBLEGATTCWRREQ=<conn_idx>,<UUID>[,<hex_length>],<data>
Response:
- OK (success)
- ERROR (failure)
Parameter:
<conn_idx>: Integer type. The peer device index assigned by the module automatically when the BLE connection is established. Range: 0--4. Default value: 0.<UUID>: String type. Characteristic UUID. Length: 4 bytes or 32 bytes.<hex_length>: Integer type. Hex data length. The module will convert<data>to hexadecimal format before sending data when this optional parameter is used.<data>: String type. GATT data.
Maximum Response Time: 1000 ms
Characteristics: None
AT+QBLEGATTCNTFCFG
Description: Enables or disables notification when the module is operating as a central device or a dual-role device.
Command Format:
AT+QBLEGATTCNTFCFG=<conn_idx>,<UUID>,<enable>
Response:
- OK (success)
- ERROR (failure)
Parameter:
<conn_idx>: Integer type. The peer device index assigned by the module automatically when the BLE connection is established. Range: 0--4. Default value: 0.<UUID>: String type. Characteristic UUID. Length: 4 bytes or 32 bytes.<enable>: Integer type. Enable/Disable notification. 0 = Disable, 1 = Enable.
Maximum Response Time: 300 ms
Characteristics: None
AT+QBLEDISCONN
Description: Disconnects a BLE connection.
Command Format:
AT+QBLEDISCONN[=<conn_idx>]
Response:
- OK (success)
- ERROR (failure)
Parameter:
<conn_idx>: Integer type. The peer device index assigned by the module automatically when the BLE connection is established. Range: 0--4. Default value: 0.
Maximum Response Time: 300 ms
Characteristics: None
AT+QBLESTAT
Description: Queries the state of BLE device when the module is operating as a central device or a peripheral device.
Command Format:
AT+QBLESTAT
Response:
- +QBLESTAT:
<BLE_state>\nOK (success) - ERROR (failure)
Parameter:
<BLE_state>: String type. Current state of BLE device.- "NOINIT": Uninitialized
- "INIT": Initialized
- "ADVERTISING": Advertising
- "CONNECTED": Connected
- "DISCONNECTED": Disconnected
Maximum Response Time: 300 ms
Characteristics: None
AT+QBLEIDXCONNSTAT
Description: Queries the BLE connection state of a specified device when the module is operating as a dual-role device.
Command Format:
AT+QBLEIDXCONNSTAT=<conn_idx>
Response:
- +QBLEIDXCONNSTAT:
<conn_idx>,<conn_state>\nOK (success) - ERROR (failure)
Parameter:
<conn_idx>: Integer type. The peer device index assigned by the module automatically when the BLE connection is established. Range: 0--4. Default value: 0.<conn_state>: Integer type. BLE connection state. 1 = Not connected, 2 = Connected.
Maximum Response Time: 300 ms
Characteristics: None
AT+QBLECONNLIST
Description: Queries the list of connected devices when the module is operating as a dual-role device.
Command Format:
AT+QBLECONNLIST
Response:
- +QBLECONNLIST:
<conn_idx>[,<peer_role>,<MTU_value>,<BLE_addr>]\n...\nOK (success) - ERROR (failure)
Parameter:
<conn_idx>: Integer type. The peer device index assigned by the module automatically when the BLE connection is established. Range: 0--4. Default value: 0.<peer_role>: Integer type. Peer device role. 0 = Central device, 1 = Peripheral device.<MTU_value>: Integer type. Maximum transmission unit value. Range: 23--250. Unit: byte.<BLE_addr>: String type. Peer device address. 48-bit address as hexadecimal string.
Maximum Response Time: 500 ms
Characteristics: None
Note:
When you execute AT+QBLECONNLIST to query the list of connected devices, if there is no BLE connection for the peer device index, <peer_role>, <MTU_value> and <BLE_addr> are omitted.
AT+QBLETRANMODE
Description: Specifies the characteristic UUID and enables the module to enter transparent transmission mode when the module is operating as a peripheral device or central device.
Command Format:
AT+QBLETRANMODE=<UUID>
Response:
- OK (success)
- ERROR (failure)
Parameter:
<UUID>: String type. Characteristic UUID. Length: 4 bytes or 32 bytes.
Maximum Response Time: 500 ms
Characteristics: Takes effect immediately. Configuration is not saved.
Note:
When the module is operating as a central device, after establishing the BLE connection and having completed the discovering of peer device service (URC: +QBLEINFO: "DOWN"), execute the command to set the module to transparent transmission mode. After disconnecting the BLE connection, the module exits transparent transmission mode automatically. You can only send data in transparent transmission mode by writing commands.
When the module is operating as a peripheral device, after enabling advertising or establishing the BLE connection, execute the command to set the module to transparent transmission mode. If automatic advertising is enabled, the module does not exit transparent transmission mode after the BLE connection is terminated. If the automatic advertising is disabled, the module exits transparent transmission mode automatically after the BLE connection is terminated. You can only send data in transparent transmission mode by Notify.
+++
Description: Enables the module to exit the transparent transmission mode.
Command Format:
+++
Response:
- OK (success)
- ERROR (failure)
Maximum Response Time: 300 ms
Characteristics: Takes effect immediately. The command does not require <LF>.
AT+QBLESERVERENV
Description: Saves or clears the configured parameters when the module is operating as a peripheral device. If the configured parameters are saved successfully, they are still valid after the module is rebooted.
Command Format:
AT+QBLESERVERENV=<env>
Response:
- OK (success)
- ERROR (failure)
Parameter:
<env>: Integer type. Save/Clear configured parameters.- 0: Clear the configured parameters
- 1: Save the configured parameters, including the advertising data, BLE device name, the scan response data, the advertising interval, service UUID and characteristic UUID.
Maximum Response Time: 300 ms
Characteristics: None
Note:
If you need to save the parameters that have been cleared, you need to configure the corresponding parameters through the related commands again after the module is rebooted, and then save the related parameters through the command.
You must complete the BLE service establishment through AT+QBLEGATTSSRVDONE first, and then save the configured parameters through the command.
AT+QBLEDCSPROPSHOW
Description: Enables or disables the display of the characteristic property of the peer service when the module is operating as a central device or a dual-role device.
Command Format:
AT+QBLEDCSPROPSHOW=<enable>
Response:
- OK (success)
- ERROR (failure)
Parameter:
<enable>: Integer type. Enable or disable the display of the characteristic property of the peer service. 0 = Disable, 1 = Enable.
Maximum Response Time: 300 ms
Characteristics: Takes effect immediately. Configuration is not saved.
Note:
If the display of the characteristic property of the peer service is enabled, +QBLEINFO: <char>,<prop> is reported. If the display of the characteristic property of the peer service is disabled, +QBLEINFO: <char> is reported.
For more details about <char> and <prop>, please see Chapter 3.3.
Description of URCs
+QBLESTAT
Description: This URC indicates BLE connection state changes.
URC Format:
+QBLESTAT: <event>
Parameter:
<event>: String type. Event reported when BLE connection state changes.- "CONNECTED": BLE connected
- "DISCONNECTED": BLE disconnected
+QBLEMTU
Description: This URC indicates BLE MTU value changes.
URC Format:
+QBLEMTU: <MTU_value>
Parameter:
<MTU_value>: Integer type. Maximum transmission unit value. Range: 23--250. Unit: byte.
+QBLEINFO
Description: When the module successfully connects to the peer device as a central device or a dual-role device, the URC is reported to display the characteristic UUID and characteristic property of the peer device.
URC Format:
+QBLEINFO: <char>[,<prop>]
Parameter:
<char>: String type.- "DOWN": Completion of discovering the peer device service
- Others: Characteristic UUID of peer device. Length: 4 bytes or 32 bytes.
<prop>: Integer type. Property configuration of characteristic UUID. Range: 0--FF. bit7--bit0 represent different properties:- bit0: Write
- bit1: Write no response
- bit2: Notify
- bit3: Indicate
- bit4: Read
- bit5--bit7: Reserve
+QBLEPEERINFO
Description: This URC indicates BLE device receives messages from peer after BLE connection, BLE disconnection or MTU update.
URC Format:
+QBLEPEERINFO: <conn_idx>,<peer_role>,<BLE_addr>
Parameter:
<conn_idx>: Integer type. The peer device index assigned by the module automatically when the BLE connection is established. Range: 0--4. Default value: 0.<peer_role>: Integer type. Peer device role. 0 = Central device, 1 = Peripheral device.<BLE_addr>: String type. Peer device address. 48-bit address as hexadecimal string.
+QBLERECV
Description: This URC indicates BLE device receives data.
URC Format:
+QBLERECV: <conn_idx>,<UUID>,<length>\r\n<data>\r\n
Parameter:
<conn_idx>: Integer type. The peer device index assigned by the module automatically when the BLE connection is established. Range: 0--4. Default value: 0.<UUID>: String type. Characteristic UUID. Length: 4 bytes or 32 bytes.<length>: Integer type. Length of received data. Unit: byte.<data>: String type without double quotation marks. Received data.
Examples
This chapter introduces the main AT command examples in practical applications of the module as a peripheral device, central device, and dual-role device.Among them, the Bluetooth application nRF Connect needs to be downloaded and installed by the user. For QCOM tool, please contact Quectel Technical Support.
Peripheral Role
During the connection establishment process, the BLE device that accepts the connection request is defined as the peripheral device. After the BLE connection is established, the peripheral device operates as a slave in the link layer.
Setting Module as a Peripheral Device
AT+QBLEINIT=2,1 // Set the module as a peripheral device for initializing BLE.
OK
AT+QBLEADVPARAM=150,150 // Set BLE advertising parameters.
OK
AT+QBLEGATTSSRV="FFF1" // Establish a BLE service and set the service UUID to "FFF1".
OK
AT+QBLEGATTSCHAR="FFF2" // Set characteristic UUID to "FFF2".
OK
AT+QBLEGATTSCHAR="FFF3" // Set characteristic UUID to "FFF3".
OK
AT+QBLEGATTSSRVDONE // Complete the BLE service establishment.
OK
AT+QBLENAME="QuecHCM511S" // Set BLE device name to "QuecHCM511S".
OK
AT+QBLEADDR? // Query BLE device address.
+QBLEADDR: "90395E8A70D1"
OK
AT+QBLEADVSTART // Start BLE advertising.
OK
Connecting to nRF Connect Application
Step 1: Click "SCAN" to scan for peripheral devices, select "QuecHCM511S" in the scan results and then click "CONNECT", as shown in the figure below.

Step 2: After the module is connected successfully, "CONNECTED" is displayed in the interface, and the added UUIDs is displayed in "CLIENT":

Sending Data to Module
Step 1: Select an editable characteristic, and click the upward arrow.

Step 2: Input the data to be sent in "TEXT" format. Then click "SEND", as shown in the figure below.

Once the data is sent successfully, the data received by the module is output via the serial port and displayed in the QCOM tool.Below is the URC indicating the received data. Below is the URC indicating the received data.
+QBLERECV: 0,"FFF3",10
from phone
Sending Data to nRF Connect Application
Step 1: Use the QCOM tool to send the following command to send data to UUID 0xFFF2 by notification:
AT+QBLEGATTSNTFY=0,"FFF2","from HCM511S"
OK
Step 2: The received data is displayed in the Value field of the Unknown Characteristic with UUID 0xFFF2 in the nRF Connect application, as shown in the figure below.

Central Role
During the connection establishment process, the BLE device that initiates the connection request is defined as the central device. After the BLE connection is established, the central device operates as a host in the link layer.
Setting Module as a Central Device
AT+QBLEINIT=1 // Set the module as the central device for initializing BLE.
OK
AT+QBLESCAN=1 // Enable BLE scan.
OK
+QBLESCAN: "test_phone",1,"7F88CFB8E8C3"
AT+QBLESCAN=0 // Disable BLE scan.
OK
AT+QBLECONN=1,"7F88CFB8E8C3" // Connect a peripheral device.
OK
+QBLESTAT: CONNECTED
+QBLEPEERINFO: 0,1,"7F88CFB8E8C3"
+QBLEMTU: 250
+QBLEPEERINFO: 0,1,"7F88CFB8E8C3"
+QBLEINFO: "2B3A"
+QBLEINFO: "2B29"
+QBLEINFO: "046C"
+QBLEINFO: "3344"
+QBLEINFO: "DOWN"
Configuring nRF Connect Application
Adding a Peripheral Device
Step 1: Start nRF Connect application. Then click "Configure GATT server", as shown in the figure below.

Step 2: Step 2: Add a peripheral device named "TEST". Set service UUID to 0x1122 and characteristic UUID to 0x3344, as shown in the figure below.

Adding Advertiser and Start Advertising
Step 1: Select an editable characteristic, and click the upward arrow, as shown in the figure below.

Step 2: First, input "test_phone" in "Display name". Then, click "ADD RECORD" and click "Flags", "Complete Local Name" and "16-bit Service UUID: 0xFF09" in "Advertising data". After that, click "Connectable" in "Options". Finally, click "OK".

Step 3: Advertising starts after the configuration is completed. You can set the advertisement duration manually, as shown in the figure below.


Sending Data to nRF Connect Application
AT+QBLEGATTCWRCMD=0,"3344","write to test phone"
OK
Sending Data to Module
Step 1: Select an editable characteristic, and click the upward arrow, as shown in the figure below.

Step 2: Input the data to be sent in "TEXT" format. Then click "SEND", as shown in the figure below.

After the data is sent successfully, the data received by the module is output via the serial port and displayed in QCOM tool. Below is the URC indicating the received data.
+QBLERECV: 0,"3344",15
from test phone
Sending Data to nRF Connect Application
Step 1: Use QCOM tool to send the following command.
AT+QBLEGATTCWRCMD=0,"3344","write to test phone"
OK
Step 2: The received data is displayed in the Value field of the Unknown Characteristic with UUID 0x3344 in the nRF Connect application, as shown in the figure below.

Dual-Role Device
When the module is operating as a peripheral device, it can be connected by a central device and can be connected by two central devices at most simultaneously. When the module is operating as a central device, it can connect a peripheral device and can connect three peripheral devices at most simultaneously.
AT+QBLEINIT=4,1 // Set the module as a dual-role device for initializing BLE.
OK
AT+QBLEGATTSSRV="FFF1" // Establish a BLE service and set the service UUID to "FFF1".
OK
AT+QBLEGATTSCHAR="FFF2" // Set characteristic UUID to "FFF2".
OK
AT+QBLEGATTSCHAR="FFF3" // Set characteristic UUID to "FFF3".
OK
AT+QBLEGATTSSRVDONE // Complete the BLE service establishment.
OK
AT+QBLENAME="QuecHCM511S" // Set BLE device name to "QuecHCM511S".
OK
AT+QBLEADDR? // Query BLE device address.
+QBLEADDR: "3333353294"
OK
AT+QBLEADVPARAM=150,150 // Set BLE advertising parameters.
OK
AT+QBLEADVSTART // Start BLE advertising.
OK
+QBLESTAT: CONNECTED // Connect a central device.
+QBLEPEERINFO: 0,0,"54F967E82874" // The peer device information, including the index, role and MAC address.
+QBLEMTU: 247 // MTU is 247 bytes.
+QBLEPEERINFO: 0,0,"54F967E82874" // The peer device information, including the index, role and MAC address.
AT+QBLESCAN=1 // Enable BLE scan.
OK
+QBLESCAN: "Simple_Peripheral",1,"CC3732356583" // The target peripheral device is scanned.
AT+QBLESCAN=0 // Disable BLE scan.
OK
AT+QBLECONN=1,"CC3732356583" // Connect a peripheral device.
OK
+QBLESTAT: CONNECTED // Successfully connection.
+QBLEPEERINFO: 1,1,"CC3732356583" // The peer device information, including the index, role and MAC address.
+QBLEMTU: 247 // MTU is 247 bytes.
+QBLEPEERINFO: 1,1,"CC3732356583" // The peer device information, including the index, role and MAC address.
+QBLEINFO: "2AC9" // Service UUID of the peer device.
+QBLEINFO: "0783B03E8535B5A07140A304D2495CB8" // Service UUID of the peer device.
+QBLEINFO: "0783B03E8535B5A07140A304D2495CBA" // Service UUID of the peer device.
+QBLEINFO: "FFF3" // Service UUID of the peer device.
+QBLEINFO: "DOWN" // Completion of discovering the peer device service.
AT+QBLEGATTSNTFY=0,"FFF3","FROM BLE MASTER" // Send data to the target central device when the module is operating as a peripheral device.
OK
AT+QBLEGATTCWRCMD=2,"FFF2","from HCM511S" // Send data to the target peripheral device when the module is operating as a central device.
OK
AT+QBLEDISCONN=0 // Disconnect the Bluetooth connection of the specific device.
OK
+QBLESTAT: DISCONNECTED // Successful disconnection.
+QBLEPEERINFO: 0,0,"54F967E82874" // The peer device information, including the index, role and MAC address.
Appendix References
Terms and Abbreviations:
| Abbreviation | Description |
|---|---|
| BLE | Bluetooth Low Energy |
| DCE | Data Circuit-terminating Equipment |
| DTE | Data Terminal Equipment |
| GATT | Generic Attribute Profile |
| ID | Mostly refers to Identifier in terms of software |
| MAC | Medium Access Control |
| MT | Mobile Terminal |
| MTU | Maximum Transmission Unit |
| RI | Ring Indicator |
| URC | Unsolicited Result Code |
| UUID | Universally Unique Identifier |