<?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 connection stability</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66424/ble-connection-stability</link><description>Hello, 
 I would appreciate some guidance about BLE connection stability. Our product is a system of 3 peripherals (custom board with Laird&amp;#39;s BL652 module, containing nRF52832) all simultaneously connected to our iOS app (central). The peripheral application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 16 Oct 2020 07:32:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66424/ble-connection-stability" /><item><title>RE: BLE connection stability</title><link>https://devzone.nordicsemi.com/thread/275257?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 07:32:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4697dfa9-7bbb-4aa2-a896-db1d36a7da2e</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Most of this seems right, but a few corrections:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Tim123"]A connection event is always 7.5 ms. So a larger connection interval means more idle time between connection events. This can be helpful when BLE coexists with timeslot API activity, as in our case.[/quote]
&lt;p&gt;&amp;nbsp;This is not necessarily true. Typically, a connection event is only a couple of ms (with little payload), and up to the entire connection event, depending on the connection parameters, and the payload.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can check it out here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/power/w/opp/2/online-power-profiler-for-ble"&gt;https://devzone.nordicsemi.com/nordic/power/w/opp/2/online-power-profiler-for-ble&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Tim123"]S110 has 6 tx buffers. Is this true also for S112 v6.1.1?[/quote]
&lt;p&gt;&amp;nbsp;It really depends on the packet size. You can fill it with one long notification as well.&lt;/p&gt;
&lt;p&gt;While I believe it is possible to increase this queue size, that is rarely the solution, as it will just move the queue from one location to another. Keep track of what packets you have been able to queue. As long as the function you use to queue returns NRF_SUCCESS, it is queued and will be sent. You can forget the payload from your application side. If it returns NRF_ERROR_RESOURCES, it means that the packet didn&amp;#39;t fit in the queue, and it was not queued. In this case, you must wait for the next&amp;nbsp;BLE_GATTS_EVT_HVN_TX_COMPLETE event. This means that a packet from your softdevice queue was acked, and it has room for more data. At this point you can call the function that calls sd_ble_gatts_hvx() function again.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection stability</title><link>https://devzone.nordicsemi.com/thread/275236?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 03:17:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e47b55aa-8181-4c39-a491-08a74d0afecb</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Thanks Edvin. Testing has been going well. Thanks to your help, I have a better understanding of some of the interaction between central and peripheral. Some of my current assumptions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A&amp;nbsp;link between central and peripheral is always initially PHY 1MBPS. Then if the central supports it (i.e. BLE 5.0 or later), it will send a&amp;nbsp;BLE_GAP_EVT_PHY_UPDATE_REQUEST to the peripheral and the peripheral can update PHY to any of the available options (AUTO, 1MBPS, 1MBPS, CODED). For our application, range is more important than throughput, so we set to 1MBPS.&lt;/li&gt;
&lt;li&gt;It seems that the initial connection interval when connecting peripheral with iOS central is always 30 ms. If connection parameter negotiation offers&amp;nbsp;minimum interval of 30 ms with any&amp;nbsp;maximum (always needs to be multiple of 15 ms), iOS will always select 30 ms. However, if peripheral offers minimum greater than 30 ms (e.g. 45, 60, 75, etc.) and a maximum greater than that, iOS will always choose the maximum. I&amp;#39;ve tested up to a&amp;nbsp;maximum of 120 ms.&lt;/li&gt;
&lt;li&gt;A connection event is always 7.5 ms. So a larger connection interval means more idle time between connection events. This can be helpful when BLE coexists with timeslot API activity, as in our case.&lt;/li&gt;
&lt;li&gt;Yes, &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/37406/why-is-first_conn_params_update_delay-set-to-multiseconds-in-most-examples/144087#144087" rel="noopener noreferrer" target="_blank"&gt;this post&lt;/a&gt; says connection parameter negotiation occurs 5 seconds after connection (in many examples) to be sure service discovery has completed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/1995/rx-tx-buffers-in-s110" rel="noopener noreferrer" target="_blank"&gt;This post&lt;/a&gt; says S110 has 6 tx buffers. Is this true also for S112 v6.1.1?&amp;nbsp;&lt;span&gt;Rarely does our application&amp;nbsp;&lt;/span&gt;&lt;span&gt;call&amp;nbsp;&lt;/span&gt;&lt;span&gt;sd_ble_gatts_hvx() more than twice in quick succession.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Recently we&amp;#39;ve been testing with connection interval of 120 ms.&amp;nbsp;Our application uses the timeslot API for radio use between BLE activity. I presume that a larger connection interval makes it easier for time slots to be successfully scheduled, correct?&lt;/p&gt;
&lt;p&gt;Many thanks Edvin.&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection stability</title><link>https://devzone.nordicsemi.com/thread/273114?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2020 08:16:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db28e677-f0b1-46b9-b893-d31a9c1f6bcb</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Tim,&lt;/p&gt;
&lt;p&gt;That is good. I thought iPhones just set it to 30ms no matter what connection interval you used. So if you are able to set it higher, it will reduce the current consumption. Please note that it will also increase the latency of the link.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Remember that when you increase the connection interval, you may also want to increase the supervision timeout. If you have a connection interval of 60ms, and a supervision timeout of 600ms (just random numbers) you can miss 10 packets before a disconnect, while if you increase the connection interval to 120ms, you can only miss 5.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Tim123"]What is the&amp;nbsp;reason for the 5 second delay before calling&amp;nbsp;sd_ble_gap_conn_param_update() in ble_app_uart example of SDK 15.3.0 (FIRST_CONN_PARAMS_UPDATE_DELAY = 5s)?[/quote]
&lt;p&gt;&amp;nbsp;I don&amp;#39;t remember exactly the reason, but there is something that we want to let finish before we start this. I believe it is the service discovery that we want the central to be able to perform before we change the connection interval.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection stability</title><link>https://devzone.nordicsemi.com/thread/273075?ContentTypeID=1</link><pubDate>Tue, 06 Oct 2020 05:58:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5554a83-91fe-48d9-bcad-c17cc172c8ef</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve discovered that with iPhone/iOS, if slave requests minimum connection interval is 30ms, then you&amp;#39;ll always get 30ms regardless of what maximum interval is. However, if minimum interval is 45ms or higher (needs to be multiple of 15 to meet Apple requirements), then you&amp;#39;ll get whatever the specified maximum interval is. I&amp;#39;ve tested on both old iPhone (4s) and new (iPhone SE (2020)) and observe this behaviour.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve attached two traces.&amp;nbsp;conn_intervals_30-105.pcapng uses min 30, max 105. Notice no connection parameter update request, and the initial CONNECT_REQ packet shows 30ms interval.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/conn_5F00_intervals_5F00_30_2D00_105.pcapng"&gt;devzone.nordicsemi.com/.../conn_5F00_intervals_5F00_30_2D00_105.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/conn_5F00_intervals_5F00_45_2D00_105.pcapng"&gt;devzone.nordicsemi.com/.../conn_5F00_intervals_5F00_45_2D00_105.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;conn_intervals_45-105.pcapng uses min 45, max 105. Notice connection parameter request from the slave at packet no. 734, then the response at no. 735 with move result &amp;quot;Accepted&amp;quot;. Then no. 757 LL_CONNECTION_UPDATE_REQ showing interval of 84, which is 105ms.&lt;/p&gt;
&lt;p&gt;In most recent tests the connection instability previously experienced was gone. Two things changed:&lt;/p&gt;
&lt;p&gt;- used connection interval of 120ms&lt;/p&gt;
&lt;p&gt;- switched from 2MBPS to 1MBPS PHY&lt;/p&gt;
&lt;p&gt;Given&amp;nbsp;high throughput is not a requirement, thought to go with min 60 and max 105. Reasonable?&lt;/p&gt;
&lt;p&gt;What is the&amp;nbsp;reason for the 5 second delay before calling&amp;nbsp;sd_ble_gap_conn_param_update() in ble_app_uart example of SDK 15.3.0 (FIRST_CONN_PARAMS_UPDATE_DELAY = 5s)?&lt;/p&gt;
&lt;p&gt;Many thanks,&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection stability</title><link>https://devzone.nordicsemi.com/thread/272759?ContentTypeID=1</link><pubDate>Fri, 02 Oct 2020 13:51:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5da8f2cb-e2f1-4e21-afa9-6c46ff8d04bb</guid><dc:creator>Edvin</dc:creator><description>[quote user="Tim123"]Given throughput is not important, power consumption is not important (peripheral devices powered by 2 AA batteries), but&amp;nbsp;reliable use with Timeslot API is important, what min/max connection intervals would you recommend?[/quote]
&lt;p&gt;&amp;nbsp;If your central is always an iPhone it doesn&amp;#39;t really matter. Set min = 30ms and max = 100ms. You will get 30ms either way. If you set max=100ms, and Apple one day in the future supports &amp;gt;30ms, you will save some battery.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Tim123"]How do I attain a higher connection interval if &amp;nbsp;iOS always denies and uses 30 ms?[/quote]
&lt;p&gt;You can&amp;#39;t. It is always the Central that controls this parameter. As you mentioned in the previous reply, you can request changes, but it is the central that has the final saying. The only thing the peripheral can do is to disconnect if you don&amp;#39;t get the connection parameters you desire, but I guess you don&amp;#39;t really want to do that.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Tim123"]Is there a way a peripheral application can read the connection interval in use for debug logging?[/quote]
&lt;p&gt;&amp;nbsp;I guess it says in the connected event and in the connection parameter update event.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Check out the parameters in this struckt in the BLE_GAP_EVT_CONNECTED:&lt;/p&gt;
&lt;p&gt;p_ble_evt-&amp;gt;evt.gap_evt.params.connected.conn_params... [min_conn_interval, max_conn_interval_slave_latency, conn_sup_timeout]&lt;/p&gt;
&lt;p&gt;And check out the parameters in this struct in BLE_GAP_EVT_CONN_PARAM_UPDATE event:&lt;/p&gt;
&lt;p&gt;p_ble_evt-&amp;gt;evt.gap_evt.params.conn_param_update.conn_params... [the same parameters as the BLE_GAP_EVT_CONNECTED event]&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Tim123"]but then the LL_PHY_UPDATE_IND packets from the master show False for all modes.[/quote]
&lt;p&gt;&amp;nbsp;I believe this packet is just an &amp;quot;abort&amp;quot; message for the phy change. It also says &amp;quot;instance: 0&amp;quot;. Instance refers to the event counter that these changes shall be enforced. If you want to monitor the changes from the application, check out the&amp;nbsp;BLE_GAP_EVT_PHY_UPDATE_REQUEST and&amp;nbsp;BLE_GAP_EVT_PHY_UPDATE_REQUEST events (look for the parameters like you do for the connected and conn_param_update events).&lt;/p&gt;
&lt;p&gt;The BLE_GAP_EVT_PHY_UPDATE_REQUEST event will contain the phy parameters that the central requests, and if you get the BLE_GAP_EVT_PHY_UPDATE event, it means that the PHY is updated, and the event contains the new PHY.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection stability</title><link>https://devzone.nordicsemi.com/thread/272728?ContentTypeID=1</link><pubDate>Fri, 02 Oct 2020 12:28:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e02ead5-864c-4d58-95ab-c556824bd7e2</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Thanks Edvin. Given throughput is not important, power consumption is not important (peripheral devices powered by 2 AA batteries), but&amp;nbsp;reliable use with Timeslot API is important, what min/max connection intervals would you recommend?&lt;/p&gt;
&lt;p&gt;I find it odd that when I used:&lt;/p&gt;
&lt;p&gt;#define MIN_CONN_INTERVAL MSEC_TO_UNITS(60, UNIT_1_25_MS)&lt;br /&gt;#define MAX_CONN_INTERVAL MSEC_TO_UNITS(120, UNIT_1_25_MS)&lt;br /&gt;#define SLAVE_LATENCY 0&lt;br /&gt;#define CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS)&lt;br /&gt;#define FIRST_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(5000)&lt;br /&gt;#define NEXT_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(30000)&lt;br /&gt;#define MAX_CONN_PARAMS_UPDATE_COUNT 3&lt;/p&gt;
&lt;p&gt;the CONNECT_REQ packet in sniffer trace still showed connection interval of 30 ms:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Bluetooth Low Energy Link Layer&lt;/code&gt;&lt;br /&gt;&lt;code&gt;    Access Address: 0x8e89bed6&lt;/code&gt;&lt;br /&gt;&lt;code&gt;    Packet Header: 0x22c5 (PDU Type: CONNECT_REQ, ChSel: #1, TxAdd: Random, RxAdd: Random)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;    Initator Address: 5e:94:05:58:20:fc (5e:94:05:58:20:fc)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;    Advertising Address: d5:88:07:32:7a:ad (d5:88:07:32:7a:ad)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;    Link Layer Data&lt;/code&gt;&lt;br /&gt;&lt;code&gt;        Access Address: 0xaf9aa3de&lt;/code&gt;&lt;br /&gt;&lt;code&gt;        CRC Init: 0x9ef18e&lt;/code&gt;&lt;br /&gt;&lt;code&gt;        Window Size: 3 (3.75 msec)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;        Window Offset: 6 (7.5 msec)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;        Interval: 24 (30 msec)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;        Latency: 0&lt;/code&gt;&lt;br /&gt;&lt;code&gt;        Timeout: 72 (720 msec)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;        Channel Map: ff07c0f81f&lt;/code&gt;&lt;br /&gt;&lt;code&gt;        ...1 0000 = Hop: 16&lt;/code&gt;&lt;br /&gt;&lt;code&gt;        001. .... = Sleep Clock Accuracy: 151 ppm to 250 ppm (1)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;        CRC: 0xadcae0&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(This is packet 2215 of sniffer trace attached above.) This was for one of the 9 connected peripherals and it was the last peripheral to connect. As far as I can tell, the above defines respect Apple&amp;#39;s requirements:&lt;/p&gt;
&lt;ul class="ul"&gt;
&lt;li class="li"&gt;
&lt;p&gt;Interval Min &amp;ge; 15 ms (multiples of 15 ms)&lt;/p&gt;
&lt;/li&gt;
&lt;li class="li"&gt;
&lt;p&gt;Interval Min + 15 ms &amp;le; Interval Max (Interval Max == 15 ms is allowed)&lt;/p&gt;
&lt;/li&gt;
&lt;li class="li"&gt;
&lt;p&gt;Interval Max * (Slave Latency + 1) &amp;le; 2 seconds&lt;/p&gt;
&lt;/li&gt;
&lt;li class="li"&gt;
&lt;p&gt;Interval Max * (Slave Latency + 1) * 3 &amp;lt; connSupervisionTimeout&lt;/p&gt;
&lt;/li&gt;
&lt;li class="li"&gt;
&lt;p&gt;Slave Latency &amp;le; 30&lt;/p&gt;
&lt;/li&gt;
&lt;li class="li"&gt;
&lt;p&gt;2 seconds &amp;le; connSupervisionTimeout &amp;le; 6 seconds&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;How do I attain a higher connection interval if &amp;nbsp;iOS always denies and uses 30 ms?&lt;/p&gt;
&lt;p&gt;Is there a way a peripheral application can read the connection interval in use for debug logging?&lt;/p&gt;
&lt;p&gt;Lastly, in sniffer trace, how do I verify what PHY setting is used for the link? In the attached trace, I see packet 2235 is the slave/peripheral stating it prefers LE 1M PHY, but then the LL_PHY_UPDATE_IND packets from the master show False for all modes.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8688.sniffer-trace_2D00_4.pcapng"&gt;devzone.nordicsemi.com/.../8688.sniffer-trace_2D00_4.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Many thanks,&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection stability</title><link>https://devzone.nordicsemi.com/thread/272673?ContentTypeID=1</link><pubDate>Fri, 02 Oct 2020 08:52:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4909c05-e862-466a-9156-23362d7b399b</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;By default the nRF will advertise using 1MBPS (according to the BLE specification). After this, any of the devices may request a PHY change.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Tim123"]Is it guaranteed that&amp;nbsp;ble_evt_handler(...) will be called with the BLE_GAP_EVT_PHY_UPDATE_REQUEST event?[/quote]
&lt;p&gt;&amp;nbsp;Yes. This is what triggers the response.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Tim123"]Should I also call&amp;nbsp;sd_ble_gap_phy_update(...) when the BLE_GAP_EVT_CONNECTED event occurs?[/quote]
&lt;p&gt;&amp;nbsp;Not unless you want to change the PHY. There is no point in updating the PHY if you are already on the PHY that you would like to stay on. Calling sd_ble_gap_phy_update(...)&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Tim123"]Can the central refuse to&amp;nbsp;honour the&amp;nbsp;sd_ble_gap_phy_update(...) request?[/quote]
&lt;p&gt;&amp;nbsp;No, but it can reply that it doesn&amp;#39;t support 2MBPS, and the devices will stay on 1MBPS.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Tim123"]I realize that connection parameters can be requested by the peripheral but the central decides&amp;nbsp;which parameters to use. In the attached sniffer trace, the connection interval is 30ms, even though min/max connection interval were 60/120.[/quote]
&lt;p&gt;&amp;nbsp;That is correct, and phones act differently. Most Androids and iPhones use only two connection intervals, 15ms or 30ms, so this next section may not be that useful for you.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In your case, where you don&amp;#39;t need a lot of throughput, you may turn the connection interval up, as this would mean less radio activity, which again means a lower current consumption. However, a higher connection also means a higher latency.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Supervision Timeout/Connection interval is the number of packets you can drop before it leads to a disconnection with reason 0x08, which is also a thing you should consider.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;A large connection interval also makes it easier for the timeslot API to get their timeslots.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection stability</title><link>https://devzone.nordicsemi.com/thread/272646?ContentTypeID=1</link><pubDate>Fri, 02 Oct 2020 04:55:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5f6a03a-3249-4c04-8a85-93e29ba08f78</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Thanks Edvin. I tried using 1 MBPS and it reduced disconnect errors to zero. Sniffer trace (attached) shows very few dropped packets. This was with same test scenario: 9 peripherals, sets of 3 connected to 3 central devices. I understand 2 MBPS came with BLE 5.0. Only one of the central (iOS) devices supports BLE 5.0. The other two support 4.2. So in the previous test (many disconnect errors), 3 of 9 peripheral links were 2 MBPS and 6 of the 9 were 1 MBPS.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/sniffer-trace_2D00_4.pcapng"&gt;devzone.nordicsemi.com/.../sniffer-trace_2D00_4.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Is it guaranteed that&amp;nbsp;ble_evt_handler(...) will be called with the BLE_GAP_EVT_PHY_UPDATE_REQUEST event? Should I also call&amp;nbsp;sd_ble_gap_phy_update(...) when the BLE_GAP_EVT_CONNECTED event occurs? Can the central refuse to&amp;nbsp;honour the&amp;nbsp;sd_ble_gap_phy_update(...) request?&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;initial test (today) was with min/max connection interval set to 30/75ms (zero disconnect errors). I increased to 60/120 and same good results. I don&amp;#39;t know how to choose optimal min/max connection intervals given use case. Data throughput is not important, and only small amounts of data (&amp;lt;18 bytes) are sent either direction. Any advantages, other than data throughput, of low connection intervals? BLE needs to play well with Timeslot API. I realize that connection parameters can be requested by the peripheral but the central decides&amp;nbsp;which parameters to use. In the attached sniffer trace, the connection interval is 30ms, even though min/max connection interval were 60/120.&lt;/p&gt;
&lt;p&gt;Thanks for your explanation about supervision&amp;nbsp;timeout. I understand.&lt;/p&gt;
&lt;p&gt;Many thanks,&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection stability</title><link>https://devzone.nordicsemi.com/thread/272593?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2020 14:36:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0851cac0-0a99-42f6-b77a-f5e9660c3c89</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;You can increase the supervision timeout, but consider what this really does. All it does is changing from a connected to a disconnected state after the supervision timeout has expired. If that works in your case, you may try this. But the reason for your timeouts is that the devices hasn&amp;#39;t been able to communicate for 720ms. Setting the supervision timeout to e.g. 4 seconds will increase the time it takes to disconnect by timeout, but it still means that you loose packets. Disconnecting and reconnecting isn&amp;#39;t really an issue in itself, but if it soothes your mind that the devices is connected at all times if you increase the supervision timeout, then go ahead.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;NB: By default, all the examples in the SDK has a supervision timeout of 4 seconds.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Tim123"]3 devices max is typical, but sometimes there can be 6 or even 9.[/quote]
&lt;p&gt;&amp;nbsp;If you intend to have 9 connected devices, I would look into increasing the connection interval. One connection event takes a couple of ms, so 3 connections per 30ms is not a problem, but if the central spends over half the time on the radio supporting all the links, then you may encounter more packet loss, due to timeslot collisions. Please check out how long the central spends on one connection per connection interval using the online power profiler:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/power/w/opp/2/online-power-profiler-for-ble"&gt;https://devzone.nordicsemi.com/nordic/power/w/opp/2/online-power-profiler-for-ble&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection stability</title><link>https://devzone.nordicsemi.com/thread/272523?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2020 12:38:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:154a0181-573e-410e-bfd6-8ffe9006c9e5</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Thanks Edvin. I will try changing to 1MBPS. I presume I should also change to 1MBPS for the radio configuration of the time sync code that uses Timeslot API to sync clocks?&lt;/p&gt;
&lt;p&gt;Yes, all devices are in the same large room (160 x 120 square feet), no interior walls. For my current testing, all devices are near one wall.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll try 1MBPS next. Would it also be worthwhile to increase the minimum connection interval? Supervisor timeout? 3 devices max is typical, but sometimes there can be 6 or even 9.&lt;/p&gt;
&lt;p&gt;Could caps of too low value (12 pf instead of 20) cause the issue? We will change to 20. I&amp;rsquo;ll check with our engineer about R10.&lt;/p&gt;
&lt;p&gt;Many thanks Edvin,&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection stability</title><link>https://devzone.nordicsemi.com/thread/272478?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2020 10:36:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51a9b9f3-0ab7-4ad4-a106-01f74a2338ff</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Ok, so the timeout reasons are:&lt;/p&gt;
&lt;p&gt;0x08:&amp;nbsp;BLE_HCI_CONNECTION_TIMEOUT&lt;br /&gt;0x3E:&amp;nbsp;BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED&lt;br /&gt;0x28:&amp;nbsp;BLE_HCI_INSTANT_PASSED&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;0x3E means that the devices failed to connect, which can also be caused by packet loss.&lt;/p&gt;
&lt;p&gt;0x28 means that some change that was supposed to happen (e.g. channel map update or connection parameter update) was not Acked until the instant they were supposed to take place.&lt;/p&gt;
&lt;p&gt;All of these can occur if you struggle with packet loss.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regarding the PCB layout. The capacitors C6 and C7 should have the value:&lt;/p&gt;
&lt;p&gt;C = 2*Cl - Cpin - Cpcb&lt;/p&gt;
&lt;p&gt;where Cl = capacitance of the LFXTAL (Y1), Cpin = the capacitance of the pin, which is 4pF on the nRF52832 and Cpcb is the capacitance on the PCB trace. Typically between 0 and 1pF.&lt;/p&gt;
&lt;p&gt;From the datasheet of your XTAL, it has 12.5pF, so in your case the capacitors should have: C = 2*12.5 - 4&amp;nbsp; - 0 = 21pF. Standard capacitors are either 20 or 22, so you should go with 20 pF Capacitors (allowing 1 pF in the PCB trace). Regarding the R10 (10MOhm) I am not sure. It is not present in the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/ref_circuitry.html?cp=4_2_0_52_0#schematic_qfn48_ldo"&gt;reference layout&lt;/a&gt;. I see it has a large resistance, but I don&amp;#39;t know what effect it has. Do you know why it was added?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As I can see you are not sending a lot of packets, and you are using 30ms connection interval. If you only have 3 connections that should be plenty of time.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I did however notice that you are using 2MBPS. This is not great for longer ranges. I suggest that you set 1MBPS. Depending on what SDK you are using, this is set a bit differently.&lt;/p&gt;
&lt;p&gt;Try changing:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
        {
            NRF_LOG_DEBUG(&amp;quot;PHY update request.&amp;quot;);
            ble_gap_phys_t const phys =
            {
                .rx_phys = BLE_GAP_PHY_AUTO,
                .tx_phys = BLE_GAP_PHY_AUTO,
            };
            err_code = sd_ble_gap_phy_update(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, &amp;amp;phys);
            APP_ERROR_CHECK(err_code);
        } break;
        
