0% found this document useful (0 votes)
12 views12 pages

Hardwares Guides About Bluetooth and Poe

The document provides detailed information on the AT commands and parameters for a Bluetooth module, including pin functions, default parameters, and command parsing. It outlines various commands for managing Bluetooth connections, querying device information, and configuring settings. Examples of command usage and expected results are included to assist users in operating the module effectively.

Uploaded by

Himone
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views12 pages

Hardwares Guides About Bluetooth and Poe

The document provides detailed information on the AT commands and parameters for a Bluetooth module, including pin functions, default parameters, and command parsing. It outlines various commands for managing Bluetooth connections, querying device information, and configuring settings. Examples of command usage and expected results are included to assist users in operating the module effectively.

Uploaded by

Himone
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

AT Instruction and

Examples

1 / 12
1 Pin function
PIN Type Description

Data output end


P0.03 TXD

Data entry terminal


P0.06 RXD

Module slave role connection status: high level when unconnected, low level
P0.26 GPIO when connected

Enable status of sending data from slave role: High level is not enabled, low
P0.27 GPIO level is enabled

Module host role connection status: High level when disconnected, low level
P0.28 GPIO when connected

Module host role connection status: High level is not enabled, low level is
P0.29 GPIO enabled

Module serial port BUFFER Indicates the cache tension status: high level
P0.30 GPIO when no tension, low level when tension

2 Default parameters
2.1 Bluetooth Default parameters
Name of advertising::nRF52

Transmission power:0dBm

Advertising interval:100ms

State of advertising: Open

serial port state: Open

2 / 12
2.2 Serial port Default Parameters
Baud rate:115200 bps

PIN: TX:P0.06 RX:P0.03

Data bits:8 bit

Parity bit: No

Stop bit:1

Flow control:No

3 Bluetooth broadcast data parsing

Len Type Value Describe

2 0x01 0x06

0x11310121CA6CF39B CoID(4 bytes)+0x0121+mac address


10 0xFF
EC38

17 0X09 0x6E52463532 Bluetooth name

0x9ECADC240EE5A9E
11 0x07 UUID
093F3A3B50100406E

3 / 12
4 Bluetooth AT Command parsing
4.1 AT Command format
The Command string consists of five parts: Command header, Command, parameter connector,

[parameter], and terminator. The Command header is "AT+" or "AT? , the parameter concatenator is

"=", and the end character is "\r\n". The parameter concatenator and parameter are optional (either with

or without parameters). If the Command string contains parameters, it indicates that the Command is

set; if it does not, it indicates that the Command is queried.

Note: Serial port data 20ms as a frame of data timeout, AT Command recognized as “AT+“ or

“AT?”Error ([AT]ER, correct [AT]OK); error ([AT]ER); After a master and(or) slave connection is made,

the AT command is still recognized and does not act as passthrough data. If the AT+ or AT? At the

beginning, it is regarded as transparent data for forwarding

举例/For example:

Sets the broadcast interval command:AT+ADVINTVL=1000\r\n

Query broadcast interval instruction:AT+ADVINTVL\r\n

4 / 12
4.2 General command
4.2.1 Get AT commands help:AT?

Command
Example Possible results returned Explain

Gets all

command sets

supported by the
AT? AT?\r\n
module

4.2.2 Show Firmware version:AT+VER


Command Example Possible results returned Explain

Obtain
[AT]OK
AT+VER AT+VER\r\n the module firmware version
[DA]B0171,V1.22,May 5 2022 17:29:10
information

4.2.3 Get device MAC address:AT+MAC


Command Example /Possible results returned Explain

[AT]OK Get the


AT+MAC AT+MAC\r\n
[DA]DD:C6:3A:0A:5A:AD Bluetooth MAC address

5 / 12
4.2.4 Get peer device MAC address when in connection:AT+PEER

Command
Example Possible results returned Explain

Unconnected device:

[AT]OK The return result is:

[DA]00:00:00:00:00:00,00:00:00:00:00:00 Connect the MAC of the


AT+PEER AT+PEER\r\n
Connected devices: master device of the module

[AT]OK and the MAC of the slave

[DA]41:7B:E0:22:BE:CD,CA:6C:F3:9B:EC:38 device of the module.

If there is no primary or

secondary connection, the

default reply is

00:00:00:00:00:00

4.2.5 Reset the module by software:AT+RESET


Command Example Possible results returned Explain

[AT]OK Reset the


AT+RESET AT+RESET\r\n
Started! Bluetooth module

4.2.6 Restore factory parameters:AT+FACTORY


Command Example Possible results returned Explain

Restore the module to its


AT+FACTORY AT+FACTORY\r\n [AT]OK factory Settings

6 / 12
4.2.7 Store current parameters to FLASH:AT+SAVE

Possible results returned


Command Example Explain

After this parameter is set, the current

parameter Settings will be the same before the

next restart (except factory default Settings).


AT+SAVE AT+SAVE\r\n [AT]OK

4.2.8 Get current parameters:AT+STATUS

