<?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>Weird ble timing</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58282/weird-ble-timing</link><description>Hello DevZone, 
 Recently I&amp;#39;ve been testing connecting multiple servers to one client and fiddling around with some settings regarding timing and packet size. 
 In the following image I have one to six devices active (set the total count of devices in</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 Mar 2020 14:04:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58282/weird-ble-timing" /><item><title>RE: Weird ble timing</title><link>https://devzone.nordicsemi.com/thread/237796?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 14:04:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b35af90e-4cd4-4817-b9b9-1c3c6b9a2540</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Thanks for the information. I agree with you that to&amp;nbsp;optimize the communication one should configure the interval timing properly. This include the connection interval configuration on both side as well as the event length configuration.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The scheduler on the softdevice is fairly simple and it will only prioritize a connection over the other when the connection is going to be timed out soon. So there will be a chance that a connection will pre-empt other connections just because it&amp;#39;s scheduled before others(connection established before the others).&lt;br /&gt;To avoid a connection event being skipped, it&amp;#39;s important to configure:&lt;/p&gt;
&lt;p&gt;The connection event x Number of connection &amp;lt;= The (common) connection interval&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Weird ble timing</title><link>https://devzone.nordicsemi.com/thread/237424?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 12:15:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e24c7081-446c-41da-967d-e1144230f582</guid><dc:creator>T IJ</dc:creator><description>&lt;p&gt;Hello Hung,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for all the information you&amp;#39;ve provided, but I had a discussion with my colleague about our frames and we&amp;#39;d probably skip the shorter GAP length for now. The standard 7.5ms is time enough to get everything done and within our requirements. If I need to improve my timing I will create a private thread instead.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I shall give answer to my initial question to help people with similar problems.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As can be seen in the first picture in my original post, the timing is off for multiple devices. This is due to the fact that the client side is probably using the 15ms time that was set by the max connection interval.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When odd number of devices are used I&amp;#39;ve noticed that one (or more) device(s) is prioritized over the others. E.g. using three servers resulted in a connection interval of &lt;span style="text-decoration:underline;"&gt;15ms from the sniffed device&lt;/span&gt;, the other two devices had a connection interval of 30ms. The central used the following connection scheme, d1, d2, d1, d3, d1, d2, d1, d3 ect..&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As shown the central does not round robin all devices!&lt;/p&gt;
&lt;p&gt;Only when you set the time properly for the central (e.g. set max connection interval to 7.5ms) each device is accessed with the same time interval as between other devices. (see picture below)&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/3-devices-right-timing.png" alt=" " /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The second picture in my original post showed data packages being received at double the max connection interval, but in this situation a similar thing is happening what I described using the odd number of devices as an example.&lt;/p&gt;
&lt;p&gt;Instead of having an odd number of devices I do believe it is prioritizing something something or someone but I cannot guarantee it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So conclusion, if you want strict timing, setup your connection interval timing properly!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Weird ble timing</title><link>https://devzone.nordicsemi.com/thread/237203?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2020 15:46:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c265d018-8d35-4c3d-9ebf-49a40d87f679</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;There is a &amp;quot;Go Private&amp;quot; button that you can convert this thread to private.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I believe I have tested to set the Length Request to only on TX side and 0 on RX side with no problem. We have the&amp;nbsp;ble_app_att_mtu_throughput example that you can do a lot of different configuration test with it. Following is my test doing 7.5ms interval, 247 bytes ATT_MTU and 180 bytes DLE.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/876x513/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-c7efea4c03204fbb99ef0c076ae5d31e/pastedimage1582904408559v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;How do you request the DLE exchange in the 140bytes case ?&amp;nbsp; Please make sure you only request on TX not on RX. Try to set RX to 0 byte 0 second.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Weird ble timing</title><link>https://devzone.nordicsemi.com/thread/237023?ContentTypeID=1</link><pubDate>Fri, 28 Feb 2020 07:19:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:695f26b8-f2fa-41fd-bbe1-02d8ec4bca88</guid><dc:creator>T IJ</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2.5ms-50-bytes.pcapng"&gt;devzone.nordicsemi.com/.../2.5ms-50-bytes.pcapng&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2.5ms-72-bytes.pcapng"&gt;devzone.nordicsemi.com/.../2.5ms-72-bytes.pcapng&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2.5ms-140-bytes.pcapng"&gt;devzone.nordicsemi.com/.../2.5ms-140-bytes.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Somewhere in my mind I might have found the reason I&amp;#39;m not able to set the data length to 140 because to my believe the TX and RX time must be equal to each other, because the master does not only send an empty packet but also needs the time to send data as well.&lt;/p&gt;
&lt;p&gt;To me this makes, after a lot of thinking all the sense of the world.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I do believe I have to find a different method to (mis)use the Bluetooth connection to a way it suits my purposes.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you can tell me how to privatize this thread I will be happy to explain in a bit more detail what my need is.&lt;br /&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Weird ble timing</title><link>https://devzone.nordicsemi.com/thread/236972?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2020 17:03:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b297578-78c8-4a9a-bcc5-5ad3494e43bb</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Please upload a full sniffer trace file so I can have a look. You can convert this case to private if you want.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Weird ble timing</title><link>https://devzone.nordicsemi.com/thread/236908?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2020 14:26:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1a3274e-f7e7-460d-824d-c9cdc8ea3c2f</guid><dc:creator>T IJ</dc:creator><description>&lt;p&gt;If the data length is set to its default settings if the length is exceeded, it doesn&amp;#39;t even send a length request when it results to default.&lt;/p&gt;
&lt;p&gt;I did manage to capture an packet with 72 and 50 bytes which is allowed. Something tells me that the Max RX and TX time is not correct in this image because the time is the same when I set the data length to 50 bytes.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/DLE-update.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/DLE-update2.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Weird ble timing</title><link>https://devzone.nordicsemi.com/thread/236893?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2020 13:59:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e53bb501-d071-43ab-8067-3a588e36ea19</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;We need to look into the actual data length that the central assigned to the connection (BLE_GAP_EVT_DATA_LENGTH_UPDATE event) .&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The softdevice can&amp;#39;t dynamically schedule based on the actual data and will calculate only the worst case scenario, this includes the max size of TX and max size of RX. Please check the effective RX and TX octets/time you get in&amp;nbsp;&amp;nbsp;&lt;span&gt;BLE_GAP_EVT_DATA_LENGTH_UPDATE&amp;nbsp; event.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Weird ble timing</title><link>https://devzone.nordicsemi.com/thread/236755?ContentTypeID=1</link><pubDate>Thu, 27 Feb 2020 09:47:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc9c12c5-3e2d-4230-adbf-0ac399f9da70</guid><dc:creator>T IJ</dc:creator><description>&lt;p&gt;Hey Hung,&lt;/p&gt;
&lt;p&gt;So I&amp;#39;ve been testing stuff with the GAP event length and I stumbled upon something which I cannot explain. My PHY is set to 1Mbps.&lt;/p&gt;
&lt;p&gt;The GAP length is set to 2.5ms.&lt;/p&gt;
&lt;p&gt;I want to transmit 140 bytes of data in this 2.5ms using a notification.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve read and calculated the amount of time needed to transmit this package.&lt;/p&gt;
&lt;p&gt;80&lt;span&gt;&amp;micro;s from the master sending empty PDU&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;150&amp;micro;s switch over time from RX to TX&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1288&amp;micro;s total data time plus overhead&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;150&amp;micro;s switch over time from TX to RX.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Totaling to 1688&amp;micro;s of time which is within the 2.5ms GAP length, yet the softdevice gives me an error on my data length extension above 72 bytes.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Is there an explanation&amp;nbsp;for this?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;T IJ&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Weird ble timing</title><link>https://devzone.nordicsemi.com/thread/236327?ContentTypeID=1</link><pubDate>Tue, 25 Feb 2020 15:41:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:846f3aa6-e59f-4056-a6ec-91ef36ce414d</guid><dc:creator>T IJ</dc:creator><description>&lt;p&gt;Thanks for the clarification, this will help a lot.&lt;/p&gt;
&lt;p&gt;I&amp;#39;d assume I have to set the&amp;nbsp; NRF_SDH_BLE_GAP_EVENT_LENGTH to something that will suite the time for my maximum amount of data to be transmitted in the interval? Roughly 400 bytes.&lt;/p&gt;
&lt;p&gt;I will keep you informed what I discover.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Other question,&lt;/p&gt;
&lt;p&gt;Is there an option in the blinky example to change from fast to slow advertising?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Weird ble timing</title><link>https://devzone.nordicsemi.com/thread/236322?ContentTypeID=1</link><pubDate>Tue, 25 Feb 2020 15:30:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12c8f2ac-61c6-4fc2-bc4e-234db25112ef</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;There is some clarification needed here. The connection interval of 7.5ms doesn&amp;#39;t mean that the peripheral (server) has the full 7.5 ms to communicate with the central (client).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Interval means interval - the time it takes to the next repeated event.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The event length on the other hand means the time the peripheral has on each connection event for it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So if you set the connection interval to 20ms for all of the links, and set the event length for each of them to 2.5ms for example, then you can serve 8 connections and each of them has 20ms interval. And this mean you can have 8 links with 20ms&amp;nbsp;&lt;span&gt;time between each message.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Please try to set&amp;nbsp;NRF_SDH_BLE_GAP_EVENT_LENGTH&amp;nbsp;to 2 (2.5ms= 2 x 1.25ms) on the central and you will see the magic.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Weird ble timing</title><link>https://devzone.nordicsemi.com/thread/236311?ContentTypeID=1</link><pubDate>Tue, 25 Feb 2020 15:03:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:304a42b4-6917-480c-b6eb-237ed1b98ff1</guid><dc:creator>T IJ</dc:creator><description>&lt;p&gt;Hello Hung,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m currently using 3 devkits as ble sniffers (running 3 wire shark instances to sniff 3 servers)&amp;nbsp;I&amp;#39;m using the multilink and blinky example to do some testing regarding timing.&lt;/p&gt;
&lt;p&gt;What I can conclude so far is that timing and Bluetooth do not really add up together, well only if you set up things properly.&lt;/p&gt;
&lt;p&gt;Apparently the maximum connection interval is most of the time dominant in telling how much time each device gets, which is set in the client, the servers apparently do not have a any saying on timing.&lt;/p&gt;
&lt;p&gt;Just as I explained in my original post, I was expecting timing to be a lot tighter than it actually is, the timing I got in my reply is the time I expected in the first place.&lt;/p&gt;
&lt;p&gt;The&amp;nbsp;&lt;span&gt;NRF_SDH_BLE_GAP_EVENT_LENGTH&amp;nbsp; you mentioned is set to 6, I did not changed this.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Could you explain the 20ms with 8 devices with 2.5ms event length to me? I do not understand this as I thought each device has a minimum of 7.5ms to communicate? If I am able to decrease the amount of time from 7.5ms to a lower value I will be happy.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So far, I am able to, with my new settings, communicate with six devices and each having 7.5ms time to talk. In this configuration I am also able to send up to 400 bytes (tested so far) of data per server per connection interval of 7.5ms.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;T IJ&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Weird ble timing</title><link>https://devzone.nordicsemi.com/thread/236294?ContentTypeID=1</link><pubDate>Tue, 25 Feb 2020 14:40:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15cced6b-ffa2-4da1-a036-823eb59afe1d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you try to capture a sniffer trace ? You can use our sniffer &lt;a href="https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Sniffer"&gt;here&lt;/a&gt;. It can only follow one connection at a time. But it still can reveal a lot of valuable information.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;As suggested in section 15.10 in the S132 SDS v6.0 the connection interval is suggested to 20ms when you have multiple peripherals (8 connections with 2.5ms event length each).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We need to look at how you setup the&amp;nbsp;event length of each connection. Please look for&amp;nbsp;NRF_SDH_BLE_GAP_EVENT_LENGTH in the sdk_config of the central code.&amp;nbsp;If possible please provide us the project code. You can convert the case to private if needed.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Weird ble timing</title><link>https://devzone.nordicsemi.com/thread/236215?ContentTypeID=1</link><pubDate>Tue, 25 Feb 2020 10:41:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bcd7068-15f1-4a38-9fd7-21b6f4995b04</guid><dc:creator>T IJ</dc:creator><description>&lt;p&gt;Just to add to my post,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve changed my maximum connection interval from 15 to 7.5ms resulting in the following behavior&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;One server one client, time between each message&amp;nbsp;is 7.5 ms&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Two&amp;nbsp;servers one client, time between each message&amp;nbsp;is&amp;nbsp;15 ms&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Three&amp;nbsp;servers one client, time between each message&amp;nbsp;is&amp;nbsp;22.5 ms&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Four&amp;nbsp;servers one client, time between each message&amp;nbsp;is&amp;nbsp;30&amp;nbsp;ms&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Five&amp;nbsp;servers one client, time between each message&amp;nbsp;is&amp;nbsp;37.5 ms&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span&gt;Six servers one client, time between each message&amp;nbsp;is&amp;nbsp;45 ms&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m now more flabbergasted as what I was one hour ago.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>