//to:

case BLE_GAP_EVT_PHY_UPDATE_REQUEST:
        {
            NRF_LOG_DEBUG(&amp;quot;PHY update request.&amp;quot;);
            ble_gap_phys_t const phys =
            {
                .rx_phys = BLE_GAP_PHY_1MBPS,
                .tx_phys = BLE_GAP_PHY_1MBPS,
            };
            err_code = sd_ble_gap_phy_update(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, &amp;amp;phys);
            APP_ERROR_CHECK(err_code);
        } break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2MBPS has a shorter range than 1MBPS, and since you are not sending a lot of payload data, this may be better in your case, if you have long distances.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Tim123"]With 9 peripherals connected to 3 centrals (3 peripherals to each central (iOS device)), the disconnects occurred often for one particular peripheral (once every minute or two). The 3 peripherals connected to a central are separated by maximum&amp;nbsp;140 feet in open space. The centrals (iOS devices) were sitting at most 100 feet from the farthest peripheral. I noticed that often as I walked up to the centrals, a disconnect would occur. It seemed that when the space had other people (8-10 people) present, disconnects occurred more frequently.[/quote]
&lt;p&gt;&amp;nbsp;Reasons for packet loss:&lt;/p&gt;
&lt;p&gt;- Too long distance, so the signal strength is too low.&lt;/p&gt;
&lt;p&gt;- Obstances, such as walls, and people (The human body is mostly water, which absorbs the 1.4GHz radio signals)&lt;/p&gt;
&lt;p&gt;- Noise (a little bit from other BLE connections, but not much, as they are using different channels. Wifi is a causing more noise).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Try changing to 1MBPS, and see if that helps. Are all the devices in the same room, or are there many walls in between the devices?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection stability</title><link>https://devzone.nordicsemi.com/thread/272406?ContentTypeID=1</link><pubDate>Thu, 01 Oct 2020 06:01:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ee1a2fe-d492-4e2b-8116-6e9fbdb1d27f</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Thanks Edvin,&lt;/p&gt;
&lt;p&gt;Today I confirmed that when random disconnects occur, it is not because the nRF is crashing and resetting. I logged the following reason codes:&amp;nbsp;0x08, 0x3E, 0x28 with 0x08 being&amp;nbsp;the most common. With 9 peripherals connected to 3 centrals (3 peripherals to each central (iOS device)), the disconnects occurred often for one particular peripheral (once every minute or two). The 3 peripherals connected to a central are separated by maximum&amp;nbsp;140 feet in open space. The centrals (iOS devices) were sitting at most 100 feet from the farthest peripheral. I noticed that often as I walked up to the centrals, a disconnect would occur. It seemed that when the space had other people (8-10 people) present, disconnects occurred more frequently.&lt;/p&gt;
&lt;p&gt;After logging the disconnect reasons and capturing a few more sniffer traces, I turned off 2 of the 3 sets of 3 peripherals leaving 3 peripherals connected to 1 central. Disconnect rates went way down (only a couple disconnects over a 20-minute period). I walked throughout the space carrying the central device and no disconnects. Probably maximum 190 feet distance between central and any of the 3 peripherals.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve attached another sniffer trace with several disconnects captured.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/sniffer-trace_2D00_3.pcapng"&gt;devzone.nordicsemi.com/.../sniffer-trace_2D00_3.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t have time to test using the internal RC. If still worthwhile after above information, I&amp;#39;ll test today. We use 12pF caps on the external crystal. Here&amp;#39;s the schematic:&lt;/p&gt;
&lt;p&gt;&lt;img height="212" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/0005.schematic.png" width="434" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a portion of the board layout:&lt;/p&gt;
&lt;p&gt;&lt;img height="302" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/1565.board.png" width="262" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Thank you for your thoughts about this. If your sense now is that RF interference is the cause of the disconnects, any suggestions in how to mitigate this? Adjust connection parameters? Clock settings?&lt;/p&gt;
&lt;p&gt;Generally, what are the common sources of RF interference that would impact BLE connection stability?&lt;/p&gt;
&lt;p&gt;Many thanks,&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection stability</title><link>https://devzone.nordicsemi.com/thread/272199?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2020 08:23:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:570ceb6b-1148-43bc-8e70-797436789b40</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Tim,&lt;/p&gt;
[quote user="Tim123"]As I mentioned earlier, our application uses a simplified version of the wireless clock synchronization code described &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/wireless-timer-synchronization-among-nrf5-devices" rel="noopener noreferrer" target="_blank"&gt;here&lt;/a&gt;.[/quote]
&lt;p&gt;&amp;nbsp;That should not affect the timekeeping for the softdevice. These are completely separate.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The accuracy of the XTAL is dependent on both the XTAL itself and the PCB layout (more precisely the capacitors between the LFXTAL and the nRF). I see that your LFXTAL has 12.5pF capacitance. What are the value of the caps between the XTAL and the nRF?&lt;/p&gt;
&lt;p&gt;However, I am not convinced that this is an XTAL issue.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Tim123"]Should I be setting&amp;nbsp;NRF_SDH_CLOCK_LF_ACCURACY to 9?[/quote]
&lt;p&gt;&amp;nbsp;If you want to check whether it is an XTAL issue, please try to set:&lt;/p&gt;
&lt;p&gt;NRF_SDH_CLOCK_LF_SRC 0&lt;br /&gt;NRF_SDH_CLOCK_LF_ACCURACY 1&lt;br /&gt;NRF_SDH_CLOCK_LF_RC_CTIV 16&lt;br /&gt;NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This will enable the internal RC oscillator instead of the external XTAL. Since we know this should work, try to look for the disconnects with these settings.&lt;/p&gt;
&lt;p&gt;But first, I would try to look for the disconnect reason with your current settings.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection stability</title><link>https://devzone.nordicsemi.com/thread/272163?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2020 05:07:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5da2d9cc-19cc-43b2-8440-e4d9e51b6281</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Thanks Edvin. I was out testing today and was unable to log the intermittent disconnect. It happened only once on a peripheral I was not debug logging. I&amp;#39;ll continue to confirm whether nRF gets the disconnect event.&lt;/p&gt;
&lt;p&gt;As I mentioned earlier, our application uses a simplified version of the wireless clock synchronization code described &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/wireless-timer-synchronization-among-nrf5-devices" rel="noopener noreferrer" target="_blank"&gt;here&lt;/a&gt;. For each system of 3 peripherals connected to 1 central (iOS device), one of the peripherals constantly&amp;nbsp;transmits&amp;nbsp;time beacons at a constant frequency for a specific PREFIX0 and BASE0. Every 30 seconds, the other two peripherals listen for beacons (same &lt;span&gt;PREFIX0 and BASE0)&amp;nbsp;&lt;/span&gt;and once a beacon is received they stop listening and set a timer to start listening again in 30 seconds. Initially the transmit frequency was 50Hz and I was noticing that receipt of beacons at the listening peripherals could take up to 8 or 10 seconds. I increased the transmit frequency to 100Hz and the time to receive a beacon once listening started went down to 1 second or less. However, after increasing the transmit frequency to 100Hz, I noticed an unexpected disconnect of one of the peripherals. At 50Hz, the BLE connections appeared stable. The documentation for the Timeslot API (used by the timer sync code) states that its use can influence the performance of the SoftDevice. Makes me wonder if Timeslot API use is the cause of unexpected disconnects.&lt;/p&gt;
&lt;p&gt;Would increasing the min and max connection interval and supervisor timeout help with stability of the BLE connection?&lt;/p&gt;
&lt;p&gt;About clock source and accuracy, sdk_config.h has the following:&lt;/p&gt;
&lt;pre&gt;&lt;pre class="ui-code" data-mode="text"&gt;//  NRFX_CLOCK_CONFIG_LF_SRC  - LF Clock Source
// &amp;lt;0=&amp;gt; RC 
// &amp;lt;1=&amp;gt; XTAL 
// &amp;lt;2=&amp;gt; Synth 
// &amp;lt;131073=&amp;gt; External Low Swing 
// &amp;lt;196609=&amp;gt; External Full Swing 