Possible results returned


Command Example Explain

Baud rate, Bluetooth name, broadcast switch

AT+STATUS\r\ [AT]OK status, broadcast interval,


AT+STATUS
n [DA]115200,nRF52,1,100,0 transmission power

4.2.9 Get BLE working state:AT+WSTA

Possible results returned


Command Example Explain

1、

[AT]OK

[DA]adv,idle
AT+WSTA AT+WSTA\r\n
2、
Parameter 1 indicates the working status of
[AT]OK
the active role.
[DA]conn,conn
Parameter 2 indicates the working status of

the active role

7 / 12
4.2.10 Connect a peripheral via MAC address:AT+CON_MAC
Connect to a peer Bluetooth device:AT+CON_MAC=MAC address\r\n

Possible results returned


Command Example Explain

1. Command error: [AT]ER


2. Scan timeout: [AT]OK
[DA]Connecting
[DA]Timeout
3. Connection successful:
[AT]OK
[DA]Connecting
AT+CON_MAC=CA:6C:
AT+CON_MAC [DA]Connected=CA:6C:F3:9B:EC:38
F3:9B:EC:38\r\n Using MAC connection
4. Connection fail:
[AT]OK
[DA]Connecting
[DA]Connected=CA:6C:F3:9B:EC:38
[DA]Disconnected=CA:6C:F3:9B:EC:38

4.2.11 Connect a peripheral via device name: AT+CONNECT

Possible results returned


Command Example Explain

1. Command error:
[AT]ER
2. Scan timeout:
[AT]OK Returns the MAC of the
AT+CONNECT AT+CONNECT=nRF52
[DA]Connecting connection

[DA]Timeout
. 3. Connection successful:
[AT]OK

8 / 12
[DA]Connecting
[DA]Connected=CA:6C:F3:9B:EC:38
. 连接失败/Connection fail:
[AT]OK
[DA]Connecting
[DA]Connected=CA:6C:F3:9B:EC:38
[DA]Disconnected=CA:6C:F3:9B:EC:
38

4.2.12 Disconnect to peer device when in connection : AT+DISCON


AT+DISCON=m/s\r\n m:Master role s: Slave role

Command Possible results returned


Example Explain

1. Successfully set: [AT]OK

[DA]Disconnected=CA:6C:F3:9B:EC:38

[DA]Connected=4E:65:41:C9:62:03

[AT]OK
AT+DISCON AT+DISCON=m/s\r\n
[DA]Disconnected=4E:65:41:C9:62:03

2. Setup failed: [AT]ER

4.2.13 Set Radio TX power in dBm unit:AT+TXPWR

Possible results returned


Command Example Explain

Set transmitting
AT+TXPWR=param\r\n Param:
AT+TXPWR [AT]ER or [AT]OK power
{8,7,6,5,4,3,2,0,-4,-8,-12,-16,-20}

9 / 12
4.2.14 Setting device's name:AT+DEV_NAME

Possible results returned


Command Example Explain

Length of name less than 14


AT+DEV_NAME AT+DEV_NAME=SKY\r\n [AT]ER or [AT]OK

4.2.15 Setting broadcast interval in ms unit:AT+ADVINTVL

Possible results returned


Command Example Explain

AT+ADVINTVL AT+ADVINTVL=500\r\n [AT]ER or [AT]OK Range:20ms~5000ms

4.2.16 Start or stop advertising if in a right time: AT+ADV

Scan and output BLE devices through serial ports, up to 100 devices can be output.

Possible results returned


Command Example Explain

start:open the adv


AT+ADV AT+ADV=stop\r\n [AT]ER or [AT]OK
stop:stop the adv

10 / 12
4.2.17 Start a procedure for updating PHYs mode : AT+BLE5_REQ

Set the physical characteristic of Bluetooth transmission (the same parameters must be set for the master

and slave)

Possible results returned


Command Example Explain

1、The

command or parameter

Master role: is incorrect:

AT+BLE5_REQ=m,phy1m\r\n [AT]ER P1 = m/s: Select slave or host


AT+BLE5_STA
Slave role: 2、The (the device initiating the

AT+BLE5_REQ=s,phy1m\r\n parameters and connection is the host)

commands are correct: P2 parameters, see the prompt

[AT]OK of AT?

4.2.18 Query currentPHYs update status AT+BLE5_STA

Possible results returned


Command Example Explain

查询连接状态,选择主机查询还是从机查询/To query the


connection status, select host or slave
1. 连接模式 p1/Connection mode p1

1、Comman error 1:PHY1M 2:PHY2M 3:Coded

[AT]ER 2. 连接状态 p2/Connection status p2

2、Comman correct 0:init; 2:unsupport update; 3:update ok


AT+ AT+BLE5_STA=s\r\n
[AT]OK 3. TX phy
1:PHY1M 2:PHY2M 4:Coded
4. RX phy
1:PHY1M 2:PHY2M 4:Coded

11 / 12
12 / 12

You might also like