Use 2 ESP32-C3 & ESP-AT to test the process of data transparent transmission in BLE5.0 Long Rang mode

To test BLE5.0 Long Rang mode based on AT firmware, you can use the following methods:

1、设置 BLE5.0 Coded PHY 模式

  • On the BLE client side, you can use " AT+BLESETPHY " to set the PHY mode of the current connection to Coded PHY mode.

  • On the BLE Server side, you can use the " AT+BLEADVPARAM " command to set the Coded PHY mode

2、增大 BLE RF Power

  • You can use the "AT+RFPOWER" command to set the BLE RF Power

    AT+RFPOWER=,15,15,15
    

The following will provide the AT command sequence for testing BLE5.0 Long RangCoded PHY extended broadcast data transparent transmission using 2 ESP32-C3 devices based on AT firmware

Refer to "Bluetooth LE AT Example"

BLE Server 发数据给 BLE Client 的 AT 指令序列

  • AT command sequence on BLE Server side
AT+RESTORE

AT+CWMODE=0

AT+BLEINIT=2            //ESP32-C3 初始化为 BLE Server 模式
AT+SYSMSG=7

AT+RFPOWER=,15,15,15    // 设置 BLE5.0 RF  Power

AT+BLEADVPARAM=40,40,6,0,7,0,,,3,3           // 设置 BLE5.0 扩展广播模式和 Coded PHY 模式

AT+BLEGATTSSRVCRE             

AT+BLEGATTSSRVSTART          

AT+BLEGATTSCHAR?

AT+BLEADDR?              

AT+BLEADVDATA="0201060303F0AB0409636263"               //设置 BLE 广播数据和名称

AT+BLEADVSTART           

AT+BLESPPCFG=1,1,6,1,5      //建立 BLE 连接之后设置此参数

AT+BLESPP        //在 BLE Client 端完成 0100 步骤后执行此指令

+++              //不带换行,退出 BLESPP 透传模式


insert image description here

  • BLE Client AT Command Sequence
AT+RESTORE

AT+CWMODE=0

AT+BLEINIT=1             //ESP32-C3 初始化为 BLE Client 模式

AT+SYSMSG=7

AT+RFPOWER=,15,15,15           // 设置 BLE TX power

AT+BLESCAN=1,1,2,"cbc"         //以指定 NAME 扫描 BLE 设备

AT+BLECONN=0,"7c:df:a1:a4:a0:a2"        //与指定 MAC 设置建立 BLE 连接

AT+BLESETPHY=0,3                //设置 BLE5.0 Coded PHY 模式

AT+BLEGATTCPRIMSRV=0            //GATTC 发现 BLE 连接号为 0 的基本服务

AT+BLEGATTCCHAR=0,3

AT+BLEGATTCWR=0,3,6,1,2

0100                // hex 十六进制格式输入 0100 ,不带换行

insert image description here

Test Results

insert image description here


BLE Client 发数据给 BLE Server 的 AT 指令序列

Please refer to " Establishing an SPP connection between two ESP32-C3 development boards and transmitting data in UART-Bluetooth LE transparent transmission mode "

BLE Server AT command sequence

AT+CWMODE=0

AT+BLEINIT=2                     //ESP32-C3 初始化 BLE server 模式

AT+SYSMSG=7

AT+RFPOWER=,15,15,15             // 设置 BLE RF power

AT+BLEADVPARAM=40,40,6,0,7,0,,,3,3                     //设置 BLE5.0 扩展广播模式和 Coded PHY 模式
  
AT+BLEGATTSSRVCRE           

AT+BLEGATTSSRVSTART          

AT+BLEGATTSCHAR?

AT+BLEADDR?               

AT+BLEADVDATA="0201060303F0AB0409636263"               //设置 BLE 广播数据和名称,需在 BLEADVPARAM 之后设置

AT+BLEADVSTART            

insert image description here

BLE Client AT Command Sequence

AT+CWMODE=0

AT+BLEINIT=1            //ESP32-C3 初始化 BLE Client 模式

AT+SYSMSG=7

AT+RFPOWER=,15,15,15    // 设置 BLE RF Power

AT+BLESCAN=1,1,2,"cbc"

AT+BLECONN=0,"7c:df:a1:a4:a0:a2"

AT+BLESETPHY=0,3                   //设置 BLE5.0 Coded PHY 模式

AT+BLEGATTCPRIMSRV=0

AT+BLEGATTCCHAR=0,3

AT+BLESPPCFG=1,3,5,3,7

AT+BLESPP     

+++
         

insert image description here

Test Results

insert image description here

Guess you like

Origin blog.csdn.net/Marchtwentytwo/article/details/130018903