<?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>400ms delay between ATT Write request and response</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80153/400ms-delay-between-att-write-request-and-response</link><description>Hi, 
 On a nrf52840 running SDK 17.0.2 and Softdevice 7.2, while being connected to two devices in central and peripheral role, I observe that on the connection where the nrf is in peripheral role, a whopping 400ms delay between an ATT write request and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 25 Oct 2021 14:16:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80153/400ms-delay-between-att-write-request-and-response" /><item><title>RE: 400ms delay between ATT Write request and response</title><link>https://devzone.nordicsemi.com/thread/335796?ContentTypeID=1</link><pubDate>Mon, 25 Oct 2021 14:16:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ba7406b-707c-4559-9ed8-1ab4ed8ddb68</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Jørn&lt;/p&gt;
&lt;p&gt;These are very strange findings. With the central link running at such a long interval there should be plenty of room for the peripheral connection running with a 20ms connection interval to send and receive data, regardless of whether or not the long connection interval is a multiple of the short one.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you let me know what kind of hardware is used for the three devices involved (the nRF device, and peer1 and 2)?&lt;/p&gt;
&lt;p&gt;Is the nRF52840 device using a DK, or a custom board?&lt;/p&gt;
&lt;p&gt;Have you reproduced the issue on multiple sets of hardware, or just a single set?&lt;/p&gt;
&lt;p&gt;Do you think there is any way you could assemble some kind of test that I can run locally on my side, using DK&amp;#39;s only, so I can reproduce the issue here?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 400ms delay between ATT Write request and response</title><link>https://devzone.nordicsemi.com/thread/335349?ContentTypeID=1</link><pubDate>Thu, 21 Oct 2021 15:29:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1ee3459-bba1-4e7b-a124-8c58d21047aa</guid><dc:creator>jmr</dc:creator><description>&lt;p&gt;Hej Torbj&amp;oslash;rn,&lt;/p&gt;
[quote userid="2116" url="~/f/nordic-q-a/80153/400ms-delay-between-att-write-request-and-response/334589#334589"]It seems a bit odd that using a connection interval&amp;nbsp;on the central link that is a multiple of the connection interval on the peripheral link will make such a big difference. Have you done testing to verify that using 400ms over 437.5ms provides a significant and consistent improvement?[/quote]
&lt;p&gt;Yes, I have done some testing. While with 400ms I get 10% failure rate, 437.5ms yields 100% failure rate with peer2. Odd is the fact that with 202.5ms interval I get a low 5% failure rate on communications with peer2..&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;span&gt;interval 375ms,&amp;nbsp;&amp;nbsp; latency 3, timeout = 6000ms&amp;nbsp; --&amp;gt; 20% failure, NRF_ERROR_TIMEOUT in sd_ble_gatts_hvx&lt;br /&gt;interval 400ms,&amp;nbsp;&amp;nbsp; latency 3, timeout = 6000ms&amp;nbsp; --&amp;gt; 10% failure, no answer from peer2&lt;br /&gt;interval 250ms,&amp;nbsp;&amp;nbsp; latency 3, timeout = 6000ms&amp;nbsp; --&amp;gt; 15% failure, NRF_ERROR_TIMEOUT in sd_ble_gatts_hvx&lt;br /&gt;interval 200ms,&amp;nbsp;&amp;nbsp; latency 3, timeout = 6000ms&amp;nbsp; --&amp;gt; 15% failure, NRF_ERROR_TIMEOUT in sd_ble_gatts_hvx&lt;br /&gt;interval 202.5ms, latency 3, timeout = 6000ms&amp;nbsp; --&amp;gt; 5% failure, NRF_ERROR_TIMEOUT in sd_ble_gatts_hvx&lt;br /&gt;interval 437.5ms, latency 3, timeout = 6000ms&amp;nbsp; --&amp;gt; 100% failure, no answer from peer2&lt;br /&gt;interval 420ms,&amp;nbsp;&amp;nbsp; latency 3, timeout = 6000ms&amp;nbsp; --&amp;gt; 10% failure, no answer from peer2&lt;br /&gt;interval 420ms,&amp;nbsp;&amp;nbsp; latency 0, timeout = 6000ms&amp;nbsp; --&amp;gt; 5% failure, no answer from peer2&lt;br /&gt;interval 202.5ms, latency 0, timeout = 6000ms&amp;nbsp; --&amp;gt; 20% failure, NRF_ERROR_TIMEOUT in sd_ble_gatts_hvx&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;
[quote userid="2116" url="~/f/nordic-q-a/80153/400ms-delay-between-att-write-request-and-response/334589#334589"]Packets should never get lost when using the SoftDevice, unless you get a disconnect (which is what happens if you have a total communications breakdown).&amp;nbsp;[/quote]
&lt;p&gt;I apologize for not having made that clear: what I observe with peer2 (and ONLY peer2) is a &amp;quot;communications breakdown&amp;quot; on a higher level. My app communicates with peer2 using a service just like your NUS. And that application-level-communication breaks down.Depending on the chosen interval with peer1, I get either no answer from peer2 where I expect one (while seeing with the sniffer that packets have been sent though delayed) or I get a NRF_ERROR_TIMEOUT when calling sd_ble_gatts_hvx for the tx-part of my NUS-alike service.&lt;/p&gt;
&lt;p&gt;Also if there is no peer1 connected (and I do no scanning), I have no problems with peer2 and observe no delays beyond what I would expect changing connection parameters. Also varying connection parameters in single peer2-only mode have no negative effects.&lt;/p&gt;
[quote userid="2116" url="~/f/nordic-q-a/80153/400ms-delay-between-att-write-request-and-response/334589#334589"]&lt;p&gt;One thing that is interesting is the fact that the remote peripheral requests a slave latency of 3.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With a connection interval of 437.5ms and a slave latency of 3 the peripheral is allowed to only send a packet once every 4 connection intervals, or every 1.75 seconds.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could this be related to the issues you are seeing?&lt;/p&gt;[/quote]
&lt;p&gt;Not really, because I have no issues with peer1 at all. That peer1 is kind of a environmental sensor with very little data to send at low frequency. So that latency settings is just fine..&lt;/p&gt;
[quote userid="2116" url="~/f/nordic-q-a/80153/400ms-delay-between-att-write-request-and-response/334589#334589"]Could you try a new test where you accept the min and max connection interval set by the peer, but simply set the slave latency to 0, and see if it works better?[/quote]
&lt;p&gt;I did some latency=0 testing (see above) with little improvement. Again, I have issues with peer2 but I do alter connection parameters for the connection with peer1..&lt;/p&gt;
&lt;p&gt;Could it possibly be that i might have misconfigured the Softdevice in a way that the two connections are interferring with each other? Do I need to have a separate configuration tag for each connection?&lt;/p&gt;
&lt;p&gt;thanks and best regards, J&amp;oslash;rn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 400ms delay between ATT Write request and response</title><link>https://devzone.nordicsemi.com/thread/334589?ContentTypeID=1</link><pubDate>Mon, 18 Oct 2021 11:56:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50bf7002-395a-420e-baad-bb498a2508fc</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Jørn&lt;/p&gt;
&lt;p&gt;It seems a bit odd that using a connection interval&amp;nbsp;on the central link that is a multiple of the connection interval on the peripheral link will make such a big difference. Have you done testing to verify that using 400ms over 437.5ms provides a significant and consistent improvement?&lt;/p&gt;
&lt;p&gt;Peripheral links are inherently asynchronous to the timing of the central links, and will drift in and out of &amp;#39;conflict&amp;#39; over time. The only difference of choosing a connection interval that is a multiple is that you will have a more predictable behavior: Either the central link timing will be in conflict with the peripheral link timing consistently on every connection event, or the timing of the two links will be so much out of phase that they never get in conflict (at least until they drift back into conflict).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When two connections have conflicting timing the SoftDevice will prioritize the links in turn, as mentioned earlier.&amp;nbsp;&lt;/p&gt;
[quote user="jmr"]Forwarding (187.5, 437.5, 3, 6000) as requested to the softdevice, as in the code above, the softdevice will confirm the request and set the connection interval to 437.5. Now this is a bad pick, which results in lost or inacceptably delayed packets and eventually a commmunications breakdown with peer2.[/quote]
&lt;p&gt;Packets should never get lost when using the SoftDevice, unless you get a disconnect (which is what happens if you have a total communications breakdown).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The critical aspect is that you have a connection supervising timeout that is long enough to account for the connection interval and slave latency used.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;One thing that is interesting is the fact that the remote peripheral requests a slave latency of 3.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With a connection interval of 437.5ms and a slave latency of 3 the peripheral is allowed to only send a packet once every 4 connection intervals, or every 1.75 seconds.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could this be related to the issues you are seeing?&lt;/p&gt;
&lt;p&gt;Could you try a new test where you accept the min and max connection interval set by the peer, but simply set the slave latency to 0, and see if it works better?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 400ms delay between ATT Write request and response</title><link>https://devzone.nordicsemi.com/thread/334368?ContentTypeID=1</link><pubDate>Fri, 15 Oct 2021 13:02:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6306889c-80c7-4be6-9330-71468d1384a4</guid><dc:creator>jmr</dc:creator><description>&lt;p&gt;&lt;span&gt;Hej Torbj&amp;oslash;rn, &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks for the insights and your extensive reply.&lt;br /&gt;Your input has led me into the right direction.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So after quite a bit of digging and reading, I found the reason to why I suddenly lost communications with peer2:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;the mentioned connection intervals with peer1 and peer2 do not work well with the softdevice scheduler, which leads to dropped packages and the observed lost communications.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;With peer2, the connection parameters get set by the remote peer (as it is central, 20,20,0,1000 as mentioned in a previous message) and since we &amp;quot;talk&amp;quot; a lot with peer2, we keep this parameters and do not request an update. (I tried that but however failed for some other reason most probably related to peer2&amp;#39;s internals)&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Peer1 is a sensor in peripheral role which requests the connection parameters to be changed a few times, finally asking for (187.5, 437.5, 3, 6000).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;originally, my software (in central role here) would process an update request like this (taken from ble_app_multirole example):&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;code&gt;case BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST:&lt;/code&gt;&lt;/span&gt;&lt;code&gt;&lt;span&gt; {&lt;br /&gt;&amp;nbsp; // Accept parameters requested by peer.&lt;br /&gt;&amp;nbsp; err_code = sd_ble_gap_conn_param_update(p_gap_evt-&amp;gt;conn_handle,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;p_gap_evt-&amp;gt;params.conn_param_update_request.conn_params);&lt;br /&gt;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;br /&gt;} break;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;Forwarding (187.5, 437.5, 3, 6000) as requested to the softdevice, as in the code above, the softdevice will confirm the request and set the connection interval to 437.5. Now this is a bad pick, which results in lost or inacceptably delayed packets and eventually a commmunications breakdown with peer2.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;BECAUSE&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Chapter 15 in S140_SDS_v2.1.pdf&amp;nbsp; (Or in &lt;a href="https://infocenter.nordicsemi.com/topic/sds_s140/SDS/s1xx/multilink_scheduling/suggested_intervals_windows_s132.html"&gt;infocenter/sds_s140/SDS/s1xx/multilink_scheduling/suggested_intervals_windows&lt;/a&gt;) states quite clearly, that connection intervals must be carefully chosen to avoid collisions and / or dropped packages.&lt;br /&gt;And a careful choice would be (in my case) that connection intervals of all connections are multiples of a common base. Which is with 437.5 and 20 clearly not the case. So eventually, there are package-timing collisions in softdevice which leads eventually to communications breakdown.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;MY SOLUTION was to&lt;br /&gt;change the conn param update request procedure from above to something that instead of passing the requested parameters directly to SoftDevice, would find a &amp;quot;good&amp;quot; value within the requested min/max and set that as the new connection interval. So from the (187.5, 437.5, 3, 6000) request, we find a value close to 437.5ms which is a multiple of 20ms. So the SoftDevice will get to change parameter to (400, 400, 3, 6000) and that solves my problems with peer2.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Of course, this fix only solves my current situation, and by adding more connections (or adding simultaneous scanning while advertising and maintaining a connection) things get worse. One needs to keep a finger on Chapter 15 in softdevice spec. while working with multiple simultaneous connections (and/or attempts).&lt;br /&gt;Also worth reading is a post by Edvin on topic &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/63223/connection-parameter-selection-for-central-device-with-10-peripheral-simultaneous-connections"&gt;Connection Parameter Selection for Central Device with 10 Peripheral Simultaneous Connections&lt;/a&gt; which covers some of the same troubles.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;What I am missing is feedback from the softdevice scheduler to detect such conflicts. I thought setting NRF_SDH_*_LOG_LEVEL to DEBUG severity would give me such insight, but it doesn&amp;#39;t.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Maybe I am missing something and there IS feedback from the SD-Scheduler?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;Ah, and I forgot to mention.. the observed 400ms delay (this issue&amp;#39;s topic) is most probably due to the scheduler having deferred the response due to being occupied with processing connection with peer1. But of course, without knowing scheduler details (and especially its scheduling strategy) this is only me guessing. Maybe some of you Torbj&amp;oslash;rn or any other nRF cracks can confirm that.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;hilsen, J&amp;oslash;rn.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 400ms delay between ATT Write request and response</title><link>https://devzone.nordicsemi.com/thread/332269?ContentTypeID=1</link><pubDate>Mon, 04 Oct 2021 09:08:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61ee9303-2890-43e3-adfc-d1ad47f735e5</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Jørn&lt;/p&gt;
&lt;p&gt;Thanks for sharing the details. Based on the sniffer trace it should be possible to pin point exactly the connection interval used. The central will pick a number in between min and max if possible, or ignore the request and pick a number outside this range. When the central device is an nRF device you should always get the connection interval that you ask for (many mobile phones are more picky about which connection parameters they will accept).&amp;nbsp;&lt;/p&gt;
[quote user="jmr"]I might need to add that each of the connections run under its own connection-tag. I&amp;#39;m not sure about this but I guess this is mandatory if connection parameter negotiation should work properly.. (please correct me if I am wrong).[/quote]
&lt;p&gt;I assume you are referring to the connection handle?&lt;/p&gt;
&lt;p&gt;This number will always be unique for each connection, and is used&amp;nbsp;to identify a specific connection for&amp;nbsp;many of the SoftDevice API&amp;#39;s.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For instance all the GATT/ATT API&amp;#39;s are connection specific, and when you send receive data over GATT you always need to specify which connection you want to interact with.&amp;nbsp;&lt;/p&gt;
[quote user="jmr"]You said &amp;quot;Normally any ATT request will have to be handled by the application&amp;quot; .. that puzzles me a bit, since my service for peer2 is very similar to ble_nus service where BLE_GATTS_EVT_WRITE just results in calling back the app with the received data (or enable/disable notification/indication in case the write targets a cccd). I can&amp;#39;t see any call to the softdevice triggering it to send a write response. So that must be happening automatically within the SoftDevice..[/quote]
&lt;p&gt;When exchanging data over Bluetooth you always have the option of using either commands or requests, where the main difference is that a request needs to be responded to by the Bluetooth host (via the application in some cases), while a command does not.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This makes commands a lot more efficient in that you can send multiple of them in a single connection event, without having to wait for the host and/or application to send a response.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For this reason most data exchange happens using commands rather than requests.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The ble_app_uart uses notifications for server-to-client communication, and write without response for client-to-server communication. Both of these are command based operations.&lt;/p&gt;
&lt;p&gt;A critical aspect of the Bluetooth link layer is that it ensures data integrity by constantly checking the sequence number, and retransmitting any lost packets, so using requests is not necessary to ensure that a packet is successfully received by the peer device.&amp;nbsp;&lt;/p&gt;
[quote user="jmr"]Most of the empty PDUs in-between have wrong sequence number, maybe this hints to something...[/quote]
&lt;p&gt;Any chance you could save the trace to file and share it with me?&amp;nbsp;&lt;br /&gt;It is possible to drag and drop files into your response in order to attach it to the case. Then it is much easier for me to look into it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you see the wrong sequence numbers it is usually a sign that the sniffer is not picking up all the packets. In order to ensure a good trace I would recommend keeping the sniffer in between the two devices, and keep them all relatively close together.&amp;nbsp;&lt;/p&gt;
[quote user="jmr"]I&amp;#39;m looking forward to read more expert insights from you, thank you in advance. &lt;br /&gt;I&amp;#39;ll be on holiday next week, so please don&amp;#39;t spoil your weekend with my riddle and bear with me if you observe some delay in my response. :-)[/quote]
&lt;p&gt;Take your time, and enjoy your holiday &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Work-life balance is important here in Norway,&amp;nbsp;so&amp;nbsp;I rarely work in the weekends unless absolutely necessary ;)&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 400ms delay between ATT Write request and response</title><link>https://devzone.nordicsemi.com/thread/332064?ContentTypeID=1</link><pubDate>Fri, 01 Oct 2021 07:20:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba5e9084-fe84-49fc-9fdf-c9bb75cf117c</guid><dc:creator>jmr</dc:creator><description>&lt;p&gt;Hej Torbj&amp;oslash;rn, &lt;br /&gt;&lt;br /&gt;Thanks for your quick reply. &lt;br /&gt;Connection Parameters&amp;nbsp; (min_conn_interval in ms, max_conn_interval in ms, latency, conn_supervision_timeout in ms ) for the two peers are:&lt;/p&gt;
&lt;p&gt;peer1 (nRF in Central Role) : 187.5, 437.5, 3, 6000&amp;nbsp; &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; peer1 requests multiple changes to the connection parameters which I adhere to using sd_ble_gap_conn_param_update. Above set is the &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; last one.&lt;/p&gt;
&lt;p&gt;peer2 (nRF in Peripheral Role): 20, 20, 0, 1000&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; above set is what peer2 sets (Values are from softdevice within connect event)&lt;/p&gt;
&lt;p&gt;I might need to add that each of the connections run under its own connection-tag. I&amp;#39;m not sure about this but I guess this is mandatory if connection parameter negotiation should work properly.. (please correct me if I am wrong). &lt;br /&gt;&lt;br /&gt;The Softdevice is not advertising nor scanning while the two connections are active.&lt;/p&gt;
&lt;p&gt;You said &amp;quot;Normally any ATT request will have to be handled by the application&amp;quot; .. that puzzles me a bit, since my service for peer2 is very similar to ble_nus service where BLE_GATTS_EVT_WRITE just results in calling back the app with the received data (or enable/disable notification/indication in case the write targets a cccd). I can&amp;#39;t see any call to the softdevice triggering it to send a write response. So that must be happening automatically within the SoftDevice..&lt;/p&gt;
&lt;p&gt;my wireshark-capture (between nRF(Slave) and peer2(Master) )looks like this:&lt;/p&gt;
&lt;pre&gt;91968&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.404261s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91969&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.405258s&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91970&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.406256s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;ATT&amp;nbsp;&amp;nbsp; &amp;nbsp;53&amp;nbsp;&amp;nbsp; &amp;nbsp;Sent Write Request, Handle: 0x0010 (Unknown: Unknown: Unknown)&lt;br /&gt;91971&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.407253s&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91972&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.424146s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91973&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.443692s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91974&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.463986s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91975&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.483477s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91976&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.503210s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91977&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.524447s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91978&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.544247s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91979&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.565155s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91980&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.584530s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91981&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.604562s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91982&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.625009s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91983&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.644495s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91984&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.665219s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91985&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.684184s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91986&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.704270s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91987&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.724530s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91988&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.744600s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91989&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.764448s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91990&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.784021s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91991&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.804374s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91992&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.824346s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91993&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.844001s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91994&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.845988s&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;ATT&amp;nbsp;&amp;nbsp; &amp;nbsp;31&amp;nbsp;&amp;nbsp; &amp;nbsp;Rcvd Write Response, Handle: 0x0010 (Unknown: Unknown: Unknown)&lt;br /&gt;91995&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.863943s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;br /&gt;91996&amp;nbsp;&amp;nbsp; &amp;nbsp;10m 22.883886s&amp;nbsp;&amp;nbsp; &amp;nbsp;Master_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;Slave_0x8a1d2c95&amp;nbsp;&amp;nbsp; &amp;nbsp;LE LL&amp;nbsp;&amp;nbsp; &amp;nbsp;26&amp;nbsp;&amp;nbsp; &amp;nbsp;Empty PDU&lt;/pre&gt;
&lt;p&gt;Most of the empty PDUs in-between have wrong sequence number, maybe this hints to something...&lt;/p&gt;
&lt;p&gt;I&amp;#39;m looking forward to read more expert insights from you, thank you in advance. &lt;br /&gt;I&amp;#39;ll be on holiday next week, so please don&amp;#39;t spoil your weekend with my riddle and bear with me if you observe some delay in my response. :-)&lt;/p&gt;
&lt;p&gt;Best regards, J&amp;oslash;rn.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: 400ms delay between ATT Write request and response</title><link>https://devzone.nordicsemi.com/thread/332008?ContentTypeID=1</link><pubDate>Thu, 30 Sep 2021 17:46:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a11ae9a-d997-4fdd-aa38-b12e0085830b</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It would definitely be interesting to know the connection parameters used, both for the central and peripheral connection.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is the SoftDevice also advertising or scanning while the two connections are active?&lt;/p&gt;
&lt;p&gt;When the SoftDevice has multiple connections ongoing there will be occasional conflicts between links, in which case one of the links will skip a connection event in a round robin scheme where the different connections are prioritized in turn.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As for the message sequence chart it is interesting to see that the response happens right away. Normally any ATT request will have to be handled by the application, which means you will not be able to get the response on the same connection event that you receive the request.&amp;nbsp;&lt;br /&gt;I will check with the SoftDevice team tomorrow and get a clarification on how this works.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>