#ifndef NRFX_CLOCK_CONFIG_LF_SRC
#define NRFX_CLOCK_CONFIG_LF_SRC 1
#endif

// NRF_SDH_CLOCK_LF_SRC - SoftDevice clock source.
// &amp;lt;0=&amp;gt; NRF_CLOCK_LF_SRC_RC 
// &amp;lt;1=&amp;gt; NRF_CLOCK_LF_SRC_XTAL 
// &amp;lt;2=&amp;gt; NRF_CLOCK_LF_SRC_SYNTH 

#ifndef NRF_SDH_CLOCK_LF_SRC
#define NRF_SDH_CLOCK_LF_SRC 1
#endif

//  NRF_SDH_CLOCK_LF_ACCURACY  - External clock accuracy used in the LL to compute timing.
// &amp;lt;0=&amp;gt; NRF_CLOCK_LF_ACCURACY_250_PPM 
// &amp;lt;1=&amp;gt; NRF_CLOCK_LF_ACCURACY_500_PPM 
// &amp;lt;2=&amp;gt; NRF_CLOCK_LF_ACCURACY_150_PPM 
// &amp;lt;3=&amp;gt; NRF_CLOCK_LF_ACCURACY_100_PPM 
// &amp;lt;4=&amp;gt; NRF_CLOCK_LF_ACCURACY_75_PPM 
// &amp;lt;5=&amp;gt; NRF_CLOCK_LF_ACCURACY_50_PPM 
// &amp;lt;6=&amp;gt; NRF_CLOCK_LF_ACCURACY_30_PPM 
// &amp;lt;7=&amp;gt; NRF_CLOCK_LF_ACCURACY_20_PPM 
// &amp;lt;8=&amp;gt; NRF_CLOCK_LF_ACCURACY_10_PPM 
// &amp;lt;9=&amp;gt; NRF_CLOCK_LF_ACCURACY_5_PPM 
// &amp;lt;10=&amp;gt; NRF_CLOCK_LF_ACCURACY_2_PPM 
// &amp;lt;11=&amp;gt; NRF_CLOCK_LF_ACCURACY_1_PPM

