Unsuccessful BLE connects make BLE stack instable

#1

Hello all,

I have an ESP32 which must be connected to 4 peripherals permanently (at least most of the time). Because these peripherals can loose connection from time to time, it must be absolutely sure, that they reconnect reliably again, as soon as they are ready again.
To test this behavior, my peripherals disconnect BLE every 3 minutes (after time of connection) and so initiate a new connection from the ESP32.
The ESP32 knows the addresses of the 4 peripherals and tries to establish a connection each time, if one or more of them is/are not connected anymore.
It obviously happens, that such a reconnect fails and so it must be tried again. After such unsuccessful tries, the ESP32 starts to not connect to available peripherals anymore, which do advertise and are connectable from other central devices (cell phone).
Has anybody seen such behaviour or knows how to prevent from this failures?

Kind regards
Rolf

#2

Not me
Do you have a BLE sniffer to trace what is going on ?
I educatedly guess the ESP32 is the client here, what is your code, what are you doing ?
What happens when the peripherals disconnect ? Do you get an error code somewhere ?
When you can’t connect, do you check for function call response values ? Any clues ?
Do you see anything in the log ? Did you raise the debug level ?
Since Mongoose-OS is mostly a wrapper here, it is probable that you’ll have to work your way with Espressif’s IDF.

#3

Hi Scaprile,
Sorry about my delay, I have a lot of jobs right now!
Most likely, it is my own fault: During a (unsuccessful) connect, I did not wait long enough to get the disconnect event. So I tried to start a new connect while the old was still running. And MOS does really not like this.
Thanks for your help!
Kind regards
Rolf