<?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>Android (mostly 7) is misbehaving on BLE connect</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/30490/android-mostly-7-is-misbehaving-on-ble-connect</link><description>Hi, 
 our BLE device has a hard current limit around 1mA. This is no problem as long as the BLE central behaves as &amp;quot;intended&amp;quot;, e.g. iPhones use mostly connection intervals of 30ms which will respect the 1mA current limit. Also most Android devices obey</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 19 Feb 2018 07:50:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/30490/android-mostly-7-is-misbehaving-on-ble-connect" /><item><title>RE: Android (mostly 7) is misbehaving on BLE connect</title><link>https://devzone.nordicsemi.com/thread/121190?ContentTypeID=1</link><pubDate>Mon, 19 Feb 2018 07:50:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da2f8c45-c73e-4286-95db-eb4c6fbf9b7d</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Thanks for telling. Much appreciated!&lt;br /&gt;It looks like you have a better discussion going on over there so please continue there.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android (mostly 7) is misbehaving on BLE connect</title><link>https://devzone.nordicsemi.com/thread/121128?ContentTypeID=1</link><pubDate>Fri, 16 Feb 2018 19:06:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4eabecfb-00c9-4735-947c-f06e9d0195a8</guid><dc:creator>rgrr2</dc:creator><description>&lt;p&gt;Martin, I don&amp;#39;t want to waste the time of two of you!&amp;nbsp; I now have quite a similar thread here:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/30038/reduce-current-of-peripheral-thru-latency-setting"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/30038/reduce-current-of-peripheral-thru-latency-setting&lt;/a&gt;&amp;nbsp;(image included ;-))&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android (mostly 7) is misbehaving on BLE connect</title><link>https://devzone.nordicsemi.com/thread/121086?ContentTypeID=1</link><pubDate>Fri, 16 Feb 2018 13:48:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87c0d3cb-c4fe-474f-99e3-1cd0f5753879</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;I just noticed that you said&lt;/p&gt;
