Page 1 of 1
NimBLE MTU Size Issue
Posted: Tue Dec 20, 2022 3:48 pm
by ZainNoman
I cant seem to increase the MTU size in NimBLE. the longest data i can receive is 271 byte. Ive slightly altered the spp_server example. i am printing the length and received data in the function
ble_svc_gatt_handler
. I have incresed the
CONFIG_BT_NIMBLE_ATT_PREFERRED_MTU
to 512. I am using nRF Connect as gatt client and I have set the MTU Size from there as well as can be seen in the snapshot of the logs attached.
Re: NimBLE MTU Size Issue
Posted: Tue Dec 27, 2022 5:10 am
by irahul
Is exchange MTU procedure being done ? If yes, then what is the value being negotiated in it ?
Re: NimBLE MTU Size Issue
Posted: Tue Dec 27, 2022 5:50 am
by ZainNoman
Yes, Im setting the MTU Size to 512 using the NRF connect app. Then I send a 512 byte (or a little smaller) text string. Only 271 bytes are received
Re: NimBLE MTU Size Issue
Posted: Tue Dec 27, 2022 11:32 am
by irahul
You can check on console log ( idf.py monitor) for device side OR the nrf logger in nrfapp side. I agree that you entered 517 as value, but was that set ? If the chip side sends smaller MTU, then the final negotiated value will not be 517 , but the minimum of the size mentioned by both side.
For e.g. something like below on esp device side
I (26793) NimBLE: mtu update event; conn_handle=0 cid=4 mtu=256
Or something like below on nrfapp side
MTU changed to : 256
Re: NimBLE MTU Size Issue
Posted: Tue Dec 27, 2022 11:50 am
by ZainNoman
These were the logs i got. they do show that the MTU size was set. I was able to set to 512 only after I had altered the menuconfig
- image (3).png (53.52 KiB) Viewed 3096 times