Strange behavior regarding Classic Bluetooth reconnection
Posted: Sun Dec 22, 2024 2:18 pm
Hello,
I am currently using the esp32-pico-v3-02 chip, and I’ve implemented similar functionality on both the Arduino IDE and esp-idf. However, there’s a common issue I’m experiencing, so I’d like to inquire about it. I’ll refer primarily to the Arduino IDE code. By default, the chip is operating in Bluetooth dual-mode.
1) After performing a BLE scan, it becomes unstable when I try to use Bluetooth classic (SPP). I have to call esp.restart() to get it to work stably. Is this normal? or is there any other way to make it work stable without reset?
2) In my usage scenario, the Android device turns off its bluetooth and turns on after 2 seconds. After these 2 seconds, ESP tries to reconnect.
However, it takes a very long time to reconnect in this work flow. Combining serialBT.end(), .flush(), ESP.restart(), etc. can shorten this time somewhat, but not by much. If I do a hard reset, it reconnects almost immediately.
So my questions is, does ESP.restart() fully clear all its memory or not? Is there any way to resolve this issue?
Thank you in advance.
I am currently using the esp32-pico-v3-02 chip, and I’ve implemented similar functionality on both the Arduino IDE and esp-idf. However, there’s a common issue I’m experiencing, so I’d like to inquire about it. I’ll refer primarily to the Arduino IDE code. By default, the chip is operating in Bluetooth dual-mode.
1) After performing a BLE scan, it becomes unstable when I try to use Bluetooth classic (SPP). I have to call esp.restart() to get it to work stably. Is this normal? or is there any other way to make it work stable without reset?
2) In my usage scenario, the Android device turns off its bluetooth and turns on after 2 seconds. After these 2 seconds, ESP tries to reconnect.
However, it takes a very long time to reconnect in this work flow. Combining serialBT.end(), .flush(), ESP.restart(), etc. can shorten this time somewhat, but not by much. If I do a hard reset, it reconnects almost immediately.
So my questions is, does ESP.restart() fully clear all its memory or not? Is there any way to resolve this issue?
Thank you in advance.