[quote user=""]I&amp;#39;ve already tweaked with local slave latency,[/quote]
&lt;p&gt;So maybe you have already tried what I just suggested? If so, do you mind showing me how you tweaked it? A plot over your current consumption over time would also be useful.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android (mostly 7) is misbehaving on BLE connect</title><link>https://devzone.nordicsemi.com/thread/121075?ContentTypeID=1</link><pubDate>Fri, 16 Feb 2018 13:15:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb0793b1-b6cf-4928-a5c6-8a1930aa3c77</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Devices with tight current constraints are certainly not uncommon and pretty much at the center of our business. 1mA&amp;nbsp; is extreme though. Keep in mind that the CPU draws 4mA and many peripherals, like the UART, draw &amp;gt;1mA alone.&lt;/p&gt;
&lt;p&gt;It turns out that the Softdevices has a feature I didn&amp;#39;t know about though. I&amp;#39;m not sure what SDK and chip you use, but there is a struct called&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v5.0.0/structble__gap__opt__local__conn__latency__t.html"&gt;ble_gap_opt_local_conn_latency_t&lt;/a&gt;&amp;nbsp;that you can look into. Use it together with&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v5.0.0/group___b_l_e___c_o_m_m_o_n___f_u_n_c_t_i_o_n_s.html#ga511d431bc3d9ccf9bef09ad20cbf855a"&gt;sd_ble_opt_set()&lt;/a&gt;&amp;nbsp;to achieve what you wan&amp;#39;t.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android (mostly 7) is misbehaving on BLE connect</title><link>https://devzone.nordicsemi.com/thread/120985?ContentTypeID=1</link><pubDate>Thu, 15 Feb 2018 13:11:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:320f7e35-ae92-4dc5-a422-7e523ce777ee</guid><dc:creator>rgrr2</dc:creator><description>&lt;p&gt;Ok... thanks for the explanation.&amp;nbsp; Nevertheless your conclusion is a little bit too pessimistic for me.&lt;/p&gt;
&lt;p&gt;I do not think that our use case is such exotic: connect an Android (&amp;gt;=7) smartphone with a device which has current limitation.&lt;/p&gt;
&lt;p&gt;Why isn&amp;#39;t it possible to catch such situations on peripheral side?&amp;nbsp; The peripheral still follows the specification, if it would simply ignore connection intervals and leaves Rx and Tx completely off.&amp;nbsp; If I understand the mechanisms correctly, the central would do retries in this case.&lt;/p&gt;
&lt;p&gt;This would be close to &amp;quot;local slave latency&amp;quot;, or better &amp;quot;forced local slave latency&amp;quot; because even internally queued packets wouldn&amp;#39;t be transmitted during those ignore events.&lt;/p&gt;
&lt;p&gt;Does something in this direction already exist in the softdevice?&amp;nbsp; If not, I will be your fist beta tester for such a feature.&lt;/p&gt;
&lt;p&gt;H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android (mostly 7) is misbehaving on BLE connect</title><link>https://devzone.nordicsemi.com/thread/120961?ContentTypeID=1</link><pubDate>Thu, 15 Feb 2018 11:44:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3fdd92b4-9b78-4a7d-bd2b-ac9b953e5246</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;I looked more into this today and it seems like this behaviour is embedded in Android&amp;#39;s BLE stack as of Android 7 (I think).&amp;nbsp;&lt;/p&gt;
[quote user="Hardy"]the Android device is switching to &amp;quot;high&amp;quot; speed during GATT info exchange - that&amp;#39;s my current guess.[/quote]
&lt;p&gt;Yes that is correct.&amp;nbsp;&lt;/p&gt;
[quote user="Hardy"]Does anybody know of a way to prevent the Android device from switching speed?[/quote]
&lt;p&gt;Since the behaviour is defined by Android&amp;#39;s BLE stack this seems to be impossible.&amp;nbsp;&lt;/p&gt;
[quote user="Hardy"]Would it be possible to setup the Android internal GATT database so that Andoid sees no need to access the GATT data from the device?[/quote]
&lt;p&gt;Android caches the GATT database after each initial connection procedure and only updates the database if anything changes. This might be why you experience different behaviour based on the device&amp;#39;s &amp;quot;mood&amp;quot;. If you bond your devices you will also ensure that the database, as well as some security parameters, are stored across connections. However,&amp;nbsp;I can&amp;#39;t see anyway around that initial &amp;quot;high-speed&amp;quot; exchange of data, and it sounds like one &amp;quot;high-speed&amp;quot; transfer is one too many in your case.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This is one of the difficult parts regarding BLE. Although BLE is meticulously described in a&amp;nbsp;3000 pages long specification, there are still some room for interpretation and &amp;quot;unique&amp;quot; mechanisms. Different vendors, chipsets, and stacks might behave differently even though they all (usually) comply with the specification. So the bottom line is that&amp;nbsp;developing an application that expects the exact same behaviour from all peer devices is simply not possible.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android (mostly 7) is misbehaving on BLE connect</title><link>https://devzone.nordicsemi.com/thread/120896?ContentTypeID=1</link><pubDate>Wed, 14 Feb 2018 17:30:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14b082b2-e4ca-4ac4-a851-ccfe8bd10963</guid><dc:creator>rgrr2</dc:creator><description>&lt;p&gt;Concerning the 1mA limitation: our device is an industrial field device (see my profile ;-)) which has really limited power consumption (3.6mA @10V or so).&amp;nbsp; Main part is going to the sensor electronic and some part is available to the BLE connectivity.&lt;/p&gt;
&lt;p&gt;There are also limitations&amp;nbsp;to&amp;nbsp;buffering capacitors due to space requirements and Ex.&lt;/p&gt;
&lt;p&gt;H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android (mostly 7) is misbehaving on BLE connect</title><link>https://devzone.nordicsemi.com/thread/120895?ContentTypeID=1</link><pubDate>Wed, 14 Feb 2018 17:28:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10b6061a-0546-4fc1-a950-23af5d9045a3</guid><dc:creator>rgrr2</dc:creator><description>&lt;p&gt;yes, the Android device is switching to &amp;quot;high&amp;quot; speed during GATT info exchange - that&amp;#39;s my current guess.&lt;/p&gt;
&lt;p&gt;Does anybody know of a way to prevent the Android device from switching speed?&amp;nbsp; Would it be possible to setup the Android internal GATT database so that Andoid sees no need to access the GATT data from the device?&lt;/p&gt;
&lt;p&gt;Or is there any chance to tell the softdevice to slow down internally its GATT info exchange?&lt;/p&gt;
&lt;p&gt;Or a way to force a lokal slave latency?&lt;/p&gt;
&lt;p&gt;As you might see, I&amp;#39;m getting desperate...&lt;/p&gt;
&lt;p&gt;H.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android (mostly 7) is misbehaving on BLE connect</title><link>https://devzone.nordicsemi.com/thread/120852?ContentTypeID=1</link><pubDate>Wed, 14 Feb 2018 14:14:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:384edd52-af28-4c1a-85d5-862fe8d60b56</guid><dc:creator>MartinBL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This sounds like your&amp;nbsp;Android device is trying to balance speed and power consumption. It does this by using faster connection intervals when it knows that a lot of data is about to be transmitted so that the transfer completes faster. Then, after the intensive data transfer is completed, the connection intervals are relaxed again to save power. A typical scenario is that the Android device enforces fast intervals during the connection process and service discovery, and then throttles down afterwards (as far as I know&amp;nbsp;Apple devices don&amp;#39;t use this mechanism).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In BLE the connection parameters are ultimately enforced by the central&amp;nbsp;(your Android device). The min and max parameters you set in your peripheral application is just your &lt;em&gt;preferred&lt;/em&gt; values and the central may chose to reject them. Furthermore, different Android devices ships with different chipsets and BLE stacks, which may behave and perform differently.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is nothing you can do with TX power or timeslot API to change this. The change needs to be made on the Android side.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Here are two relevant threads:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/29907/high-ble-activity-for-15-seconds-after-connection"&gt;High BLE activity for 15 seconds after connection&lt;br /&gt;&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/15643/questions-about-connection-interval-negotiation"&gt;Questions about connection interval negotiation&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;May I ask what it is that limits your current consumption to just 1mA?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>