esp-at
esp-at copied to clipboard
Allow scanning in BLEINIT 2 (dual role)
Is your feature request related to a problem?
When I don't advertise I should be able to scan for BLE devices.
Currently I have reboot to change between AT+BLEINIT=2 and AT+BLEINIT=1 just to start scanning.
Describe the solution you'd like.
No response
Describe alternatives you've considered.
No response
Additional context.
No response
tested with ESP32-WROOM-32-AT-V2.4.0.0
@mrx23dot could you please describe what you need in details, thanks.
AT+RST
OK
ready
AT+BLEINIT=2
OK
// no connection/advertising at this time
AT+BLESCAN=1,3
ERROR
I don't want to reboot just to do a scan in AT+BLEINIT=1
@Luxin812 PTAL
@mrx23dot This function will be supported recently, if there is an update, we will let you know the result as soon as possible.
@mrx23dot This function will be supported recently, if there is an update, we will let you know the result as soon as possible.
Is this fixed in v4? At least add a command to exit BLEINIT mode, so we could switch to other mode without rebooting.
After the initialization, the Bluetooth LE role cannot be changed unless you run [AT+RST](https://docs.espressif.com/projects/esp-at/en/latest/esp32/AT_Command_Set/Basic_AT_Commands.html#cmd-rst) to restart the system first and then re-initialize the Bluetooth LE role.
What's the point of AT+BLEINIT=0 deinit then?
@mrx23dot After the device initializes BLE, it can execute AT+BLEINIT=0 to deinit. AT+RST is not required. Please see the log below for specific operations. Can you provide your firmware and AT execution log?
[16:13:16:598] AT+RESTORE␍␊
[16:13:17:184] ␍␊
[16:13:17:184] OK␍␊
[16:13:18:395] ␍␊
[16:13:18:395] ready␍␊
[16:13:23:166] AT+BLEINIT=2␍␊
[16:13:23:253] ␍␊
[16:13:23:253] OK␍␊
[16:13:33:097] AT+BLEINIT=0␍␊
[16:13:33:336] ␍␊
[16:13:33:336] OK␍␊
[16:13:40:169] AT+GMR␍␊
[16:13:40:192] AT version:4.1.0.0-dev(f3c1850 - ESP32C3 - Feb 5 2024 10:09:06)␍␊
[16:13:40:192] SDK version:v5.0.4-dirty␍␊
[16:13:40:192] compile time(9061bdb3):Feb 5 2024 13:51:36␍␊
[16:13:40:192] Bin version:v3.2.0.0(MINI-1)␍␊
[16:13:40:192] ␍␊
[16:13:40:192] OK␍␊
As title says
Allow scanning in BLEINIT=2
BLEINIT=2
BLEINIT=0
BLEINIT=1
changing modes takes long time, it hurts responsiveness of final product, (when broadcasting and searching iterated) and sometimes BLEINIT=0 even reboots the ESP32! (getting ready msg)
tested with
AT+GMR
AT version:3.1.0.0-dev(s-bd890df - ESP32 - May 12 2023 08:47:33)
SDK version:v5.0-541-g885e501d99
compile time(c5af3bc):May 15 2023 12:00:57
Bin version:2.5.0(WROOM-32)
v4 is not released yet to many boards.
After stopping ble broadcast and scanning (if there is a BLE connection, you need to execute the AT+BLEDISCONN command to disconnect the BLE connection) and then execute the AT+BLEINIT=0 command, the crash will not occur.
In the future, the device will be able to scan as a BLE server.