<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>BLE Uart increase 20 byte limitation</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80639/ble-uart-increase-20-byte-limitation</link><description>Hello, 
 Currently I am experiencing some problem getting the NUS to send a TX notification of more than 20 bytes to the central (which is an old custom android application). From the logs on the android application side, it looks like my messages are</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 14 Oct 2021 18:38:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80639/ble-uart-increase-20-byte-limitation" /><item><title>RE: BLE Uart increase 20 byte limitation</title><link>https://devzone.nordicsemi.com/thread/334237?ContentTypeID=1</link><pubDate>Thu, 14 Oct 2021 18:38:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2cf7d43-dbf3-428e-8395-1e6861b7759b</guid><dc:creator>Jeffe</dc:creator><description>&lt;p&gt;Sorry my bad I forgot to include that information. I use the nRF5 17.0.2 SDK and the nRF5 SDK for Mesh 5.0.0, on the nrf52840&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t use the GATT library you mentioned above, as I think I mostly rely on calls to the softdevice for the NUS, or otherwise use the Mesh SDK&amp;#39;s gatt functions (mesh_gatt.c and mesh_gatt.h).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, luckily I managed to figure out the problem in the meantime.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How I solved my problem:&lt;/p&gt;
&lt;p&gt;On a hunch, I decided to&amp;nbsp; test&amp;nbsp;with the&amp;nbsp;NUS client from the&amp;nbsp;nRF Toolbox to connect to the NUS of my nrf52840 application&amp;nbsp;instead of using the existing old Android App. Curiously enough, the NUS client from the nRF Toolbox Android App **did work** somehow, which at first confused me.&lt;/p&gt;
&lt;p&gt;But I noticed that the nRF Toolbox negotiated the MTU size whereas the custom Android application did nothing in regards to the negotiating a MTU size. So I think what happened is that since my&amp;nbsp;&lt;span&gt;nrf52840&amp;nbsp;&lt;/span&gt;&lt;span&gt;application did not receive a MTU negotiation from the Central, it just assumed that the MTU size is the minimum since there was no response, despite the fact that I set&amp;nbsp;the NRF_SDH_BLE_GATT_MAX_MTU_SIZE&amp;nbsp;&amp;nbsp;to a large number.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Once I changed the custom android application&amp;#39;s code to request a MTU size (where before it did nothing of the sort), before discovering services, I was able to send more than 20 bytes.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I said in the openning post that there was no issue with the Android Application, but it seemed like my assumption was wrong. I was lead astray and made that wrong assumption because I knew the raspberry Pi BLE peripheral with the NUS service worked (and still works now) with the custom Android application just fine. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Now the real mystery is why the raspberry Pi was able to work despite not receiving a negotiation from the central about the MTU size. I am not familiar with the codebase running on the raspberry Pi I mentioned so this may stay a mystery forever heheh.&lt;/span&gt;&lt;/p&gt;
&lt;p style="text-align:center;"&gt;&lt;span&gt;&lt;/span&gt;------------------------------------------------&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So TLDR; custom android application does not request an MTU size, so due to the lack of such negotiation from the BLE central, the SDK&amp;nbsp; probably just assumed the minimum ATU size for BLE communication&amp;nbsp;(I think?, not 100% sure but this is the most reasonable conclusion I can think of).&amp;nbsp; Solved it by making sure the central (the custom Android App) requests a MTU size upon connection and before discovering services.&amp;nbsp;Correct me if I am wrong about that assumption about the SDK.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you for your very prompt reply and support!&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Uart increase 20 byte limitation</title><link>https://devzone.nordicsemi.com/thread/334190?ContentTypeID=1</link><pubDate>Thu, 14 Oct 2021 13:41:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38737e5a-eeb3-4aa3-8e9f-0694284db508</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Could you enable logging in the &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_ble_gatt.html"&gt;GATT module&lt;/a&gt; and print the debug logs from the device? It will give information about the MTU request/response after connection between the central and peripheral is established.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Uart increase 20 byte limitation</title><link>https://devzone.nordicsemi.com/thread/334170?ContentTypeID=1</link><pubDate>Thu, 14 Oct 2021 13:03:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3edec84d-1058-4a27-9b26-a3e463d36f28</guid><dc:creator>Marjeris Romero</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Which SDK and what version are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>