taks / esp32-nimble

A wrapper for the ESP32 NimBLE Bluetooth stack.
Apache License 2.0
118 stars 35 forks source link

Allow more connections for ESP32-C3 #69

Closed ChocolateLoverRaj closed 9 months ago

ChocolateLoverRaj commented 10 months ago

Without these changes, I can only have 1 connection. With these changes, I can have at least 4. Tested on an ESP32-C3 Super Mini

Related to #63

taks commented 10 months ago

The default configuration of max connections is 3.

In #63, disconnect and connect are repeated, and some are not disconnected. Therefore, the number of connections is increasing and error is occurring.

ChocolateLoverRaj commented 9 months ago

@taks I tried out the latest code, and multiple devices works. But why not max out the maximum connections to 9 instead of 3?

oleander commented 9 months ago

The average ESP will likely have difficulties handling nine concurrent connections + WiFi. When you use up the resources of the ESP, it starts to behave unpredictably, which is very difficult to debug. Setting the limit lower prevents this and prints a proper error message when the limit is reached