-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Rework max connections for BLE to avoid exceeding the hard limit #8303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Raise a validation error if the number of clients exceeds the max connections instead of failing at run time on the device - Allow setting max_connections for esp32_ble_tracker (total) IDF max: 9 arduino max is hard coded to 3 and not adjustable - Allow setting max_connections for bluetooth_proxy fixes esphome/issues#6553
The error message is a little bit strange
|
and it does not work even if I reduce number of connectinos
|
You need to increase the I improved the error message
|
In your case I think you will need to set |
one more attempt to improve the error. Example with setting max_connections to 1 and than trying to use 4 connections (default of 3 for the proxy and 1 for the ble_client) Exceeded |
10000
Hey there @buxtronix, @clydebarrow, mind taking a look at this pull request as it has been labeled with an integration ( |
Tagged this as next month we plan on being able to switch BLE scanners from passive to active at run time (and report current state) and I'd prefer not to have this change in the same release. More details https://ptb.discord.com/channels/330944238910963714/1346947687718850721/1354832140247892100 |
Thanks |
What does this implement/fix?
Check that the configured total number of connections slots needed for BLE devices does not exceed the device hard limit.
Fix can be tested with 2025.2.2+
This is a breaking change because previously configuration would validate even though it would run out of slots at runtime. On IDF we will do our best to mitigate that so the user does not likely have to do anything (see below) by automatically increasing the value to match. This is not possible on arduino since its hard coded to 3.
max_connections
foresp32_ble_tracker
(total)connection_slots
forbluetooth_proxy
IDF users that exceed the configured limit will get warning that the limit was automatically increased unless they exceed the 9 slot hard limit
WARNING esp32_ble_tracker exceeded
max_connections: components attempted to consume 5 connection slot(s) out of available configured maximum 3 connection slot(s); The system automatically increased
max_connectionsto 5 to match the number of used connection slot(s) by components: ble_client, bluetooth_proxy, bluetooth_proxy, bluetooth_proxy, bluetooth_proxy.
ARDUINO users will get an error if they exceed the 3 slot hard limit since we cannot adjust the upward limit
esp32_ble_tracker exceeded
max_connections: components attempted to consume 4 connection slot(s) out of available configured maximum 3 connection slot(s); Decrease the number of BLE clients (ble_client, bluetooth_proxy, bluetooth_proxy, bluetooth_proxy) to stay under the 3 connection slot(s) limit.
If the hard limit is exceeded, we raise a validation error if the number of clients (number of
ble_client
+ configuredbluetooth_proxy
connection_slots
) exceeds the hard limit of the currently used framework.Types of changes
Related issue or feature (if applicable):
Pull request in esphome-docs with documentation (if applicable):
Test Environment
Example entry for
config.yaml
:Exceeded
max_connections
: Components attempted to consume 4 slot(s) out of available configured maximum 1 connection slot(s); Decrease the number of BLE clients (ble_client,bluetooth_proxy,bluetooth_proxy,bluetooth_proxy) or increasemax_connections
to 4.Checklist:
tests/
folder).If user exposed functionality or configuration variables are added/changed: