Is there a way to set MTU for BLE communication on Arduino Nano IoT

I am using BLE to communicate with my Arduino Nano IoT 33.
I declared my SctringCharacteristic with the size of 200.

BLEStringCharacteristic stringCharacteristic(CHARACTERISTIC_UUID, BLERead | BLEWrite, 200);

However if I send a string longer than 20 bytes the Arduino stops responding. I assume it is because of the default MTU size of 23 bytes.
Is there a way to increase MTU on this model to be more than 23 bytes? I know one can do it on ESP32,

BLEDevice.setMTU(uint16_t mtu);

but I cannot find the way for Arduino.

Why do you have a 200 character string characteristic? Do you have a unique case where you need such a long strings do you try to replicate some old serial behavior to send data as string instead of the data itself?

Do you know how GATT works and how you can create characteristics with real data types?

Yes, I know about characteristics of different data types and GATT.
I want to use one 200 bytes string because it is the best approach for my project.
Thank you

OK, fair enough.

I suspect I have some bad news for you. I had a look into the ArduinoBLE source code and found multiple locations where mtu is set to 23 and I found a _maxMtu(23) in the ATTClass.

Thank you Klaus

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.