spp_counter on ESP32 closes rfcomm channel exactly after 20 seconds timeout

15 views
Skip to first unread message

Dmitry Akulov

unread,
Jan 22, 2026, 8:03:18 AM (8 days ago) Jan 22
to btstack-dev
Hi everyone

I've been recently trying to add SPP support to my ESP32 project based on Bluepad32

So what I've done includes just adding the code from spp_counter example to the Arduino sketch. And this works, so my PC (Windows) is able to connect to the ESP32 and I'm able to send/receive text messages via the COM port.

But I've encountered a very strange behaviour of the btstack internals: every RFCOMM connection is terminated by the ESP32 exactly 20-second after opening, even if I keep sending and receiveng data packets.

I've also tested this under Linux and got the same results - so I think this timeout is somewhere in ESP32 or in btstack.

What I've found in btstack manual just tells that there're some timeouts, but it's unclear if they can be changed and what API calls need to be used. Or this is even unrelated to RFCOMM channels ?

  Single threaded design BTstack does not use or require multi-threading. It uses a single run loop to handle data sources and timers. Data sources represent communication interfaces like an UART or an USB driver. Timers are used by BTstack to implement various Bluetooth-related timeouts. For example, to disconnect a Bluetooth baseband channel without an active L2CAP channel after 20 seconds.  

Any help on solving this issue with the SPP would be appreciated.

Regards,
Dmitry

Matthias Ringwald

unread,
Jan 22, 2026, 8:45:11 AM (8 days ago) Jan 22
to btsta...@googlegroups.com
Hi Dmitry

Most timeouts are 30 seconds. The "HCI Disconnect on Idle" might be 20 seconds, but if you have an RFCOMM connection, the HCI connection isn't idle.

Please enable HCI logging (see main.c), collect the console output from start until it disconnects, use tool/creaet_packet_log.py on the text and post the *.pklg file to see what's going on.

Cheers
Matthias
> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/btstack-dev/a4f4aecc-f461-4e7e-ad4d-fdb81f705f10n%40googlegroups.com.

Dmitry Akulov

unread,
Jan 26, 2026, 7:34:03 AM (4 days ago) Jan 26
to btstack-dev
Reply all
Reply to author
Forward
0 new messages