<?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 lost messages</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73308/ble-lost-messages</link><description>Hi, as part of my project i have 2 nordic 52dks one as a pheripheral (sending) and on as a client (recieving). where i am sening a buffer of 8, in the order 
 buffer[0] = 10 
 buffer[1}= X gyro lsb 
 buffer[2] = X gyro msb 
 buffer[3] = y gyro lsb 
 buffer</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 19 Apr 2021 12:10:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73308/ble-lost-messages" /><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/305518?ContentTypeID=1</link><pubDate>Mon, 19 Apr 2021 12:10:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fda92c2-8d1e-4141-aea1-92a24251350a</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="NikolaiDimech98"]ive attached the wireshark hope that it can be opened form your end...[/quote]
&lt;p&gt;Yes, I am able to open the wireshark capture, thank you.&lt;/p&gt;
[quote user="NikolaiDimech98"]if we look at for example number 226 the packets are being fragmented, should i not be recvieng 242 bytes + any overheads creating by ble (which i think totals to 249 bytes) is this fragmentation normal ?&amp;nbsp;[/quote]
&lt;p&gt;Fragmentation is normal, yes. Your total frame length is 249.&lt;br /&gt;See the initial packets in your trace. Your MTU is set to 247.&lt;br /&gt;You are correct that it adds 7 bytes overhead total - 3 byte ATT header, 4 byte L2CAP header.&lt;br /&gt;Please have a look &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/65105/ble-l2cap-fragmentation-and-reassembly/265857#265857"&gt;at this ticket&lt;/a&gt;&amp;nbsp;for a more detailed explanation.&lt;/p&gt;
[quote user="NikolaiDimech98"]also as can be seen in the PHY colomn it says 1M but i configured both sdks (central and pheripheral) as 2Mbps and you have told me to update request, should it not alwasy be 2Mpbs if i configured them as 2Mbps if not how do i update the request please?[/quote]
&lt;p&gt;This is exactly why having the sniffer trace is a great tool. We can here see that there is never any PHY update request for 2 Mbps. So we know that this procedure is never initiated, and thus the PHY will not change from its original PHY, which in all SDK examples are 1 Mbps.&lt;br /&gt;Could you tell me exactly what you have done to change your PHY to 2 Mbps?&lt;br /&gt;As I understand it, you have only changed the SCAN_PHY define that you shared a screenshot of earlier - i.e which PHY the central will scan on, and not actually implemented the PHY update procedure that I asked you to earlier?&lt;br /&gt;If there is no PHY Update request, the PHY will be the same as the peripheral was advertising with. It appears from your provided trace that this is 1 Mbps.&lt;/p&gt;
&lt;p&gt;Please have a look at &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/44169/default-phy"&gt;this other ticket&lt;/a&gt;, which discusses PHY&amp;#39;s and how configuring them work.&lt;br /&gt;The link provided by &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.2.0/group___b_l_e___g_a_p___c_e_n_t_r_a_l___p_h_y___u_p_d_a_t_e.html"&gt;Vidar is broken, but this is the message sequence chart he is referring to&lt;/a&gt;.&lt;/p&gt;
[quote user="NikolaiDimech98"]i have set both peripheral and client to 50ms conn interval as can be seen below[/quote]
&lt;p&gt;This is successful, and we can see from packet #76 that your devices are communicating with 50 ms connection interval.&lt;/p&gt;
[quote user="NikolaiDimech98"]why is that if i change the event length seen below i do not get a connection between the devices can you explain please?[/quote]
&lt;p&gt;What do you change it to? Is this on the peripheral or central side?&lt;br /&gt;What does the trace say when you have changed this? Are you able to see the peripheral advertise, but not connect? Or do you not see it advertise at all when you&amp;#39;ve made this change? Is there an error generated?&lt;br /&gt;The more specific information you provide, the easier it will be for us to resolve the issue.&lt;/p&gt;
[quote user="NikolaiDimech98"]also one final thing please, how am i apple to calculate th exact speed cause i know ill never achieve the 2Mbps mark so i would like to include the actual speed im transfering at.[/quote][quote user="Karl Ylvisaker"]Brief googling also yielded &lt;a href="https://www.novelbits.io/bluetooth-5-speed-maximum-throughput/"&gt;this&amp;nbsp;&lt;em&gt;very good&amp;nbsp;&lt;/em&gt;third party tutorial on how to achieve maximum throughput for BLE 5&lt;/a&gt;. I highly recommend that you have a read through this, to better understand the meaning of the different parameters, and how to set them for maximum throughout. The tutorial also links to our throughput and long range demo, which could be very useful for you to have a look at at this point in your project.[/quote]
&lt;p&gt;Please have a look at the examples referenced in this tutorial - especially the throughput example. Have a look at how they implement the throughput calculations to see how you may proceed with this yourself.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/305370?ContentTypeID=1</link><pubDate>Sat, 17 Apr 2021 13:52:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8af4866-9104-4ff4-9ec9-007364c687c9</guid><dc:creator>NikTheNordicUser</dc:creator><description>&lt;p&gt;also as i told you previously, i have set both peripheral and client to 50ms conn interval as can be seen below&lt;/p&gt;
&lt;p&gt;Pheripheral:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1618667408326v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;client&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/pastedimage1618336249521v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;why is that if i change the event length seen below i do not get a connection between the devices can you explain please?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1618667454711v3.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/305368?ContentTypeID=1</link><pubDate>Sat, 17 Apr 2021 11:45:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:817ef611-3ea8-4ea0-9bf1-0ac46e5ce9bb</guid><dc:creator>NikTheNordicUser</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/wsh.pcapng"&gt;devzone.nordicsemi.com/.../wsh.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;ive attached the wireshark hope that it can be opened form your end... if we look at for example number 226 the packets are being fragmented, should i not be recvieng 242 bytes + any overheads creating by ble (which i think totals to 249 bytes) is this fragmentation normal ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;also as can be seen in the PHY colomn it says 1M but i configured both sdks (central and pheripheral) as 2Mbps and you have told me to update request, should it not alwasy be 2Mpbs if i configured them as 2Mbps if not how do i update the request please?&lt;/p&gt;
&lt;p&gt;also one final thing please, how am i apple to calculate th exact speed cause i know ill never achieve the 2Mbps mark so i would like to include the actual speed im transfering at.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you and good day&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/304861?ContentTypeID=1</link><pubDate>Wed, 14 Apr 2021 13:46:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61629174-e643-4fe9-8376-4b352984d986</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;/p&gt;
[quote user="NikolaiDimech98"]update: I managed to successfully install the sniffer and program another nrf52dk with the hex file and im seeing packets being transfered.[/quote]
&lt;p&gt;I am happy to hear that you were able to resolve your issues setting up the sniffer, and that you now have it working! :)&amp;nbsp;&lt;/p&gt;
[quote user="NikolaiDimech98"]1. How can i know for sure which is my device as im seeing packets from multiple devices[/quote]
&lt;p&gt;I suppose you have already figured this out, but you need to select your device in the device dropdown menu. You need to do this prior to establishing a connection to make the sniffer follow into the connection.&lt;/p&gt;
[quote user="NikolaiDimech98"]2. Howcome the lengths of packets varry between 21-37 if i should be sending 242 bytes from the pheripheral ( confirmed by the uart of the client)&amp;nbsp;[/quote][quote user="NikolaiDimech98"]howcome i dont always recive the same amount of data (should i not always recieve 242 bytes at once)[/quote]
&lt;p&gt;Please send the trace, and illustrate this with specific packets in the trace.&lt;/p&gt;
[quote user="NikolaiDimech98"]the speed is set at 1MBPS and i set it in both codes as 2 howcome i still get 1 MBPS.[/quote]
&lt;p&gt;You can send an PHY update request if your connection is not using the PHY you would like See how the BLE_GAP_EVT_PHY_UPDATE_REQUEST (received request) is handled in the central&amp;#39;s ble_evt_handler.&lt;br /&gt;&lt;br /&gt;Brief googling also yielded &lt;a href="https://www.novelbits.io/bluetooth-5-speed-maximum-throughput/"&gt;this&amp;nbsp;&lt;em&gt;very good&amp;nbsp;&lt;/em&gt;third party tutorial on how to achieve maximum throughput for BLE 5&lt;/a&gt;. I highly recommend that you have a read through this, to better understand the meaning of the different parameters, and how to set them for maximum throughout. The tutorial also links to our throughput and long range demo, which could be very useful for you to have a look at at this point in your project.&lt;/p&gt;
[quote user="NikolaiDimech98"]i hope that its visable but[/quote]
&lt;p&gt;Sorry, I am not able to see anything in the video you have provided.&lt;br /&gt;Please share the trace file instead, and make comments with references to packet numbers etc.&lt;br /&gt;For example, &amp;quot;The behavior can be seen in the exchange starting on packet 112256, and lasts until packet 112300&amp;quot;, or similar.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/304754?ContentTypeID=1</link><pubDate>Wed, 14 Apr 2021 09:43:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d076240-616f-4616-b9b5-1ca63edd41e8</guid><dc:creator>NikTheNordicUser</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2021_2D00_04_2D00_14_2D00_11_2D00_40_2D00_08.mp4"&gt;devzone.nordicsemi.com/.../2021_2D00_04_2D00_14_2D00_11_2D00_40_2D00_08.mp4&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;i hope that its visable but as should be seen the speed is set at 1MBPS and i set it in both codes as 2 howcome i still get 1 MBPS. also howcome i dont always recive the same amount of data (should i not always recieve 242 bytes at once)&lt;/p&gt;
&lt;p&gt;thank you :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/304739?ContentTypeID=1</link><pubDate>Wed, 14 Apr 2021 09:09:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:667bc696-e77f-4b79-9017-bb4f26d70533</guid><dc:creator>NikTheNordicUser</dc:creator><description>&lt;p&gt;update: I managed to successfully install the sniffer and program another nrf52dk with the hex file and im seeing packets being transfered. i still have 2 questions however..&lt;/p&gt;
&lt;p&gt;1. How can i know for sure which is my device as im seeing packets from multiple devices&lt;/p&gt;
&lt;p&gt;2. Howcome the lengths of packets varry between 21-37 if i should be sending 242 bytes from the pheripheral ( confirmed by the uart of the client)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;is there something im missing please?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/304722?ContentTypeID=1</link><pubDate>Wed, 14 Apr 2021 07:51:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c1d7f9b8-0733-4e82-a1a1-d7514fbc8874</guid><dc:creator>NikTheNordicUser</dc:creator><description>[quote userid="87869" url="~/f/nordic-q-a/73308/ble-lost-messages/304704#304704"]MTU size[/quote]
&lt;p&gt;from both pheripheral and client they are set as 247&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1618385423599v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1618385437088v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;as for the PHy is can only be set in the client right?&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1618385493019v3.png" alt=" " /&gt;&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/73308/ble-lost-messages/304704#304704"] meet these prerequisites before continuing with the installation[/quote]
&lt;p&gt;yes i had them downloded but using the phyton-V command didnt work so i unstalled both wireshark and phyton and reinstalled them and it seem to work&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1618386106716v4.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;i followed the next steps and got till here:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1618386599744v5.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;then i went to press F5 to see the snffer but its not in the interfaces as can be seen below&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1618386660655v6.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;also do i need to have another board for the sniffer ? or can i use the pheripheral or the client?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/304704?ContentTypeID=1</link><pubDate>Wed, 14 Apr 2021 06:45:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c7bb1e9-af02-4dae-a9fe-47be9eb75d0f</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello again,&lt;/p&gt;
[quote user="NikolaiDimech98"]so for the below config i set the con interval of both pheripheral and client to 50ms&amp;nbsp;[/quote]
&lt;p&gt;Great! Now your devices will communicate with a 50 ms connection interval.&lt;/p&gt;
[quote user="NikolaiDimech98"]i dont think theres amything else to change right&amp;nbsp; please?&amp;nbsp;[/quote]
&lt;p&gt;Have you changed the MTU size and PHY (you need to use 2 Mbps PHY for maximum throughput)? Have you set the connection event length to the same value as the connection interval, as previously mentioned?&amp;nbsp;&lt;br /&gt;If you have, please show that as well for completeness. If you have not, please do so.&lt;/p&gt;
[quote user="NikolaiDimech98"]i cant seem to manage to do it... im unsure why&amp;nbsp;[/quote]
&lt;p&gt;It seems it does not find pip3 as a command. Which python version do you have installed on your computer? In the command prompt, type&amp;nbsp;&lt;em&gt;python -V&amp;nbsp;&lt;/em&gt;&lt;em&gt;&lt;/em&gt;to see the python version. You will need to have python 3.6 or later installed, to complete the installation.&lt;br /&gt;This is clearly mentioned as one of the first things in the installation guide:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;em&gt;Before you start setting up the nRF Sniffer, make sure that you have the following prerequisites installed on your computer:&lt;/em&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;&lt;a href="https://www.wireshark.org/" rel="noopener noreferrer" target="_blank"&gt;Wireshark&lt;/a&gt;&amp;nbsp;v2.4.6 or later (v3.0.7 or later recommended on Windows). Wireshark is a free software tool that captures wireless traffic and reproduces it in a readable format.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;&lt;a href="https://www.python.org/downloads/" rel="noopener noreferrer" target="_blank"&gt;Python&lt;/a&gt;&amp;nbsp;v3.6 or later.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Please make sure that you meet these prerequisites before continuing with the installation.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/304663?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 17:55:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c53b5f8-4ba1-4f27-bca4-754bd0966f8d</guid><dc:creator>NikTheNordicUser</dc:creator><description>[quote userid="87869" url="~/f/nordic-q-a/73308/ble-lost-messages/304647#304647"]so you are not doing what the throughput documentation has told you to do,[/quote]
&lt;p&gt;so for the below config i set the con interval of both pheripheral and client to 50ms&amp;nbsp;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1618336202687v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Client&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1618336249521v3.png" alt=" " /&gt;:&lt;/p&gt;
&lt;p&gt;Pheripheral&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1618336296476v4.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;i dont think theres amything else to change right&amp;nbsp; please?&amp;nbsp;&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/73308/ble-lost-messages/304647#304647"]&lt;a href="https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/intro.html"&gt;in the nRF Sniffer documentation for details&lt;/a&gt;.[/quote]
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1618336446420v5.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;i cant seem to manage to do it... im unsure why&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1618336480873v6.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1618336527034v7.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;im opening the cmd in the above seen path&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/304647?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 15:49:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f43a915-8f13-4389-aceb-cc70bf4b6bd0</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user="NikolaiDimech98"]firslt i would like to thank you and i finally solved the error 19 issue[/quote]
&lt;p&gt;No problem at all, I am happy to help! I am also glad to hear that you have resolved the NRF_ERROR_RESOURCES error code being returned from ble_nus_data_send!&lt;br /&gt;Did you manage to implement the _HVN handling to queue the failed notification as I suggested?&lt;/p&gt;
[quote user="NikolaiDimech98"]apologies for being unclear at times as i still a student and this project is for my final year project which is due very soon so i may come accross as unclear.[/quote]
&lt;p&gt;No need to apologize, I try to understand as best I can. Thank you for the understanding though! :)&amp;nbsp;&lt;/p&gt;
[quote user="NikolaiDimech98"]just to be sure im understanding the connection interval is the connection between central and pheripheral right?[/quote]
&lt;p&gt;The connection interval is the time between each&amp;nbsp;&lt;em&gt;connection event&lt;/em&gt;. A connection event is the event in which the devices actually communicate.&lt;br /&gt;The BLE protocol is low power because the radio is active as little as possible (among other things). The radio consumes a lot of power, so minimizing the time it is on reduces overall power consumption. So, in BLE the devices agree on specific intervals in which they will both turn on their radios to communicate - so that it does not have to be on all the time, and waste power. By lowering the connection interval you are increasing power consumption, but gain reduced latency and increased throughput.&lt;br /&gt;Please let me know if any part of this should be unclear.&lt;/p&gt;
[quote user="NikolaiDimech98"]in the peripheral it is set to 6.[/quote]
&lt;p&gt;With units of 1.25 ms, this translates to a 7.5 ms connection interval window.&lt;br /&gt;In the screenshot you have shared(which is the&amp;nbsp;&lt;em&gt;peripheral side&lt;/em&gt;, so it is still just the peripherals&amp;nbsp;&lt;em&gt;preference&lt;/em&gt;) you have configured the minimal connection interval to 20 ms, and the max to 75 ms - so you are not doing what the throughput documentation has told you to do, which is to have the event length be equal to the connection interval length.&lt;br /&gt;It is important that you read the documentation properly, if you hope to achieve the results it detail.&lt;br /&gt;&lt;br /&gt;The connection event length is the time the devices are allowed to stay talking each &lt;em&gt;connection event&lt;/em&gt;. So, in the case that the devices have &amp;#39;infinite&amp;#39;(for all practical purposes) information to communicate, they will still only communicate back and forth for 7.5 ms each 20th ms (if they use the lowest possible connection interval).&lt;br /&gt;If you set the event length to be equal to the connection interval length, they may communicate all the way up until the next connection event. This is essential for throughput (but consumes more power).&lt;/p&gt;
[quote user="NikolaiDimech98"]the app_adv_interval is how long the data paket takes? or is that the duration.[/quote]
&lt;p&gt;The app_ADV_interval is the advertising interval, which specifies how frequently the device will send out&amp;nbsp;&lt;em&gt;advertising&lt;/em&gt; packets. Once a connection is established, the advertising stops(if the peripheral device only wants to hold 1 concurrent connection).&amp;nbsp;The advertising interval does not matter for the throughput in your connection.&lt;/p&gt;
[quote user="NikolaiDimech98"]so i need to make the pheripheral and client equal parameters and the client paramters are changes in the sdk config header right?[/quote]
&lt;p&gt;The corresponding words are peripheral and central, and client and server, but yes. You need to make sure that the connection parameters are the same on both sides to ensure that the connection will use those specific parameters because the central have to determine them (tell the peripheral what to use), and the peripheral has to accept them (not disconnect).&amp;nbsp;&lt;/p&gt;
[quote user="NikolaiDimech98"]is there a way to measure the sepad of the bluetooth using my oscilloscope.[/quote]
&lt;p&gt;This depends. Without complex monitoring you can use the oscilloscope to measure the activity on the antenna (following all the procedures and using required equipment to measure on the antenna without distorting the signals). This will at least tell you that the devices are filling up their connection event with packets back and forth. It is however not an accurate (by any means) way to measure throughput, since you will not know if a packet is being retransmitted, for example.&lt;br /&gt;To measure throughput you could instead create a setup that always have more data to send, and then see how much data the other device receives in a given timespan. For example, setup a timer that triggers a disconnect (or just logs how much is received) after a given time, starting when the first packet is received. This way, you can much more accurately estimate your throughput.&lt;br /&gt;&lt;br /&gt;However, the method I would recommend you is to setup the sniffer tool that I mentioned earlier, and see the on-air BLE traffic for yourself. This way, you can see exactly what is being sent between the two devices, what connection parameters is being used, how big each packet is, how much of the connection event is spent communication, etc. You would then have the answer to all this, immediately.&lt;br /&gt;If you still dont feel confident that the sniffer is worthwhile to install you should instead do as I detail above and create a setup to measure the achieved throughput - it is not a lot of work (neither is setting up the sniffer).&lt;/p&gt;
[quote user="NikolaiDimech98"]got stuck in the very beiging when it said to open the command promt in the folder.[/quote]
&lt;p&gt;&lt;a href="https://www.google.com/search?q=open+command+prompt+in+folder&amp;amp;rlz=1C1GCEB_enNO889NO889&amp;amp;oq=open+&amp;amp;aqs=chrome.0.69i59j69i57j0j69i59j0j69i60j69i61j69i60.1708j0j7&amp;amp;sourceid=chrome&amp;amp;ie=UTF-8"&gt;You can open a command prompt in a given folder by writing &amp;#39;cmd&amp;#39; into the file explorer address line&lt;/a&gt;. There is also not a lot that needs doing in python, please see the steps detailed &lt;a href="https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/intro.html"&gt;in the nRF Sniffer documentation for details&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/304371?ContentTypeID=1</link><pubDate>Mon, 12 Apr 2021 19:45:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1072d82b-aa1e-4deb-930b-8cbd860c2aeb</guid><dc:creator>NikTheNordicUser</dc:creator><description>&lt;p&gt;Hi , karl , firslt i would like to thank you and i finally solved the error 19 issue , apologies for being unclear at times as i still a student and this project is for my final year project which is due very soon so i may come accross as unclear.&amp;nbsp;now my only &amp;#39;issue&amp;#39; is speed.. as i would like to make it abit faster.&lt;/p&gt;
&lt;p&gt;my current pheripheral settings are as follows&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1618256198095v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;are there any other settings that i may be missing. also just to be sure im understanding the connection interval is the connection between central and pheripheral right? and the app_adv_interval is how long the data paket takes? or is that the duration.&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/73308/ble-lost-messages/304310#304310"]What is your event length?[/quote]
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1618256459107v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;in the peripheral it is set to 6.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/73308/ble-lost-messages/304310#304310"]The central determines the connection parameters. The peripheral may only either accept the parameters that the central send, or disconnect. If there is a mismatch between the preference of the central and the peripheral, the peripheral will send a parameter update request. This request can be declined by the central, and the peripheral may then either accept this or disconnect.[/quote]
&lt;p&gt;to ensure i understood.. so i need to make the pheripheral and client equal parameters and the client paramters are changes in the sdk config header right?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;also is there a way to measure the sepad of the bluetooth using my oscilloscope. you have previously sugggested to download nrf_sniffer and i attempted to but i honeslty couldnt manage to donwloaded as i never used pyton and got stuck in the very beiging when it said to open the command promt in the folder.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;once again i apologies for the constant messages and larger questions&lt;/p&gt;
&lt;p&gt;Thank you in advance&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/304310?ContentTypeID=1</link><pubDate>Mon, 12 Apr 2021 13:48:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf228234-7a4b-4cc0-8359-098ab24e4093</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="NikolaiDimech98"]as previously mentioned i would like to remove the delay such that i make it interrupt based and use the&amp;nbsp;&lt;span&gt;BLE_GATTS_EVT_HVN_TX_COMPLETE event which should ensure no resetting of the mcu .&lt;/span&gt;[/quote]
&lt;p&gt;As previously mentioned you have to implement the handling for the BLE_GATTS_EVT_HVN_TX_COMPLETE event in the ble_evt_handler. For more detail please see the answer by my colleague Einar in &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/73825/error-19-when-calling-ble_nus_data_send"&gt;your other ticket.&lt;/a&gt;&amp;nbsp;If anything still is unclear on how you should proceed with this, please try to be more specific in your questions.&lt;br /&gt;Please try to implement this as I have said previously - when a NRF_ERROR_RESOURCES is returned from ble_app_data_send, have the data placed in a buffer and set a flag to indicate that the buffer holds data. Then implement the BLE_GATTS_EVT_HVN_TX_COMPLETE event that checks whether the buffer holds data, and if it does, queues it for transfer.&lt;br /&gt;Furthermore, the MCU does not&amp;nbsp;&lt;em&gt;have&amp;nbsp;&lt;/em&gt;to reset when the NRF_ERROR_RESOURCES error code is returned from the call to ble_nus_data_send. This is the&amp;nbsp;&lt;em&gt;default error handling&lt;/em&gt; - you are free to implement specific error handling for your specific application, so that the device is able to handle the error without having to reset.&lt;/p&gt;
[quote user="NikolaiDimech98"]but anything i change results in the central not connecting so i am very confused at what is going on and ideally i would like to have the configuration of the fastest transfer[/quote][quote user="NikolaiDimech98"]ideally i would use a throughput of 2 PHy&amp;nbsp;[/quote][quote user="NikolaiDimech98"]i currently have this configuration[/quote]
&lt;p&gt;The central determines the connection parameters. The peripheral may only either accept the parameters that the central send, or disconnect. If there is a mismatch between the preference of the central and the peripheral, the peripheral will send a parameter update request. This request can be declined by the central, and the peripheral may then either accept this or disconnect.&lt;br /&gt;If you with to change your connection parameters you will therefore have to change them on the central side.&lt;br /&gt;Then, you should also update the preference of the peripheral to match the changes you&amp;#39;ve made on the central side, or make sure that the peripheral does not disconnect if its preferences are not met.&lt;br /&gt;If you wish to set the connection interval to a specific number, like 50 ms, then you have to set both _MIN and _MAX to 50 ms, forcing this particular interval.&lt;/p&gt;
[quote user="NikolaiDimech98"]i would like to have a similar approach to&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/64877/high-power-draw-when-sending-multiple-packets-during-one-connection-waiting-for-ble_gatts_evt_hvn_tx_complete-event-to-send-consecutive-packets"&gt;this&lt;/a&gt;, such that i send a packet at a tie will i recive the flag is finished[/quote]
&lt;p&gt;To send multiple notification packets back-to-back in the connection event, the event length needs to be configured to be the same as the connection interval, like mentioned directly before the throughput table you&amp;#39;ve shared a screenshot of. What is your event length?&lt;br /&gt;&lt;br /&gt;Try these two things, and let me know if anything is unclear, or if you encounter any issues.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/304120?ContentTypeID=1</link><pubDate>Sat, 10 Apr 2021 12:12:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:caafd493-51ad-49e4-bc82-bc257098cda0</guid><dc:creator>NikTheNordicUser</dc:creator><description>&lt;p&gt;&amp;nbsp;i would like to have a similar approach to&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/64877/high-power-draw-when-sending-multiple-packets-during-one-connection-waiting-for-ble_gatts_evt_hvn_tx_complete-event-to-send-consecutive-packets"&gt;this&lt;/a&gt;, such that i send a packet at a tie will i recive the flag is finished&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/304119?ContentTypeID=1</link><pubDate>Sat, 10 Apr 2021 09:45:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21b7c814-aa11-4ae0-a2a3-2fc92932dd7f</guid><dc:creator>NikTheNordicUser</dc:creator><description>&lt;p&gt;may someone help me please?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/303959?ContentTypeID=1</link><pubDate>Fri, 09 Apr 2021 10:29:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:76f51bcb-0632-4c49-a1ac-9ffdda426e73</guid><dc:creator>NikTheNordicUser</dc:creator><description>&lt;p&gt;but anything i change results in the central not connecting so i am very confused at what is going on and ideally i would like to have the configuration of the fastest transfer&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/303957?ContentTypeID=1</link><pubDate>Fri, 09 Apr 2021 10:28:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7cca978-f7b0-4a3d-942e-521900f466d0</guid><dc:creator>NikTheNordicUser</dc:creator><description>&lt;p&gt;i currently have this configuration&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1617964126022v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/303855?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2021 16:20:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ad17b5e-4278-453a-a475-a85a8aa84e69</guid><dc:creator>NikTheNordicUser</dc:creator><description>&lt;p&gt;ideally i would use a throughput of 2 PHy&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/303854?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2021 16:17:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b8dc56d-7a5d-44dc-b86d-34816b404e8b</guid><dc:creator>NikTheNordicUser</dc:creator><description>&lt;p&gt;ok so let say i want to have this configuration&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1617898408972v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;is it possible to be shown how or what i would need to change. also as previously mentioned i would like to remove the delay such that i make it interrupt based and use the&amp;nbsp;&lt;span&gt;BLE_GATTS_EVT_HVN_TX_COMPLETE event which should ensure no resetting of the mcu .&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;i would like to transfer a max of 242 bytes at once if possible with an output data rate of max 400 (the sesnor supports a data rate of 2000) but this setting should be enough for my application which setting do you suggest and the connection between the pheripheral and client is always active such that if theres data is constantly sent at the set settings&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/303842?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2021 15:33:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3a963a17-51d1-47c2-a786-58ee7ec50849</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="NikolaiDimech98"]im not sure if wat im saying is understandable.[/quote]
&lt;p&gt;I think I get the picture, but thank you for the understanding.&lt;/p&gt;
[quote user="NikolaiDimech98"]umm.. im not really sure is there a max value ?[/quote]
&lt;p&gt;I dont think there is a max value other than the physical limitations of the SoC - i.e how much RAM do you have to spare?&lt;br /&gt;However, allocating everything that you have spare is not the best approach for this. Rather, you should look at how much that will actually be transferred in each interval.&lt;br /&gt;For example, how much throughput do you need to have all the necessary sensor data sent each second, and how much latency can you have in your system?&lt;br /&gt;If you group multiple measurements together up till the MTU size, and increase the connection event lengths, you will be able to send multiple larger packets per connection interval, for instance.&lt;br /&gt;But, in order to determine what configuration you should use, you need to know more exactly how many bytes you intend to transfer, and how often you intend to transfer them.&lt;br /&gt;You could take a look at t&lt;a href="https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/ble_data_throughput/ble_data_throughput.html"&gt;he BLE throughput tables in the SoftDevice docuementation&lt;/a&gt;&amp;nbsp;to determine the best connection parameters and configuration for your application.&lt;br /&gt;&lt;br /&gt;It could also be helpful for you to check out the&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/power/w/opp/2/online-power-profiler-for-ble"&gt;the Online Power Profiler&lt;/a&gt;&amp;nbsp;to visualize how each transfer will happen, with the different connection configurations.&lt;br /&gt;&lt;br /&gt;Please do not hesitate to ask if any part of my answer should be unclear!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/303824?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2021 14:31:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:662bd8fa-9457-43a3-8d56-eb4b7806a932</guid><dc:creator>NikTheNordicUser</dc:creator><description>[quote userid="87869" url="~/f/nordic-q-a/73308/ble-lost-messages/303793#303793"]How many notifications do you intend to queue between each connection event?[/quote]
&lt;p&gt;umm.. im not really sure is there a max value ? My application requires for fast transfer as i mentioned in the very begining the pheripheral board contains a gyro and acc sensor which communicates via spi and this pheripheral board sits on a motor such that i measure RPM in matlab after the hex data of sensor is sent via ble to the client pcb. is there a max number of queue as ideally meanwhile i am filling up the sending buffer with the spi data i would be sending a previously filled buffer. thats why i would like to monitor the ble gatts event tx complete flag such that i can remove all delays and ensure that data is fully sent and there are no queuse before i send another buffer&lt;/p&gt;
&lt;p&gt;im not sure if wat im saying is understandable.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/303793?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2021 13:21:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:468fc82e-0d83-4ccd-ada6-2a118081155f</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="NikolaiDimech98"]i found that in the ble_gatts.h (of the pheripheral code) it is set as 1[/quote]
&lt;p&gt;So there is only space to queue 1 notification for transfer before you will generate the NRF_ERROR_RESOURCES.&lt;br /&gt;How many notifications do you intend to queue between each connection event?&lt;/p&gt;
[quote user="NikolaiDimech98"]is it possible to maybe show me how ? please[/quote][quote user="Karl Ylvisaker"]The&amp;nbsp;ble_evt_handler is passed all the SoftDevice events. You could implement the logic for the BLE_GATTS_EVT_HVN_TX_COMPLETE here.[/quote]
&lt;p&gt;Add a case for this event into the ble_evt_handler, then implement the logic you would like to have happen when this event is generated. What do you intend to have happen when this event is generated?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/303789?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2021 13:17:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cda62b90-8d7d-43d0-8a60-1f2fe3de6b60</guid><dc:creator>NikTheNordicUser</dc:creator><description>[quote userid="87869" url="~/f/nordic-q-a/73308/ble-lost-messages/303777#303777"]What is your current size of&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.2.0/group___b_l_e___g_a_t_t_s___d_e_f_a_u_l_t_s.html#gadeb57ec178918eea438c8b4a4944ebd2"&gt;BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT&lt;/a&gt;?[/quote]
&lt;p&gt;i found that in the ble_gatts.h (of the pheripheral code) it is set as 1&lt;/p&gt;
&lt;p&gt;&lt;img height="52" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1617887788293v1.png" width="489" alt=" " /&gt;&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/73308/ble-lost-messages/303777#303777"]You could implement the logic for the BLE_GATTS_EVT_HVN_TX_COMPLETE here.[/quote]
&lt;p&gt;is it possible to maybe show me how ? please&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/303777?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2021 12:51:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc23e5de-7e31-4ce2-9909-9291dacc2008</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="NikolaiDimech98"]uint32_t err_code2 =ble_nus_data_send(&amp;amp;m_nus,send_buffer3, &amp;amp;length3, m_conn_handle);&amp;nbsp; line 910&lt;br /&gt; APP_ERROR_CHECK(err_code2); line 911[/quote]
&lt;p&gt;Thanks. So, now we know both which function that returned the error, and which error it returned.&lt;br /&gt;Looking into the source code of ble_nus_data_send, we see that it forwards error codes from &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v7.2.0%2Fgroup___b_l_e___g_a_t_t_s___f_u_n_c_t_i_o_n_s.html&amp;amp;anchor=ga313fe43c2e93267da668572e885945db"&gt;sd_ble_gatts_hvx&lt;/a&gt;. Then we check why the sd_ble_gatts_hvx would return the NRF_ERROR_RESOURCES error, the exempt from the API Reference reads:&lt;/p&gt;
&lt;table&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td colspan="1" rowspan="1"&gt;&lt;a title="Not enough resources for operation." href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.2.0/group__nrf__error.html#gac94383171545e604e8347a044e8be13f"&gt;NRF_ERROR_RESOURCES&lt;/a&gt;&lt;/td&gt;
&lt;td colspan="1" rowspan="1"&gt;Too many notifications queued. Wait for a&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.2.0/group___b_l_e___g_a_t_t_s___e_n_u_m_e_r_a_t_i_o_n_s.html#ggae537647902af1b05c1e32f12d6b401c7afab96bfa9918017082235f7664919f9d"&gt;BLE_GATTS_EVT_HVN_TX_COMPLETE&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;event and retry.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;So we know that we need to wait for an BLE_GATTS_EVT_HVN_TX_COMPLETE event before we queue more data for transfer. We also read from the note section that &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v7.2.0%2Fstructble__gatts__conn__cfg__t.html&amp;amp;anchor=ae2a1156d8b06a6ccc70696f2372226cc"&gt;the hvx_queue size can be changed&lt;/a&gt;&amp;nbsp;to accommodate for more samples queued for transfer before the NRF_ERROR_RESOURCES is generated.&lt;br /&gt;What is your current size of&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v7.2.0/group___b_l_e___g_a_t_t_s___d_e_f_a_u_l_t_s.html#gadeb57ec178918eea438c8b4a4944ebd2"&gt;BLE_GATTS_HVN_TX_QUEUE_SIZE_DEFAULT&lt;/a&gt;?&lt;br /&gt;If you know how many notifications will be queued between each connection event, you could set this buffer to at least be able to hold this number of notifications (plus a couple more for good measure in case of re-transmissions).&lt;/p&gt;
[quote user="NikolaiDimech98"]can you show me how i need to use it and wherre i need to place this event please.[/quote]
&lt;p&gt;The&amp;nbsp;ble_evt_handler is passed all the SoftDevice events. You could implement the logic for the BLE_GATTS_EVT_HVN_TX_COMPLETE here.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/303743?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2021 11:31:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44e7aaf6-4560-4861-a9dd-270816254cc6</guid><dc:creator>NikTheNordicUser</dc:creator><description>[quote userid="87869" url="~/f/nordic-q-a/73308/ble-lost-messages/303709#303709"]Yes, and which function return the error code that fails this APP_ERROR_CHECK?[/quote]
&lt;p&gt;uint32_t err_code2 =ble_nus_data_send(&amp;amp;m_nus,send_buffer3, &amp;amp;length3, m_conn_handle);&amp;nbsp; line 910&lt;br /&gt; APP_ERROR_CHECK(err_code2); line 911&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/73308/ble-lost-messages/303709#303709"]Is the client encountering any errors? Are you saying that the code we are looking at right now is for the peripheral - but that the resetting happens on the central, and not on the peripheral?[/quote]
&lt;p&gt;yes exactly that , the central doesnt seem to return error codes but when it resets it gets stuck in a nrf_breakpoint_condition&amp;nbsp;&lt;/p&gt;
[quote userid="87869" url="~/f/nordic-q-a/73308/ble-lost-messages/303709#303709"]Calling ble_nus_data_send queues data for sending as a notification during the next connection event. However, if you try to queue too many notifications too fast, the ble_nus_data_send function will return NRF_ERROR_RESOURCES, indicating that its buffer is full, and that the call to queue data failed.&lt;br /&gt;You may then use the BLE_GATTS_EVT_HVN_TX_COMPLETE event to know when a notification successfully has been sent - meaning that you may now queue another notification for transfer, because it is now room in the buffer.[/quote]
&lt;p&gt;can you maybe show me how i can do this , such that i can do a while loop to wait for the tx buffer to be sent to ensure i dont queue too many notifications. can you show me how i need to use it and wherre i need to place this event please.&lt;/p&gt;
&lt;p&gt;you think this could work?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE lost messages</title><link>https://devzone.nordicsemi.com/thread/303709?ContentTypeID=1</link><pubDate>Thu, 08 Apr 2021 10:32:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:483cc9d2-53ee-43c0-888e-7d20c3c8b66e</guid><dc:creator>Karl Ylvisaker</dc:creator><description>[quote user="NikolaiDimech98"]yes i understood now, thank you[/quote]
&lt;p&gt;Great! Thank you for confirming :)&amp;nbsp;&lt;/p&gt;
[quote user="NikolaiDimech98"]i changes some of the code and the error is now at line 911 and at this point i have the funcction app_error_chcek[/quote]
&lt;p&gt;Yes, and which function return the error code that fails this APP_ERROR_CHECK?&amp;nbsp;&lt;/p&gt;
[quote user="NikolaiDimech98"]ideally i dont have any delays however by having a large enouugh delay it results in a less probability of the client mcu resetting.[/quote]
&lt;p&gt;This is just treating the symptoms of the error - we should instead focus on identifying and resolving the root of the error itself.&lt;/p&gt;
[quote user="NikolaiDimech98"]what im not understanding is that the code im alteringis the pherihperal code but it seems that the client is the one being effected and resetting&amp;nbsp;[/quote]
&lt;p&gt;Is the client encountering any errors? Are you saying that the code we are looking at right now is for the peripheral - but that the resetting happens on the central, and not on the peripheral?&lt;/p&gt;
[quote user="NikolaiDimech98"]&lt;p&gt;this will thus result in a perfect harmony and would probably be the most efficient.&lt;/p&gt;
&lt;p&gt;i think that the interupt of a ble tx ready is called&amp;nbsp;BLE_GATTS_EVT_HVN_TX_COMPLETE but im not sure where to place it and how to use it unfortunetly&lt;/p&gt;[/quote][quote user="NikolaiDimech98"]and maybe i could somehow ensure that the tx buffer of the ble is empty such that i dont ever overfill and lose data[/quote]
&lt;p&gt;Calling ble_nus_data_send queues data for sending as a notification during the next connection event. However, if you try to queue too many notifications too fast, the ble_nus_data_send function will return NRF_ERROR_RESOURCES, indicating that its buffer is full, and that the call to queue data failed.&lt;br /&gt;You may then use the BLE_GATTS_EVT_HVN_TX_COMPLETE event to know when a notification successfully has been sent - meaning that you may now queue another notification for transfer, because it is now room in the buffer.&lt;br /&gt;&lt;br /&gt;It is not really an issue to get the NRF_ERROR_RESOURCES, it just means that the call to queue data for transfer failed because the buffer is full. The returned error code lets us know that the program can not proceed as usual - instead, we must do some sort of error handling to bring the application back on track.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>