软件:本地编译的支持经典蓝牙的 AT 固件
版本信息如下:
Code: Select all
AT+GMR
AT version:2.2.0.0(4bfff91 - ESP32 - Aug 19 2021 08:17:22)
SDK version:v4.2.2-76-gefa6eca8b8-dirty
compile time(7135f05):Aug 23 2021 17:05:16
Bin version:2.2.0(WROOM-32)
OK
ESP32 作 master 设备,可以扫描到手机蓝牙设备,但是有时候无法连接成功,直接返回 ERROR,不知道具体的原因是什么。
测试 AT 序列如下:
Code: Select all
AT+BTINIT=1
OK
AT+BTNAME?
+BTNAME:esp32-bt-test
OK
AT+BTSCANMODE=2
OK
AT+BTSTARTDISC=0,10,10
+BTSTARTDISC:"9c:5a:81:18:2e:c7",,0x2,0x3,0x2d0,-85
+BTSTARTDISC:"44:17:93:58:6e:fa",ESP_SPEAKER,0x4,0x5,0x120,-53
+BTSTARTDISC:"7c:2a:db:7f:bf:f4",Tony鐨凪i 10 Ultra,0x2,0x3,0x2d0,-67
+BTSTARTDISC:"44:17:93:58:6e:fa",ESP_SPEAKER,0x4,0x5,0x120,-61
+BTSTARTDISC:"44:17:93:58:6e:fa",ESP_SPEAKER,0x4,0x5,0x120,-60
+BTSTARTDISC:"88:f8:72:82:b4:a0",mali_phone,0x2,0x3,0x2d0,-32
+BTSTARTDISC:"44:17:93:58:6e:fa",ESP_SPEAKER,0x4,0x5,0x120,-65
+BTSTARTDISC:"44:17:93:58:6e:fa",,0x4,0x5,0x120,-64
+BTSTARTDISC:"7c:2a:db:7f:bf:f4",Tony鐨凪i 10 Ultra,0x2,0x3,0x2d0,-71
+BTSTARTDISC:"44:17:93:58:6e:fa",ESP_SPEAKER,0x4,0x5,0x120,-55
+BTSTARTDISC:"44:17:93:58:6e:fa",ESP_SPEAKER,0x4,0x5,0x120,-60
+BTSTARTDISC:"44:17:93:58:6e:fa",,0x4,0x5,0x120,-60
+BTSTARTDISC:"44:17:93:58:6e:fa",ESP_SPEAKER,0x4,0x5,0x120,-65
+BTSTARTDISC:"44:17:93:58:6e:fa",ESP_SPEAKER,0x4,0x5,0x120,-62
+BTSTARTDISC:"44:17:93:58:6e:fa",ESP_SPEAKER,0x4,0x5,0x120,-59
+BTSTARTDISC:"44:17:93:58:6e:fa",ESP_SPEAKER,0x4,0x5,0x120,-53
+BTSTARTDISC:"44:17:93:58:6e:fa",ESP_SPEAKER,0x4,0x5,0x120,-53
+BTSTARTDISC:"7c:2a:db:7f:bf:f4",,0x2,0x3,0x2d0,-75
+BTSTARTDISC:"7c:6b:9c:06:c9:56",,0x2,0x3,0x2d0,-88
OK
AT+BTSPPINIT=1
OK
AT+BTSPPCONN=0,0,"88:f8:72:82:b4:a0"
ERROR