Page 1 of 1

Bluetooth (BLE) GATT errors when BLE Signal is weak

Posted: Mon Jul 20, 2020 8:56 pm
by plajjd
We have a product based on the ESP32-WROOM-32 that includes both ESP-NOW WiFi among many nodes, and a Bluetooth (BLE) link to an iPad.

In normal usage, we have around 25K of "free" RAM. However, when the BLE signal strength to the iPad is weak, our available RAM drops to almost 0 while transmitting BLE packets.

Also, when the BLE signal strength is weak, the ESP32 reports BT_GATT: No resources on the serial console.

It appears that the weak BLE signal strength causes the ESP to use up RAM. I assume this is due to BLE packets being queued in RAM because they cannot be sent at a high enough baud rate.

In addition, when BLE signal strength is weak, I find that my WiFi protocol (based on ESP-NOW) misses packets - even when we add many retries. It appears that WiFi is being starved and that the BLE module is consuming most of the radio time.

Questions: Is it possible to query the number of BLE messages waiting to be sent? For instance, I would like to stop adding new BLE packets to the transmit queue, if the BLE task cannot keep up.

Also, is it possible to keep the BLE task from starving the WIFi receive?

And are there any more suggestions on how to handle weak BLE signal strength so that it does not use up all RAM and starve WiFi?

Thanks!