NimBLE-Arduino icon indicating copy to clipboard operation
NimBLE-Arduino copied to clipboard

ACL buffer cannot be changed; and enables broken MTUs as client

Open VisaJE opened this issue 3 months ago • 1 comments


/** @brief ACL Buffer size */
#define CONFIG_BT_NIMBLE_TRANSPORT_ACL_SIZE 255

In nimconfig.h this variable is not guarded, so it cannot be redefined in compile flags. I would like to understand why?

I have a problem with esp32dev and esp32-s3 platforms working as BLE clients: By setting #define CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU 512 and calling NimBLEDevice::setMTU(CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU) I enable receiving notifications longer than the default 255, but the bytes in the notifications are nonsense beyond 255 (mostly nulls).

NimBLE version is 2.3.6, also tested 1.4.3.

I manually hacked #define CONFIG_BT_NIMBLE_TRANSPORT_ACL_SIZE 512 in the nimconfig.h and the packets seem to come through correctly.

Interestingly these issues do not exist on server side: I have another esp32-s3 communicating with the MTU==512, and at least Android platforms receive all data without issue.

VisaJE avatar Sep 23 '25 12:09 VisaJE

The fix is in the master branch, though it should be made automatic, which I will add later. https://github.com/h2zero/NimBLE-Arduino/blob/5dad8939fbea864857a009b6a4936028a7179057/src/syscfg/syscfg.h#L1394

h2zero avatar Sep 24 '25 01:09 h2zero