<?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>Connection Interval</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/43911/connection-interval</link><description>Hi everyone, 
 I&amp;#39;m new to working with Bluetooth/ 
 My problem is that the connection interval time sent by the central device does not converge with the time I see using an oscilloscope or a configured timer for 1 ms. The principle of operation of my</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 01 Apr 2019 13:15:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/43911/connection-interval" /><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/179518?ContentTypeID=1</link><pubDate>Mon, 01 Apr 2019 13:15:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8cc863f9-d109-4324-9c84-bea69ab0927e</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;This is more like it, some data to work with!&lt;/p&gt;
[quote user="Filya"]After the characteristics have been updated for the second time (14: 54: 53: 482), it is possible to read / write from / to the characteristics.[/quote]
&lt;p&gt;How do you want to read/write? Do you want to use notifications? This is possible after you have enabled notifications from the nRF to the phone, and here is the simplest way to do that:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Connect to the device.&lt;/li&gt;
&lt;li&gt;Start service discovery from the phone.&lt;/li&gt;
&lt;li&gt;When this is completed, enable notifications on the characteristic you want to use.&lt;/li&gt;
&lt;li&gt;Send notifications from the nRF to the phone.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Again, this has nothing to do with the connection parameter updates, which&amp;nbsp;just uses time in your application and are disruptive when you want to minimize current consumption.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/179495?ContentTypeID=1</link><pubDate>Mon, 01 Apr 2019 12:35:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b82bced-eedd-4fd8-a83f-35dc9cc7b6d3</guid><dc:creator>Filya</dc:creator><description>&lt;p&gt;Here I provide my screenshots from nRF Connect.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/7024.Screenshot_5F00_2019_2D00_04_2D00_01_2D00_14_2D00_55_2D00_16_2D00_015_5F00_no.nordicsemi.android.mcp.png" /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2620.Screenshot_5F00_2019_2D00_04_2D00_01_2D00_14_2D00_55_2D00_25_2D00_909_5F00_no.nordicsemi.android.mcp.png" /&gt;&lt;/p&gt;
&lt;p&gt;It turns out that the connection itself took 308 ms (14: 54: 52: 408 - 14: 54: 52: 710). After this, the connection parameters are updated several times in a row. When the announcement of updating connection parameters appears for the first time (14: 54: 53: 047), the characteristics window is not active, reading, recording, etc. is impossible.&lt;br /&gt;After the characteristics have been updated for the second time (14: 54: 53: 482), it is possible to read / write from / to the characteristics.&lt;br /&gt;It turns out that all the time, from the beginning of the connection to the ability to read the characteristics, is 1074 ms (14: 54: 52: 408 - 14: 54: 53: 482).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/179449?ContentTypeID=1</link><pubDate>Mon, 01 Apr 2019 10:53:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3a16693-d448-4d03-aa16-b25520efb265</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Thanks!&lt;/p&gt;
&lt;p&gt;I still don&amp;#39;t see why you do the connection parameter update (CONN_PARAM_UPDATE), as that is what takes time in your screenshots. This is not a connection event. There are no screenshots in this thread that shows how much time the initial connection takes. They are all just parameter updates. If you comment this out of your code, are you able to show me that the actual connection takes 800ms, because on my end this never takes more than 30 ms or so with another device, and&amp;nbsp;approx.&amp;nbsp;200ms with my phone (iPhone 6), which seems to be as&amp;nbsp;fast as this example gets with a mobile device.&lt;/p&gt;
&lt;p&gt;My log in nRFConnect when connecting to another DK:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;&lt;pre class="ui-code" data-mode="text"&gt;12:45:44.835	Connecting to device
12:45:44.857	Connected to device CD:3D:F1:F2:0C:E0 //The connection event takes 22ms&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;Best regards,&lt;/div&gt;
&lt;div&gt;Simon&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/179412?ContentTypeID=1</link><pubDate>Mon, 01 Apr 2019 08:49:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4ee1b5b-f8bf-4705-85c8-df7c288eaede</guid><dc:creator>Filya</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The principle of the project, which I do this: on the peripheral side are sensors. The device itself sleeps and wakes up at a certain interval, connects to the central device to transmit the values ​​received from the sensor, and then falls asleep again. The central device is a smartphone (with Android OS).&lt;/p&gt;
&lt;p&gt;Since the peripheral device is battery powered, it is necessary to reduce power consumption and time of reception / transmission. When I began to look more closely at the time of connecting and transferring data, I saw the situation that I described earlier.&lt;/p&gt;
&lt;p&gt;Since the connection takes from 800 ms to 1300 ms, which was shown earlier, depending on the Bluetooth module (or something else depends on), I need to know whether this time can be reduced or not.&lt;/p&gt;
&lt;p&gt;The code changes in the example ble_app_cscs were not. The situation with the time spent on the connection is the same in this example, and in my main project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/179147?ContentTypeID=1</link><pubDate>Fri, 29 Mar 2019 09:00:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e640edc-9856-4098-9bf1-b4f21605d4c6</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I think I have lost track on what exactly you are trying to achieve here. Sorry about this, but could you explain to me once more, where you are in your project now, and what it is exactly you want to achieve. If you have done any changes to your code since the last one you sent me, please attach an updated version of your code as well.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/178997?ContentTypeID=1</link><pubDate>Thu, 28 Mar 2019 14:57:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2819b4ec-82a9-4ee0-aa7f-7afba7c7c890</guid><dc:creator>Filya</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure if this is due to when notifications are enabled. After talking with his colleague, he says that he sends a request for notification as soon as the connection is established. In this case, I see the same delay (~ 800 ms) as your example, where I do not even send a request for notification.&lt;/p&gt;
&lt;p&gt;I also noticed this feature. I also used Xiaomi Redmi Note 6 Pro phones (with Bluetooth module 5.0) and Huawei P Smart (with Bluetooth module 4.2). The delay in applying Huawei is ~ 800 ms. Delay when using Xiaomi (with Bluetooth module 5.0) - ~ 1400 ms. Since the phone with Bluetooth module 5.0 I only have this model and other models don&amp;#39;t have, then perhaps this is an isolated case. But if not, then module 5.0 has even more delay, with the fact that data transfer is faster.&lt;/p&gt;
&lt;p&gt;In my project it is very critical that so much time is spent on the connection, since Frequent falling asleep is expected. With such a time there will be a great expenditure of energy. The future device will be battery powered.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Xiaomi Redmi 5+; project: ble_app_cscs; application on Android: nrf Connect.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/cscs_5F00_ble_5F00_4.2.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Xiaomi Redmi Note 6 Pro; project: ble_app_cscs; application on Android: nrf Connect.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/cscs_5F00_ble_5F00_5.0.png" /&gt;&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: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/178582?ContentTypeID=1</link><pubDate>Wed, 27 Mar 2019 09:01:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91873130-2810-46f2-8f97-b3cdcc3f527a</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Is seems like you are missing the point here. If you want to reduce the time it takes from connection until you have transferred your data, you will need to enable notifications from the phone as soon as you connect. This has nothing to do with the connection parameters update. You should leave the connection parameter readings be, as this is not the reason you are seeing the delay in data transfer.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/178457?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2019 15:20:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64653fb5-079a-4d49-a386-a3f7ed990e9c</guid><dc:creator>Filya</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I used the mentioned function to disconnect after 2 switches. This was done to display the total time spent on establishing a normal connection.&lt;/p&gt;
&lt;p&gt;I removed this function and set the times of the connection connection, as you said. But the number of connections and elapsed time remained the same.&lt;/p&gt;
&lt;p&gt;I slightly changed the connection time measurement for each connection and now it shows how long it takes for each switch.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll post the main.c file so that we can see what has been changed.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6076.main.c"&gt;devzone.nordicsemi.com/.../6076.main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Below is the result with the above changes. The time is in ms.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/6886.cscs_5F00_con_5F00_int.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/178270?ContentTypeID=1</link><pubDate>Tue, 26 Mar 2019 09:32:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42090570-a886-40f1-9eae-1af6de881c09</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Sorry for the late reply, but I have finally had time to look at your project. First of all, the reason for the disconnects are because you set your application to disconnect if the connection parameters are above 7.5 ms with this line of code:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if (max_int_upd &amp;gt; 6) 
    {
      err_code = sd_ble_gap_disconnect(p_ble_evt-&amp;gt;evt.gattc_evt.conn_handle,
                                       BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES);
      APP_ERROR_CHECK(err_code);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And I am sorry for confusing you earlier, as I neglected the fact that Android devices have a minimum connection time of at least 15ms (iPhones at 30ms). So you should get rid of this function all together, unless you want it to disconnect every 5 seconds after starting reading.&lt;/p&gt;
&lt;p&gt;It is not the connection event itself that takes time, it seems to be on the central application side. You said your colleague had made an application right. The delay you are experiencing is from the time you connect to the central, until it starts the CSC event. I am guessing that doesn&amp;#39;t happen immideately as you connect.&lt;/p&gt;
&lt;p&gt;You should also tune the min_conn_interval and max_conn_interval, as the project you sent me defined these as 500 and 1000, which means that your peripheral wants to use between 500 and 1000 ms to connect. I suggest you set them to the following:&lt;/p&gt;
&lt;p&gt;#define MIN_CONN_INTERVAL MSEC_TO_UNITS(7.5, UNIT_1_25_MS)&amp;nbsp;&lt;br /&gt;#define MAX_CONN_INTERVAL MSEC_TO_UNITS(30, UNIT_1_25_MS)&lt;/p&gt;
&lt;p&gt;to make it work on both iPhones and Android, as well as removing the function mentioned above that causes disconnects. I hope this was helpful, and if you have any further questions, just ask!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/177853?ContentTypeID=1</link><pubDate>Fri, 22 Mar 2019 14:03:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:803b0106-b114-4f18-9ca4-eedcc96360a6</guid><dc:creator>Filya</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I am sending you a project, the results of which were demonstrated in my last message. The situation shown in the last post is the same for both my main project and the example.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1121.ble_5F00_app_5F00_cscs.rar"&gt;devzone.nordicsemi.com/.../1121.ble_5F00_app_5F00_cscs.rar&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/177756?ContentTypeID=1</link><pubDate>Fri, 22 Mar 2019 08:48:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:00d8bcf1-ead9-48a7-96ca-96f6428b8a0d</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I think for me to help you, you will have to send me your project, so I can see exactly how your project is set up. If you don&amp;#39;t want to share it on the forum I can set this case to private, so only you and Nordic engineers can see it. Just say the word and I&amp;#39;ll do it before you upload the project.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/177581?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2019 12:54:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7615ec6d-80aa-45dc-9ce1-0717b4022b9d</guid><dc:creator>Filya</dc:creator><description>&lt;p&gt;Specifically, the disconnection in the BLE_GAP_EVT_CONN_PARAM_UPDATE event does not occur, since the sd_ble_gap_disconnect function is not called anywhere. Perhaps there is a restart function or some similar, perhaps it is called.&lt;/p&gt;
&lt;p&gt;I checked the reason of the shutdown in the BLE_GAP_EVT_CONN_PARAM_UPDATE and BLE_GAP_EVT_DISCONNECTED events. In the first option, disconnection occurs when I click the &amp;quot;Disconnect&amp;quot; button in the nRF Connect application. In the second &lt;span&gt;option&lt;/span&gt;, the disconnection occurs when the second reconnection occurs.&lt;/p&gt;
&lt;p&gt;1 option:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Reasons:&lt;/p&gt;
&lt;p&gt;0x06 -&amp;nbsp;BLE_HCI_STATUS_CODE_PIN_OR_KEY_MISSING&lt;/p&gt;
&lt;p&gt;&lt;span&gt;0x27 -&amp;nbsp;Requested QoS Not Supported (in file ble_hci.h this definitions&amp;nbsp;commented out)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;0x1E -&amp;nbsp;BLE_HCI_STATUS_CODE_INVALID_LMP_PARAMETERS&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;0x13 - BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2 option:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/v2.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Reasons:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;0x06 -&amp;nbsp;BLE_HCI_STATUS_CODE_PIN_OR_KEY_MISSING&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;0x27 -&amp;nbsp;Requested QoS Not Supported (in file ble_hci.h this definitions&amp;nbsp;commented out)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;0x16 -&amp;nbsp;BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/177556?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2019 11:39:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9af1261d-3f99-4eea-95e3-2e666a80ef4b</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Ok&lt;/p&gt;
&lt;p&gt;Seeing as you have multiple connection events, there will have to be some disconnect event as well somewhere. Could you try to write the disconnect reason by using&amp;nbsp;p_ble_evt-&amp;gt;evt.gap_evt.disconnected.reason so we can see why your application disconnects the first time around. This function uses the definitions stated in ble_hci.h&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/177493?ContentTypeID=1</link><pubDate>Thu, 21 Mar 2019 08:17:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5fd118ad-bcb9-4f5b-80ee-ca02a6f4e17d</guid><dc:creator>Filya</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Yes, I tried using the ble_app_cscs example. It works correctly. The modification consisted only in adding code to find out the number of reconnections and their parameters.&lt;/p&gt;
&lt;p&gt;About the address. The type of address I have is BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE, therefore the address does not correspond to the central device and changes periodically.&lt;/p&gt;
&lt;p&gt;Regarding the number of reconnections and changes in the value of the connection interval. As stated in the comments &lt;a href="https://github.com/NordicSemiconductor/Android-BLE-Library/issues/78#issuecomment-455517526"&gt;here&lt;/a&gt;, in the current versions of the android, the connection algorithm is laid, first with a connection interval of 7.5 ms, and after that, the connection is already with parameters supported by both devices.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/177242?ContentTypeID=1</link><pubDate>Wed, 20 Mar 2019 08:38:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9235a0b9-c0c7-497a-9675-ddad32f25da1</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;So did you at any point try with an unmodified ble_app_cscs example, the nRF52832DK board, and the nRFConnect application?&lt;/p&gt;
&lt;p&gt;It seems very strange that multiple connection events occur. Are you sure you are connecting to the intended device? Can you look at the connection event and find which address you are connecting to? This should be possible by using p_ble_evt -&amp;gt; evt.params.connected.peer_addr.addr[i].&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/176964?ContentTypeID=1</link><pubDate>Tue, 19 Mar 2019 11:36:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9947134-6dc0-42e9-b402-26fdaa70740d</guid><dc:creator>Filya</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Did you check the return values from sending the notifications (or start sending data function). &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I checked the return value and the result was NRF_SUCCESS.&lt;br /&gt;I also want to clarify that the transfer of useful data itself does not lead to this error. As I showed in the ble_app_cscs example, several connections occur during the establishment of a connection between two devices. After that, you can already freely send and receive data.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;It is the central that decides the connection interval on connection, not the peripheral, so it will be 7.5ms when first connecting&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;From my point of view, it seems a bit strange that the central device gives out 7.5 ms by the first attempt, whereas everywhere it is described that android applications need at least 15-20 ms.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;I think the reason of your delay might be that you haven&amp;#39;t enabled notifications correctly. You will have to do this from your central (phone). How and when do you do this?&lt;/pre&gt;Indeed, I use a third-party application that my colleagues write. Perhaps they need to make some more adjustments.&lt;br /&gt;But I want to note that the last example I gave in the last message (screenshot from the terminal) was made on the nRF52832 DK board with a modified ble_app_cscs example, which I also posted. And I checked the operation of the peripheral application using the nRF Connect application.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you in advance&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/176935?ContentTypeID=1</link><pubDate>Tue, 19 Mar 2019 10:10:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4424511-7fa4-4a46-8737-351064ebb6a3</guid><dc:creator>Simonr</dc:creator><description>[quote user="Filya"]If I understand you correctly, you are proposing to start sending data right away when I get into the BLE_GAP_EVT_CONNECTED event. I tried to do this and the result did not change.[/quote]
&lt;p&gt;Did you check the return values from sending the notifications (or start sending data function).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="Filya"]Tell me, is this possible? I just have no more options, why I always see the connection interval = 7.5 ms when I first try to connect.[/quote]
&lt;p&gt;&amp;nbsp;It is the central that decides the connection interval on connection, not the peripheral, so it will be 7.5ms when first connecting.&lt;/p&gt;
&lt;p&gt;I think the reason of your delay might be that you haven&amp;#39;t enabled notifications correctly. You will have to do this from your central (phone). How and when do you do this?&lt;/p&gt;
&lt;p&gt;Also what app are you using on your phone? I suggest using the nRFConnect app if you aren&amp;#39;t already.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/176796?ContentTypeID=1</link><pubDate>Mon, 18 Mar 2019 16:09:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62a81732-c882-4c2c-be80-91ebaaceed66</guid><dc:creator>Filya</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;If I understand you correctly, you are proposing to start sending data right away when I get into the BLE_GAP_EVT_CONNECTED event. I tried to do this and the result did not change.&lt;/p&gt;
&lt;p&gt;I have an assumption that the first connection interval is always set to 7.5 ms. Perhaps during the first attempt, the peripheral device substitutes the ideal value of the connection interval to check if it is possible or not. After that, the central device rejects this value and sends back its values ​​for the connection interval at which a stable connection of two devices already occurs.&lt;br /&gt;Tell me, is this possible? I just have no more options, why I always see the connection interval = 7.5 ms when I first try to connect.&lt;/p&gt;
&lt;p&gt;Concerning the timer and in general the way of counting time. I&amp;#39;ll post the main file from the cscs example, where the timer is set up and everything else to display this problem.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/05355.main.c"&gt;devzone.nordicsemi.com/.../05355.main.c&lt;/a&gt;&lt;br /&gt;I want to clarify about the part of the code that is described in the BLE_GAP_EVT_CONN_PARAM_UPDATE event.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    if (max_int_upd &amp;gt; 6) 
    {
      err_code = sd_ble_gap_disconnect(p_ble_evt-&amp;gt;evt.gattc_evt.conn_handle,
                                       BLE_HCI_REMOTE_DEV_TERMINATION_DUE_TO_LOW_RESOURCES);
      APP_ERROR_CHECK(err_code);
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I make the disconnection in this way, because it is during the second connection that a stable connection occurs and you can already begin to transfer data. Just during the shutdown, I clearly observe how much time it takes to complete the connection.&lt;br /&gt;If disconnection is not done, then another 3 reconnections occur with the parameters of the connection interval equal to 997.5 ms.&lt;/p&gt;
&lt;p&gt;The time obtained using the timer, I also observe with an oscilloscope, so the time display is correct.&lt;/p&gt;
&lt;p&gt;I experimented with chips &lt;span&gt;BT840F (analog nRF52840) and nRF52832 (on nRF52832 DK)&amp;nbsp;&lt;/span&gt;and an example of ble_app_cscs. The results were getting exactly the same.&lt;/p&gt;
&lt;p&gt;Below is the result that I did on nRF52832:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/5040.cscs_5F00_prg_5F00_v3.png" /&gt;&lt;/p&gt;
&lt;p&gt;Thank you in advance&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/176378?ContentTypeID=1</link><pubDate>Fri, 15 Mar 2019 11:42:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:478397f2-2101-4eb9-a235-8a887ad85ec1</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;&lt;span style="font-family:inherit;"&gt;Can you try to start sending data immediately after ble_evt_connected? You will likely get NRF_ERROR_INVALID_STATE in the beginning, but just keep trying until you get NRF_SUCCESS. This means that notifications aren&amp;#39;t enabled, or that ATT_MTU exchange is running. It should not be necessary to wait until conns_params_update to send data.&lt;/span&gt;&lt;/p&gt;
[quote user="Filya"]Only with the following parameters data is received.[/quote]
&lt;p&gt;&amp;nbsp;What following parameters are you referring to?&lt;br /&gt;Yes, the time_conn are timers, but where in your code have you defined them/their values?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/176153?ContentTypeID=1</link><pubDate>Thu, 14 Mar 2019 11:24:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:949afea2-8668-481d-b046-118d1de6ee45</guid><dc:creator>Filya</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;About the logs. If I understand you correctly, on the side of the smartphone I am not getting at the moment. Only in the manner described above, I get a report.&lt;/p&gt;
&lt;p&gt;&amp;quot;Also, why are you waiting to transfer data until you get the last conn_params_update event? That shouldn&amp;#39;t be necessary.&amp;quot;&lt;/p&gt;
&lt;p&gt;The last event I do not expect. As soon as I get to the BLE_GAP_EVT_CONN_PARAM_UPDATE event, I immediately start the data transfer. Due to the fact that for the first time the time interval parameters are set to 7.5 ms, the data does not come to the phone. Only with the following parameters data is received.&lt;/p&gt;
&lt;p&gt;About time_conn [0-3]. I set up a timer at 1 ms intervals and start it when the peripheral device wakes up.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/176124?ContentTypeID=1</link><pubDate>Thu, 14 Mar 2019 09:50:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c9c33da-2014-4c9f-9490-9629a52215a0</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Having some trouble recreating this. Are these logs when connecting to your phone or to the other nRF chip you have? Also, why are you waiting to transfer data until you get the last conn_params_update event? That shouldn&amp;#39;t be necessary.&lt;/p&gt;
&lt;p&gt;I also have a question about your code snippet. Where does the time_conn [0-3] come from?&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/175949?ContentTypeID=1</link><pubDate>Wed, 13 Mar 2019 13:28:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55a2419d-8ef5-4c43-a96a-acb311725c71</guid><dc:creator>Filya</dc:creator><description>&lt;p&gt;I use the example -&amp;nbsp;ble_app_cscs&lt;/p&gt;
&lt;p&gt;&lt;span&gt;SDK: nRF5_SDK_15.2.0&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/175938?ContentTypeID=1</link><pubDate>Wed, 13 Mar 2019 13:18:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72ccd6d8-4920-4593-aeae-aea1e374cea8</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;What source code did you use? Was it one of the SDK example projects, in that case which one? This way I can try to recreate the problem.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/175874?ContentTypeID=1</link><pubDate>Wed, 13 Mar 2019 10:09:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e693ea7-937f-417c-8057-19f2ac393c58</guid><dc:creator>Filya</dc:creator><description>&lt;p&gt;Updated 1 image&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/my_5F00_prg.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection Interval</title><link>https://devzone.nordicsemi.com/thread/175868?ContentTypeID=1</link><pubDate>Wed, 13 Mar 2019 09:59:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd15a74b-9ed2-4e9d-ba7c-35c57227cc38</guid><dc:creator>Filya</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I set MIN_CONN_INTERVAL = 11.25 ms and it did not give results. Also, the first time it hits the BLE_GAP_EVT_CONN_PARAM_UPDATE event, it shows 7.5 ms.&lt;/p&gt;
&lt;p&gt;As for the demonstration, the following is the event handler code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
{
  ret_code_t err_code = NRF_SUCCESS;
  
  gap_evt_1 = p_ble_evt-&amp;gt;header.evt_id;
  
  switch (p_ble_evt-&amp;gt;header.evt_id)
  {
  case BLE_GAP_EVT_DISCONNECTED:
    {
      NRF_LOG_INFO(&amp;quot;Disconnected.&amp;quot;);
      app_timer_stop(m_our_char_timer_id);
      time_conn[3] = time_conn[0] - (time_conn[1]+time_conn[2]);
      time_conn[0] = 0;
      NRF_LOG_INFO(&amp;quot;CONNECTED = %d, CONN_PARAM_UPDATE = %d, DISCONNECTED = %d&amp;quot;, time_conn[1], time_conn[2], time_conn[3]);
    } break;
    
  case BLE_GAP_EVT_CONNECTED:
    {
      NRF_LOG_INFO(&amp;quot;Connected.&amp;quot;);
      err_code = bsp_indication_set(BSP_INDICATE_CONNECTED);
      APP_ERROR_CHECK(err_code);
      
      min_int = p_ble_evt-&amp;gt;evt.gap_evt.params.connected.conn_params.min_conn_interval;
      max_int = p_ble_evt-&amp;gt;evt.gap_evt.params.connected.conn_params.max_conn_interval;
      NRF_LOG_INFO(&amp;quot;Min int = %d, Max int = %d&amp;quot;, min_int, max_int);     
      
      m_conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
      err_code = nrf_ble_qwr_conn_handle_assign(&amp;amp;m_qwr, m_conn_handle);
      APP_ERROR_CHECK(err_code);
      
      time_conn[1] = time_conn[0];
    } break;
    
  case BLE_GAP_EVT_CONN_PARAM_UPDATE:
    {  
      
      min_int_upd = p_ble_evt-&amp;gt;evt.gap_evt.params.conn_param_update.conn_params.min_conn_interval;
      max_int_upd = p_ble_evt-&amp;gt;evt.gap_evt.params.conn_param_update.conn_params.max_conn_interval;
      slave_conn_upd = p_ble_evt-&amp;gt;evt.gap_evt.params.conn_param_update.conn_params.slave_latency;
      conn_sup_upd = p_ble_evt-&amp;gt;evt.gap_evt.params.conn_param_update.conn_params.conn_sup_timeout;
      
      NRF_LOG_INFO(&amp;quot;Min int upd = %d, Max int upd = %d, Slave latency = %d, Conn sup time = %d&amp;quot;, min_int_upd, max_int_upd, slave_conn_upd, conn_sup_upd);
      app_timer_start(m_our_char_timer_id, OUR_CHAR_TIMER_INTERVAL, NULL);
      if (disc_evt == 0)
      {
        NRF_LOG_INFO(&amp;quot;start conn&amp;quot;); 
        time_conn[2] = time_conn[0] - time_conn[1];
      }
    } break;
    
  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;
    
  case BLE_GATTC_EVT_TIMEOUT:
    {
      // Disconnect on GATT Client timeout event.
      NRF_LOG_DEBUG(&amp;quot;GATT Client Timeout.&amp;quot;);
      err_code = sd_ble_gap_disconnect(p_ble_evt-&amp;gt;evt.gattc_evt.conn_handle,
                                       BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
      APP_ERROR_CHECK(err_code);
      break;
      
    case BLE_GATTS_EVT_TIMEOUT:
      // Disconnect on GATT Server timeout event.
      NRF_LOG_DEBUG(&amp;quot;GATT Server Timeout.&amp;quot;);
      err_code = sd_ble_gap_disconnect(p_ble_evt-&amp;gt;evt.gatts_evt.conn_handle,
                                       BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
      APP_ERROR_CHECK(err_code);
    } break;
    
  default:
    // No implementation needed.
    break;
  }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And a screenshot from the terminal:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1552470616927v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;1) The parameters of the minimum and maximum interval of the connection event recorded at the time of contact with the event BLE_GAP_EVT_CONNECTED.&lt;br /&gt;2) The parameters of the minimum and maximum interval of the connection event recorded at the time of contact with the event BLE_GAP_EVT_CONN_PARAM_UPDATE. Here it is clear that there were 2 hits in this event with different parameters.&lt;br /&gt;3) Here are the times in ms. The time is shown from the moment the device woke up and hit every event (BLE_GAP_EVT_CONNECTED, BLE_GAP_EVT_CONN_PARAM_UPDATE, BLE_GAP_EVT_DISCONNECTED).&lt;/p&gt;
&lt;p&gt;The parameters of the minimum and maximum interval, which I set:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define MIN_CONN_INTERVAL   MSEC_TO_UNITS(11.25, UNIT_1_25_MS)
#define MAX_CONN_INTERVAL   MSEC_TO_UNITS(12, UNIT_1_25_MS)
#define SLAVE_LATENCY       1
#define CONN_SUP_TIMEOUT    MSEC_TO_UNITS(350, UNIT_10_MS)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I also decided to check on the source code of the example, which I took as a basis. The results are similar, just a few occurrences.&lt;/p&gt;
&lt;p&gt;1 option:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define MIN_CONN_INTERVAL               MSEC_TO_UNITS(500, UNIT_1_25_MS)  
#define MAX_CONN_INTERVAL               MSEC_TO_UNITS(1000, UNIT_1_25_MS)           
#define SLAVE_LATENCY                   0                                          
#define CONN_SUP_TIMEOUT                MSEC_TO_UNITS(4000, UNIT_10_MS)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/cscs.png" /&gt;&lt;/p&gt;
&lt;p&gt;2&amp;nbsp;option:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define MIN_CONN_INTERVAL               MSEC_TO_UNITS(48.75, UNIT_1_25_MS)           
#define MAX_CONN_INTERVAL               MSEC_TO_UNITS(1000, UNIT_1_25_MS)           
#define SLAVE_LATENCY                   0                                          
#define CONN_SUP_TIMEOUT                MSEC_TO_UNITS(4000, UNIT_10_MS)             &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/cscs_5F00_2.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>