<?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>Unable to read long characteristics when MTU is 23 bytes using nRF Connect Android APP</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/95220/unable-to-read-long-characteristics-when-mtu-is-23-bytes-using-nrf-connect-android-app</link><description>Information about my setup: 
 I&amp;#39;m working on a product using nRF52832 with SDK 17.0.2 and Softdevice s132 7.2.0. It is a custom board. 
 The default configuration (peripheral side - nRF52832 ) negotiate BLE connection parameters as follows: 
 
 MTU: 230</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 06 Jan 2023 10:03:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/95220/unable-to-read-long-characteristics-when-mtu-is-23-bytes-using-nrf-connect-android-app" /><item><title>RE: Unable to read long characteristics when MTU is 23 bytes using nRF Connect Android APP</title><link>https://devzone.nordicsemi.com/thread/403541?ContentTypeID=1</link><pubDate>Fri, 06 Jan 2023 10:03:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0069e74-98e3-4bac-8978-79ad9b165eae</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Ricardo,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You are right. The requirement is that MTU exchange is once per client. Meaning&amp;nbsp;there could be up to 2 MTU exchanges, initialize by the client on each side.&lt;/p&gt;
&lt;p&gt;However, there is another requirement from the spec:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1672998605931v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is also reflected in our API:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1672998670665v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;In this case, the phone&amp;nbsp;replied to the nRF52 with Server RX 230 in the earlier exchange and then on the 2nd exchange it request with client RX = 23 which is violating the spec.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From what I can see in the trace, the softdevice still operate normally even with this violation that it still reply with correct read response (fragmented and then re-assembled) :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1672999069997v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My understanding is that the phone had an issue interpret the response and gave GATT error.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I understand your concern that if you have no control over the peer there could be a chance that this issue may&amp;nbsp;rise and you want&amp;nbsp; to have a way to check if the peer have received the data correctly. As far as I know there isn&amp;#39;t a way to have a confirmation of a read. You can have a confirmation when you do a write (write request or write with response) but not with a read.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;What you can do is either make a server on the phone and write data from the nRF52 to the server on the phone instead of a read. Or if you want to keep it as a read, you can have an extra&amp;nbsp;characteristic on the nRF52 that the phone can write a receipt when it managed to read. It can be a hash of the data of the read for example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to read long characteristics when MTU is 23 bytes using nRF Connect Android APP</title><link>https://devzone.nordicsemi.com/thread/403486?ContentTypeID=1</link><pubDate>Thu, 05 Jan 2023 20:37:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b1d919d-6752-4d3f-8525-7660224577d4</guid><dc:creator>RRWC</dc:creator><description>&lt;p&gt;Hello Hung Bui,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m sending the sniffer trace as requested. This file contains pre-&lt;span&gt;connection&amp;nbsp;&lt;/span&gt;advertising and all data shown in the screenshots (same trace).&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/BLE_5F00_23MTU_5F00_read_5F00_fail.pcapng"&gt;devzone.nordicsemi.com/.../BLE_5F00_23MTU_5F00_read_5F00_fail.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Regarding the MTU exchange, I&amp;#39;m still a bit confused. The specification says that &lt;em&gt;the client&lt;/em&gt; should only send the MTU request once per connection. However, it was the nRF52832 that actively requested the MTU change on the first change (to 230 Bytes). Wouldn&amp;#39;t that allow the phone to request to change the MTU once during the connection even if the device already requested it once? Just for the record, actually in my app the phone is the Client (as usual the data is on the peripheral, the nRF52832). The use of the terms Client and Server in this case leaves room for ambiguous interpretations in my opinion. I would appreciate it if you confirm that the MTU should only be exchanged once regardless of the side starting the MTU update request, although this is just to better understand the specification. I don&amp;#39;t intend to change it more than once in my application, I will explain more of my test case below.&lt;/p&gt;
&lt;p&gt;Regarding my&amp;nbsp;test case, the ideal condition is when the MTU is 230 bytes and Data length is 234 bytes. This is what my device will request. However, these values ​​also depend on what the phone and its BLE stack decide. What I really want to test is if data transfer, internal data update and overall device operation are OK in case of 23 byte MTU and 27 byte data length being selected by the Central. I have no need nor intention to explicitly change the MTU to 23 bytes, but I would like to check compatibility with phones selecting this MTU even when the peripheral configuration allows a higher MTU.&lt;/p&gt;
&lt;p&gt;Extending a little bit this explanation, this is a final product test (not a prototype). We have more freedom and control over the nRF52832 side so we prefer to fix bugs in the firmware side even if they are caused by wrong implementation in the other devices stack to ensure wide compatibility. However, our tests use the firmware as close to the final version as possible (exactly the same for most tests). We want to test that the final firmware version will correctly handle the 23 byte MTU request from the master with the current configuration and not to change the configuration on the nRF52832 side to test and send a different configuration to the field. Also, if the phone is able to send this request once even after the device changed the MTU before we&amp;#39;ll look for a way to keep things working even in that scenario, if possible.&lt;/p&gt;
&lt;p&gt;Thank you in advance,&lt;/p&gt;
&lt;p&gt;Ricardo.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to read long characteristics when MTU is 23 bytes using nRF Connect Android APP</title><link>https://devzone.nordicsemi.com/thread/403348?ContentTypeID=1</link><pubDate>Thu, 05 Jan 2023 10:08:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c3a7658-2000-4d3c-a07a-e8274eeb884a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi RRWC,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for the detailed information. Could you please send us the sniffer trace files ?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I did a quick test here and found a similar issue. So that if the MTU was 23 bytes at the initial phase and the phone doesn&amp;#39;t request a change to larger one (247 in my case) the read worked fine. It&amp;#39;s what I observed in my first reply where I give an example of 100 bytes read and with the&amp;nbsp;&lt;span&gt;NRF_SDH_BLE_GATT_MAX_MTU_SIZE set to 23.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;In your case you set&amp;nbsp;NRF_SDH_BLE_GATT_MAX_MTU_SIZE to 230 I assume. And then in nRF Connect app you request an ATT MTU of 23.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;The problem of this is that the ATT_MTU request should only be sent once in a connection. In your case, the phone actually request it twice. First when connected (automatically request to 230 bytes)&amp;nbsp; and then you in the app request a 2nd one with 23 bytes. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1672913099586v5.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;This violate the Bluetooth Spec:&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1672912973532v3.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In the code for NRF52 you can find&amp;nbsp;the same requirement :&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1672912999326v4.png" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;br /&gt;You can&amp;#39;t call&amp;nbsp;sd_ble_gattc_exchange_mtu_request() twice in a connection.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;So from my point of view it&amp;#39;s a wrong implementation in the phone&amp;#39;s BLE stack that it allows att exchange to be requested twice.&amp;nbsp;&lt;br /&gt;Could you describe your use case on why you want to change the ATT MTU back to 23 bytes ?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Please be aware that ATT_MTU can only be exchanged once, but the Data length extension can be changed multiple times. If you want to limit the size of the on air packets you can change the data length instead of the ATT_MTU.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;br /&gt;Another note is that Data length usually = ATT_MTU +&amp;nbsp;4 . This is why you see 27 bytes data length when you request 23 byte ATT MTU. It&amp;#39;s due to the 4 bytes overhead on link layer.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to read long characteristics when MTU is 23 bytes using nRF Connect Android APP</title><link>https://devzone.nordicsemi.com/thread/403259?ContentTypeID=1</link><pubDate>Wed, 04 Jan 2023 20:40:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0d71a92-99d0-4149-811e-37b67dd49b6e</guid><dc:creator>RRWC</dc:creator><description>&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;font-size:inherit;"&gt;Hello Hung Bui, thank you for your reply.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;font-size:inherit;"&gt;I am in fact using NRF Connect app to test. All tests reported above where performed using the NRF Connect. This makes it easier to identify if the problem is on the nRF52832 side or on our end user APP.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;font-size:inherit;"&gt;I performed a sniffer trace as requested. I&amp;#39;ll walk through the normal behavior and the problem case described earlier using screenshots from the sniffer trace and from nRF Connect.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial, helvetica, sans-serif;font-size:150%;"&gt;Normal Behavior&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;After the connection everything runs smoothly. The screenshots bellow show normal operation&amp;nbsp;with parameters automatically negotiated between nRF52832 and a Samsung Galaxy S21 (same results with a Samsung Galaxy M51 and an Asus Zenfone Max pro M1)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;&lt;strong&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;Connection establishment and parameter negotiation&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;Below are screenshots of all parameters that have been automatically negotiated right after the connection was established.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;&lt;em&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;[Slave] Connection parameter update request. Parameters accordingly to the desired parameters informed in the first post.&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:inherit;"&gt;&lt;span style="font-family:arial, helvetica, sans-serif;"&gt;&lt;img style="max-height:620px;max-width:1459px;" height="620" src="https://devzone.nordicsemi.com/resized-image/__size/2918x1240/__key/communityserver-discussions-components-files/4/Conection_5F00_parameters.PNG" width="1459" alt=" " /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Slave] Request data length change to 234 bytes&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:536px;max-width:1430px;" alt=" " height="536" src="https://devzone.nordicsemi.com/resized-image/__size/2860x1072/__key/communityserver-discussions-components-files/4/LL_5F00_lenght_5F00_RQ.PNG" width="1430" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Master]&amp;nbsp;Reply data length update request&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:698px;max-width:1654px;" height="698" src="https://devzone.nordicsemi.com/resized-image/__size/3308x1396/__key/communityserver-discussions-components-files/4/LL_5F00_Resp.PNG" width="1654" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Slave] Request MTU change to 230 bytes&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;img style="max-height:549px;max-width:1352px;" height="549" src="https://devzone.nordicsemi.com/resized-image/__size/2704x1098/__key/communityserver-discussions-components-files/4/MTU_5F00_REQ_5F00_slave.PNG" width="1352" alt=" " /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Master] Reply MTU update request&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;img style="max-height:584px;max-width:1427px;" height="584" src="https://devzone.nordicsemi.com/resized-image/__size/2854x1168/__key/communityserver-discussions-components-files/4/MTU_5F00_RESP_5F00_1.PNG" width="1427" alt=" " /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Master] Data length update request&lt;/em&gt;. Not sure why the master decides to renegotiate data length, but I believe this is not related to the problem as everything continues to work normally after this.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:554px;max-width:1266px;" alt=" " height="554" src="https://devzone.nordicsemi.com/resized-image/__size/2532x1108/__key/communityserver-discussions-components-files/4/LL_5F00_lenght_5F00_RQ_5F00_Master.PNG" width="1266" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Slave] Request PHY change to 2 MB&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:582px;max-width:1444px;" height="582" src="https://devzone.nordicsemi.com/resized-image/__size/2888x1164/__key/communityserver-discussions-components-files/4/PHY_5F00_REQ.PNG" width="1444" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Master] 2 MB PHY accepted&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:544px;max-width:1371px;" height="544" src="https://devzone.nordicsemi.com/resized-image/__size/2742x1088/__key/communityserver-discussions-components-files/4/PHY_5F00_IND.PNG" width="1371" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Slave] Reply data length update requested by the master&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;img style="max-height:659px;max-width:1585px;" height="659" src="https://devzone.nordicsemi.com/resized-image/__size/3170x1318/__key/communityserver-discussions-components-files/4/LL_5F00_resp_5F00_2.PNG" width="1585" alt=" " /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Master] Reply parameter update request&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;img style="max-height:612px;max-width:1506px;" height="612" src="https://devzone.nordicsemi.com/resized-image/__size/3012x1224/__key/communityserver-discussions-components-files/4/Parameters_5F00_update.PNG" width="1506" alt=" " /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Slave] Parameter negotiation request. Not sure why it happens again here, but the parameters are set as desired.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:704px;max-width:1694px;" height="704" src="https://devzone.nordicsemi.com/resized-image/__size/3388x1408/__key/communityserver-discussions-components-files/4/Conection_5F00_parameters_5F00_req_5F00_2.PNG" width="1694" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Master]&amp;nbsp;Reply parameter negotiation&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:563px;max-width:1386px;" height="563" src="https://devzone.nordicsemi.com/resized-image/__size/2772x1126/__key/communityserver-discussions-components-files/4/Parameters_5F00_update_5F00_ind_5F00_2.PNG" width="1386" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Master] Connection parameters accepted&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;img style="max-height:656px;max-width:1615px;" height="656" src="https://devzone.nordicsemi.com/resized-image/__size/3230x1312/__key/communityserver-discussions-components-files/4/Parameters_5F00_accpt_5F00_2.PNG" width="1615" alt=" " /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Data&amp;nbsp;transmission with MTU 230 bytes&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;Shortly after the above negotiations ended I read some characteristics.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span style="font-family:inherit;"&gt;[Master] Read 7 byte characteristic&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span style="font-family:inherit;"&gt;&lt;img style="max-height:514px;max-width:1236px;" height="514" src="https://devzone.nordicsemi.com/resized-image/__size/2472x1028/__key/communityserver-discussions-components-files/4/Read_5F00_Req_5F00_short.PNG" width="1236" alt=" " /&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span style="font-family:inherit;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Slave] Send&amp;nbsp;7 byte characteristic data:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:568px;max-width:1298px;" alt=" " height="568" src="https://devzone.nordicsemi.com/resized-image/__size/2596x1136/__key/communityserver-discussions-components-files/4/Read_5F00_resp_5F00_short.PNG" width="1298" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Master] Read 512 byte characteristic&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:477px;max-width:898px;" height="477" src="https://devzone.nordicsemi.com/resized-image/__size/1796x954/__key/communityserver-discussions-components-files/4/read_5F00_req_5F00_long.PNG" width="898" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Slave] Send successfully 512 byte characteristic&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:266px;max-width:1151px;" height="266" src="https://devzone.nordicsemi.com/resized-image/__size/2302x532/__key/communityserver-discussions-components-files/4/Complete_5F00_long_5F00_read.PNG" width="1151" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;nRF Connect side:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In these nRF Connect logs you can see almost all the steps shown from the sniffer side so far. Everything works.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:479px;max-width:431px;" height="479" src="https://devzone.nordicsemi.com/resized-image/__size/862x958/__key/communityserver-discussions-components-files/4/Connect_5F00_transfer_5F00_OK.jpg" width="431" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:150%;"&gt;Changing MTU to 23 bytes&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Now a command is issued from nRF connect to change the MTU to 23 bytes. This is done using the &amp;quot;...&amp;quot; menu in the upper right corner. With this command, the master will request an MTU of 23 bytes.&lt;/p&gt;
&lt;p&gt;Note that previously the slave was responsible for requesting the MTU change to 230 bytes. You said the MTU can only be changed once per connection, but I believe each side can request the change once per connection (at least it seems that way considering the behavior, I really don&amp;#39;t remember exactly what the BLE spec says about it right now) . In fact, after requesting a new MTU using nRF Connect&amp;nbsp;you will not be able to request it again on the same connection.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:559px;max-width:1355px;" height="559" src="https://devzone.nordicsemi.com/resized-image/__size/2710x1118/__key/communityserver-discussions-components-files/4/Master_5F00_MTU_5F00_req_5F00_23.PNG" width="1355" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Slave] Reply MTU request from master&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:586px;max-width:1454px;" height="586" src="https://devzone.nordicsemi.com/resized-image/__size/2908x1172/__key/communityserver-discussions-components-files/4/Slave_5F00_MTU_5F00_resp_5F00_23.PNG" width="1454" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Master] New data Length request.&lt;/em&gt; This is not a command directly issued via nRF Connect. Probably the Android BLE stack decided that 27 bytes make smore sense with a 23 byte MTU.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:647px;max-width:1533px;" height="647" src="https://devzone.nordicsemi.com/resized-image/__size/3066x1294/__key/communityserver-discussions-components-files/4/Master_5F00_LL_5F00_REQ_5F00_3.PNG" width="1533" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Slaves] Reply data length request&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:598px;max-width:1440px;" height="598" src="https://devzone.nordicsemi.com/resized-image/__size/2880x1196/__key/communityserver-discussions-components-files/4/LL_5F00_Resp_5F00_3.PNG" width="1440" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:150%;"&gt;Reading characteristics with 23 bytes MTU and problem&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:inherit;"&gt;After the above negotiation, characteristics a few bytes long can be read normally, but longer characteristics cannot.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span style="font-family:inherit;"&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span style="font-family:inherit;"&gt;[Master] Read 7 byte characteristic&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:556px;max-width:1367px;" height="556" src="https://devzone.nordicsemi.com/resized-image/__size/2734x1112/__key/communityserver-discussions-components-files/4/Read_5F00_RQ_5F00_short_5F00_MTU_5F00_23.PNG" width="1367" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Slave] Successfully send 7 bytes characteristic&amp;nbsp;data&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:516px;max-width:1252px;" height="516" src="https://devzone.nordicsemi.com/resized-image/__size/2504x1032/__key/communityserver-discussions-components-files/4/Read_5F00_resp_5F00_short_5F00_MTU_5F00_23.PNG" width="1252" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Master] Try 512 bytes characteristic read&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:621px;max-width:925px;" height="621" src="https://devzone.nordicsemi.com/resized-image/__size/1850x1242/__key/communityserver-discussions-components-files/4/read_5F00_req_5F00_long_5F00_MTU_5F00_23.PNG" width="925" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Slave] 512 bytes characteristic data is partially send. Data never displayed in master.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:394px;max-width:1557px;" height="394" src="https://devzone.nordicsemi.com/resized-image/__size/3114x788/__key/communityserver-discussions-components-files/4/read_5F00_resp_5F00_seq_5F00_long_5F00_MTY_5F00_23.PNG" width="1557" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;[Slave] Last data packet error detail&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:654px;max-width:1260px;" height="654" src="https://devzone.nordicsemi.com/resized-image/__size/2520x1308/__key/communityserver-discussions-components-files/4/read_5F00_resp_5F00_long_5F00_MTU23_5F00_error.PNG" width="1260" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The connection remains active and it is even possible to read the data of the characteristics, although if there is too much data the error will be repeated.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Error in nRF Connect side&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Below you can see the steps that led to the error in the nRF Connect log. After the first error, new readings are performed, with success in the case of short features and with error in the case of long features.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:640px;max-width:280px;" alt=" " height="640" src="https://devzone.nordicsemi.com/resized-image/__size/560x1280/__key/communityserver-discussions-components-files/4/Screenshot_5F00_20221230_2D00_095200_5F00_nRF-Connect.jpg" width="280" /&gt;&lt;/p&gt;
&lt;p&gt;As far as I know the BLE stack should automatically split the data and send it even using the 23 byte MTU and 27 byte data length. However, for some reason, only characteristics containing only few bytes of data are being transferred. Can you help me understand if there is something not configured correctly or where is the problem?&lt;/p&gt;
&lt;p&gt;Regarding the read with authorization question, currently the device is notified when the reading starts. However, using the above example, I have no information about the failure to deliver the data. Is there an proper callback to confirm that all data registered in the characteristic were successfully delivered?&lt;/p&gt;
&lt;p&gt;Thank you in advance,&lt;/p&gt;
&lt;p&gt;Ricardo&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Unable to read long characteristics when MTU is 23 bytes using nRF Connect Android APP</title><link>https://devzone.nordicsemi.com/thread/402549?ContentTypeID=1</link><pubDate>Thu, 29 Dec 2022 14:50:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0441d45-90c1-46f4-b10d-2d3e91490ffa</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi RRWC,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Could you try to capture a &lt;a href="https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le"&gt;sniffer trace&lt;/a&gt; ? Which phones did you use to test ? Could you use NRF Connect app to test ?&amp;nbsp;&lt;br /&gt;Error 133 is a generic error , so it doesn&amp;#39;t tell much.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please note that the MTU can only be updated once. If by default it&amp;#39;s 23 and changed to anything else, you can&amp;#39;t change it back to 23.&amp;nbsp;&lt;br /&gt;I did a quick test here and it seems that it worked fine with the ATT_MTU of 23. (NRF_SDH_BLE_GATT_MAX_MTU_SIZE)&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/5460.pastedimage1672324928803v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;You can see that the read blob was successful and the length was 23 bytes on each packet.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I attached here my quick example with a characteristic with 100 bytes length initial value. Please replace the ble_nus.c of the ble_app_uart example. If you do a read from the phone on the TX characteristic it should give you 100 bytes array.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0602.ble_5F00_nus.c"&gt;devzone.nordicsemi.com/.../0602.ble_5F00_nus.c&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Regarding your question about how the application aware that the peer has read the characteristic. You can implement read with authorization. Please see &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.3.0/group___b_l_e___g_a_t_t_s___r_e_a_d___r_e_q___a_u_t_h___m_s_c.html?cp=4_7_3_1_2_4_3_13"&gt;here&lt;/a&gt;.&amp;nbsp;You&amp;#39;ll need to use is_defered_read when declare the characteristic.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>