<?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>Multiple peripherals drop the notification rate</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/64533/multiple-peripherals-drop-the-notification-rate</link><description>Hello, 
 My setup is the following: Up to 4 peripherals (nrf52832) and the central device is a PC running Windows 10. To make it simpler, I&amp;#39;m just using 2 peripherals at the moment. 
 When I connect one peripheral I get notifications at a constant rate</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 07 Aug 2020 10:58:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/64533/multiple-peripherals-drop-the-notification-rate" /><item><title>RE: Multiple peripherals drop the notification rate</title><link>https://devzone.nordicsemi.com/thread/263577?ContentTypeID=1</link><pubDate>Fri, 07 Aug 2020 10:58:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47cab218-7827-4925-8346-319e0c8c5195</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Glad you found a working solution.&lt;/p&gt;
&lt;p&gt;It really isn&amp;#39;t easy to say what the optimal connection interval is. It depends on the use case. A higher connection interval allows for a higher throughput (given that you use large MTU, large&amp;nbsp;packets (fill the MTU), long connection event length. This way you get the lowest possible header/payload ratio.&lt;/p&gt;
&lt;p&gt;But increasing the connection interval will also increase the latency. Also, things get more complicated when you add more links to the mix, because one link can steal the throughput from another link.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If your central supports it, you can try to use 2MBPS instead of the standard 1MBPS. This increases the theoretical maximum payload throughput from ~750kbps to ~1.3 mbps.&lt;/p&gt;
&lt;p&gt;100Hz * 50bytes = 5 000bytes/s = 40kbps, so you are still nowhere near this limit (750kpbs @1MBPS).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you sure you are handling the application logic correctly when you are queuing packets (using sd_ble_gatts_hvx())? There shouldn&amp;#39;t be any packet loss.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Check if you are spending too long time in the events where you are receiving the packets. Try to do as little as possible. Only monitor the amount of events and the length of the packets, but don&amp;#39;t do anything with the data. Just for debugging purposes it would be interesting to see whether this affects the behavior.&lt;/p&gt;
&lt;p&gt;Is it possible for me to reproduce&amp;nbsp;the issue you are seeing using some DKs`?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiple peripherals drop the notification rate</title><link>https://devzone.nordicsemi.com/thread/263534?ContentTypeID=1</link><pubDate>Fri, 07 Aug 2020 07:43:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d506a620-2ec3-4f0e-a8c8-50f5cd09678e</guid><dc:creator>PauDC</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;I lowered both min connection interval and max connection interval to the same value of 8 * 1.25ms. Any value lower than that will make the firmware crash. With 8 * 1.25 ms the notification rate is working as expected at a rate of 100Hz each peripheral even when I&amp;#39;m having 4 of them connected!&lt;/p&gt;
&lt;p&gt;Now I&amp;#39;m going to research how to find the optimal values of min and max connection interval. But I&amp;#39;d be grateful if you could point me where to find this information.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiple peripherals drop the notification rate</title><link>https://devzone.nordicsemi.com/thread/263478?ContentTypeID=1</link><pubDate>Thu, 06 Aug 2020 15:06:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03245f9f-6a9f-4fc3-8a2c-58c95f7fe686</guid><dc:creator>PauDC</dc:creator><description>&lt;p&gt;Hello again,&lt;/p&gt;
&lt;p&gt;I lowered the MIN_CONN_INTERVAL to 10ms but the issue is still happening, I&amp;#39;m seeing the first sensor at 15Hz and the second at 85Hz.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Pau&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiple peripherals drop the notification rate</title><link>https://devzone.nordicsemi.com/thread/263476?ContentTypeID=1</link><pubDate>Thu, 06 Aug 2020 14:52:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b562243b-d8dc-4050-b50d-17182612f08b</guid><dc:creator>PauDC</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;Thanks for your reply. I&amp;#39;m still fairly new to this.&lt;br /&gt;&lt;br /&gt;My&amp;nbsp;MIN_CONN_INTERVAL is set to 20ms and the&amp;nbsp;MAX_CONN_INTERVAL is set to 200ms. I&amp;#39;ve read information in the forums about this, but I&amp;#39;m still not sure how do I find the optimal values for my application. Because if I remember correctly, I once lowered the&amp;nbsp;MIN_CONN_INTERVAL to 7.5ms as some other posts in the forum did but I couldn&amp;#39;t get the code to run. I will now reduce the&amp;nbsp;MIN_CONN_INTERVAL and check it out again.&lt;/p&gt;
&lt;p&gt;Actually I do 50 calls to&amp;nbsp;&lt;span&gt;sd_ble_gatts_hvx() a second and at every packet I double the information I want to send, so I&amp;#39;m faking the 100Hz rate. Because when I tried to send 22 byte (MTU was 25) packets at 100Hz I got the busy error and never got anywhere close to 100Hz I got 66Hz at max. I always set the&amp;nbsp;NRF_SDH_BLE_GATT_MAX_MTU_SIZE to the size of this data packet I&amp;#39;m sending + 3 (because I read it somewhere on this forum).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It&amp;#39;s always the first one to connect to the central that lowers the rate, I&amp;#39;ve tried with several peripherals and it always happened with the first one to connect.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I don&amp;#39;t know how to measure the queued notifications, I&amp;#39;m going to search how to do it. I calculate the frequency of notifications I&amp;#39;m getting in the central device by counting the time it has passed and how many notifications did it get.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Pau&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Multiple peripherals drop the notification rate</title><link>https://devzone.nordicsemi.com/thread/263469?ContentTypeID=1</link><pubDate>Thu, 06 Aug 2020 13:51:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9e60995-4722-497b-92b6-0dd68658d46c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;What are your connection parameters? To make things more complicated, it is the central that decides the connection interval, so you need to look at the application on the central side (windows 10 with Bluetooth dongle?).&lt;/p&gt;
&lt;p&gt;So you have 100 calls to sd_ble_gatts_hvx() every second to send packets? Perhaps you can try to store up more data, and send larger packets (packet size closer to the MTU size). This will reduce the header/payload ratio, giving you more payload throughput.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What you are probably seeing is that one of the connections is using up all the time. Is it always the same peripheral that takes all the bandwidth? Or does it depend on what device the computer (central) connects to first?&lt;/p&gt;
&lt;p&gt;You could try to reduce the connection event length. Set it to half the connection interval if it is higher than this by default.&lt;/p&gt;
&lt;p&gt;Does the second peripheral (the one with low bandwidth) also report that the throughput is low? Do you measure the amount of notifications that are queued with sd_ble_gatts_hvx() compared to the one that has all the throughput?&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>