#ifndef NRF_SDH_CLOCK_LF_ACCURACY
#define NRF_SDH_CLOCK_LF_ACCURACY 7
#endif&lt;/pre&gt;&lt;/pre&gt;
&lt;p&gt;Our custom board has &lt;a href="https://www.digikey.ca/en/products/detail/citizen-finedevice-co-ltd/CFS-20632768HZFB/2217074?s=N4IgTCBcDaIMwAYEFoAcB2AbHZA5AIiALoC%2BQA" rel="noopener noreferrer" target="_blank"&gt;this &amp;plusmn;5ppm external crystal&lt;/a&gt; connected to XL1/XL2. Should I be setting&amp;nbsp;NRF_SDH_CLOCK_LF_ACCURACY to 9?&lt;/p&gt;
&lt;p&gt;Thanks Edvin.&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection stability</title><link>https://devzone.nordicsemi.com/thread/271988?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2020 08:45:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69a53adc-4d23-4d3d-99f2-79c4f2d83ccf</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Tim,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Tim123"]occasional Empty PDU packets from the slave are not seen by the sniffer. For example, at 15.408, 15.497, 15.588, etc. Prior to disconnect at 103.733[/quote]
&lt;p&gt;&amp;nbsp;Yes. Those are &amp;quot;normal&amp;quot;. Since it is an on air link, you will occasionally have some dropped packets. When these are missing from the sniffer trace it means one of three things:&lt;/p&gt;
&lt;p&gt;1: The sniffer didn&amp;#39;t pick up the packet, but the central did.&lt;/p&gt;
&lt;p&gt;2: The sniffer and the central didn&amp;#39;t pick up the packet.&lt;/p&gt;
&lt;p&gt;3: The peripheral didn&amp;#39;t pick up the previous packet from the central correctly (bad CRC), which means it doesn&amp;#39;t have anything to reply to.&lt;/p&gt;
&lt;p&gt;In the case of packet nr 2001 and 2002 (15.408) I see that the NESN (next expected serial number) in the central&amp;#39;s packet doesn&amp;#39;t change, which indicates that the central didn&amp;#39;t pick up any packets from the peripheral in between these two:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/1263.pastedimage1601368376099v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;However, if you have a large distance between the two devices, you can expect some packet drops occasionally.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The increased number of dropped packets is probably caused by the environment. If something comes between the devices, a lot of radio noise in the area, a bad channel (much noise) or similar can cause this. Since it does reply after a while (even with 8 packets) that indicates that the nRF is still running as expected. However, when you have the disconnect you have 24 missed packets. It can either mean that the nRF&amp;#39;s application has &amp;quot;crashed&amp;quot; and reset, or that the radio conditions are bad (noise). This is why I asked for the debug information on the nRF side. If you get the disconnected event, it probably means that the radio conditions are bad from time to time. If you don&amp;#39;t get this event, you are probably seeing a reset caused by an application bug (most likely).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Tim123"]Maybe as clocks of other nearby peripherals drift, and at some point the interference becomes intolerable?[/quote]
&lt;p&gt;&amp;nbsp;That shouldn&amp;#39;t be an issue. They sync up every time they receive a packet. When you miss more packets the window that the peripheral listens will increase proportionally with the number of concecutive missed packets. You should however make sure you have the correct XTAL accuracy in the sdk_config.h file.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection stability</title><link>https://devzone.nordicsemi.com/thread/271866?ContentTypeID=1</link><pubDate>Mon, 28 Sep 2020 16:52:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a955bd8b-1364-4b03-8960-3b06f74b071b</guid><dc:creator>Tim</dc:creator><description>&lt;p&gt;Thanks Edvin. It will take some time to set up a debug environment in the field, but I can do that and find out if the &lt;span&gt;BLE_GAP_EVT_DISCONNECTED event occurs on the peripheral and&amp;nbsp;&lt;/span&gt;what the disconnect reason is.&lt;/p&gt;
&lt;p&gt;In the meantime, I would be glad for any general guidance on creating a most stable link connection. Given that data throughput is not important, and that only small amounts of data are written (in either direction), what would be suggested connection parameters? Any other helpful considerations?&lt;/p&gt;
&lt;p&gt;In reading the Timeslot API documentation, I understand that using it can affect performance&amp;nbsp;of the SoftDevice, so I wonder if it is a factor in what I am experiencing.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve attached another sniffer trace. It appears the disconnect occurs around time 103.733 as the peripheral/slave begins advertising again at 104.661. It seems that throughout duration of the connection, occasional Empty PDU packets from the slave are not seen by the sniffer. For example, at 15.408, 15.497, 15.588, etc. Prior to disconnect at 103.733, dropped slave Empty PDU packets become more frequent. At 98.002 there are 3 missing slave Empty PDU packets. At 100.852 there are 8 dropped packets, then more and more dropped packets until disconnect around 103.733. Would this suggest an interference issue? Maybe as clocks of other nearby peripherals drift, and at some point the interference becomes intolerable? Again, I have very little experience here, so maybe unhelpful speculation.&lt;/p&gt;
&lt;p&gt;Many thanks,&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/sniffer-trace_2D00_2.pcapng"&gt;devzone.nordicsemi.com/.../sniffer-trace_2D00_2.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE connection stability</title><link>https://devzone.nordicsemi.com/thread/271841?ContentTypeID=1</link><pubDate>Mon, 28 Sep 2020 14:46:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5534d7a2-85ed-41d4-b9fc-98c11c405472</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Tim,&lt;/p&gt;
&lt;p&gt;I have looked at the sniffer log that you provided, and it looks like the nRF (the peripheral/slave) is not responding, and hence the disconnect, as you probably know.&lt;/p&gt;
&lt;p&gt;What does the nRF behave like in this case? Have you tried to debug the application there? Do you get the disconnected event on the nRF as well, or does it for some reason reset? If you receive the disconnect event, what reason is it pointing to?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can find the disconnect reason in the BLE_GAP_EVT_DISCONNECTED event by using:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;NRF_LOG_INFO(&amp;quot;Disconnected, reason: 0x%02x&amp;quot;, p_ble_evt-&amp;gt;evt.gap_evt.params.disconnected.reason);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;What does it say?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>