NimBLE MTU Size Issue

ZainNoman
Posts: 3
Joined: Tue Dec 20, 2022 3:10 pm

NimBLE MTU Size Issue

Postby ZainNoman » Tue Dec 20, 2022 3:48 pm

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.

irahul
Posts: 46
Joined: Fri Jun 18, 2021 10:07 am

Re: NimBLE MTU Size Issue

Postby irahul » Tue Dec 27, 2022 5:10 am

Is exchange MTU procedure being done ? If yes, then what is the value being negotiated in it ?

ZainNoman
Posts: 3
Joined: Tue Dec 20, 2022 3:10 pm

Re: NimBLE MTU Size Issue

Postby ZainNoman » Tue Dec 27, 2022 5:50 am

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

irahul
Posts: 46
Joined: Fri Jun 18, 2021 10:07 am

Re: NimBLE MTU Size Issue

Postby irahul » Tue Dec 27, 2022 11:32 am

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

ZainNoman
Posts: 3
Joined: Tue Dec 20, 2022 3:10 pm

Re: NimBLE MTU Size Issue

Postby ZainNoman » Tue Dec 27, 2022 11:50 am

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
image (3).png (53.52 KiB) Viewed 3100 times

Who is online

Users browsing this forum: benrank, MicroController and 113 guests