Hi Dmitry
Thanks for reminding me. In your log, the disconnect is triggered on the BTstack side, which means by the stack itself or your code.
The HCI Disconnect on Idle should not happen and also logs L2CAP_EVENT_TIMEOUT_CHECK, which is not in the log.
I have no experience with using Arduino for the ESP32.
Could you verify that spp_counter works without problems when using port/esp32 directly with ESP-IDF?
Other than that, please add a log_info to gap_disconnect(..) to log if it gets called, which I expec. Now, please find out who calls gap_disconnect.
You can also run BTstack on a desktop system (mac,linux,windows) with an USB Dongle. You might even flash an ESP32 with an HCI firmware, but that's extra work.
Cheers
Matthias
> On 14 Feb 2026, at 23:36, Dmitry Akulov <
pink0d...@gmail.com> wrote:
>
> Hi Matthias !
> To view this discussion visit
https://groups.google.com/d/msgid/btstack-dev/00f03b13-7a20-4390-a974-81bf13e86f2dn%40googlegroups.com.