<?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>High power when connected and Sleeping</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35080/high-power-when-connected-and-sleeping</link><description>When Going into Sleep, I see peaks of 12mA every 30ms (see image) I&amp;#39;m assuming I can adjust that changing the connection interval settings. I have my Connection intervals set as: #define CONN_INTERVAL_DEFAULT (uint16_t)(MSEC_TO_UNITS(500, UNIT_1_25_MS</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 14 Jun 2018 08:02:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35080/high-power-when-connected-and-sleeping" /><item><title>RE: High power when connected and Sleeping</title><link>https://devzone.nordicsemi.com/thread/136074?ContentTypeID=1</link><pubDate>Thu, 14 Jun 2018 08:02:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69a3765a-7160-4c99-9e60-b7f6667f5aea</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;You are right, the&amp;nbsp;conn_handle should not be 0 when you have a connected event. Can you upload the rest of your code to provide more context? Which SDK version are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High power when connected and Sleeping</title><link>https://devzone.nordicsemi.com/thread/135991?ContentTypeID=1</link><pubDate>Wed, 13 Jun 2018 15:54:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5bfa31db-72d4-40f3-a84b-a5ee52e60052</guid><dc:creator>mraposo1</dc:creator><description>&lt;p&gt;Here is what I tried inside&amp;nbsp;on_ble_gap_evt_connected:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;ble_gap_conn_params_t ConnParams;&lt;/p&gt;
&lt;p&gt;ConnParams.min_conn_interval = 0xF0;&lt;br /&gt; ConnParams.max_conn_interval = 0xF0;&lt;br /&gt; ConnParams.conn_sup_timeout = 0x200;&lt;/p&gt;
&lt;p&gt;if (&lt;span&gt;p_gap_evt-&amp;gt;conn_handle&amp;nbsp;&lt;/span&gt;!= 0)&lt;br /&gt; {&lt;br /&gt; err_code = sd_ble_gap_conn_param_update(p_gap_evt-&amp;gt;conn_handle, &amp;amp;ConnParams);&lt;br /&gt; APP_ERROR_CHECK(err_code);&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;But&amp;nbsp;&lt;span&gt;p_gap_evt-&amp;gt;conn_handle is always 0.&amp;nbsp; &lt;br /&gt;&lt;/span&gt;&lt;span&gt;How is that even possible?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High power when connected and Sleeping</title><link>https://devzone.nordicsemi.com/thread/135838?ContentTypeID=1</link><pubDate>Wed, 13 Jun 2018 07:06:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce9c8bdf-6ff6-4597-b32b-a4d84ae2f1e4</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;OK, so we see that the connection interval chosen by the central is 0x18 * 1.25 ms = 30 ms, which matches the current spikes. You only call &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v5.0.0/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html?cp=2_3_2_1_1_2_1_2_25#ga7fa1d11a93b9738f7695ec3d6758da86"&gt;sd_ble_gap_ppcp_set()&lt;/a&gt;&amp;nbsp;in the code snippet. Most likely the central ignores / never reads this, so you should also request a connection parameter update if you find the connection parameters unacceptable. You can do this with &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s140.api.v5.0.0/group___b_l_e___g_a_p___f_u_n_c_t_i_o_n_s.html?cp=2_3_2_1_1_2_1_2_9#gaf89b434841998ab384e0612dca9e12f8"&gt;sd_ble_gap_conn_param_update()&lt;/a&gt;&amp;nbsp;directly, or using the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/lib_ble_conn_params.html?cp=4_0_0_3_2_4"&gt;connection parameters module&lt;/a&gt; which is used in for example the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/ble_sdk_app_hrs.html?cp=4_0_0_4_1_2_13"&gt;Heart Rate Application example&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High power when connected and Sleeping</title><link>https://devzone.nordicsemi.com/thread/135800?ContentTypeID=1</link><pubDate>Tue, 12 Jun 2018 17:21:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2dfd6a2-f473-415c-a37d-aec1880ae12d</guid><dc:creator>mraposo1</dc:creator><description>&lt;p&gt;This is zoomed in&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1528822898421v3.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;And this is zoomed out&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1528822945382v5.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;3mA average while connected,&lt;br /&gt;&lt;br /&gt;Here are the Connection params:&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1528824076438v6.png" alt=" " /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High power when connected and Sleeping</title><link>https://devzone.nordicsemi.com/thread/135674?ContentTypeID=1</link><pubDate>Tue, 12 Jun 2018 07:31:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66c87bee-f895-49ed-9e6d-408321f4b541</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Can you please look at my &lt;a href="https://devzone.nordicsemi.com/support-private/support/207828"&gt;previous post&lt;/a&gt; and answer the few questions there? It will hopefully bring us closer to understanding what is going on.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High power when connected and Sleeping</title><link>https://devzone.nordicsemi.com/thread/135627?ContentTypeID=1</link><pubDate>Mon, 11 Jun 2018 15:42:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edcc5d9c-4cc8-46b1-a233-544bcef8ba0d</guid><dc:creator>mraposo1</dc:creator><description>&lt;p&gt;Any updates on this one?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High power when connected and Sleeping</title><link>https://devzone.nordicsemi.com/thread/134828?ContentTypeID=1</link><pubDate>Wed, 06 Jun 2018 06:25:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eaf9ae12-eb15-4741-8de3-428a2af5ac4f</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;It is not advertising then, as you should have a advertising interval of&amp;nbsp;2000 * 0.625 ms = 1.25 s, so it is probably in a connection as you wrote. We can see more clearly if you &amp;quot;zoom in&amp;quot; on one of the spikes in time (so that the x axis is only a few microseconds).&lt;/p&gt;
&lt;p&gt;Assuming this is connection events, then the connection interval is 30 seconds regardless of what you configure. That is possible, as connection parameters can only be requested by the peripheral. It is always the central that decides. The peripheral can disconnect if the connection parameters are unacceptable, but I do not see that in your code.&lt;/p&gt;
&lt;p&gt;You can verify what is actually being used by using a sniffer to see the connection request and connection parameter updates, or by logging this in the nRF side when you get the BLE_GAP_EVT_CONNECTED event (p_ble_evt-&amp;gt;evt.gap_evt.connected.conn_params).&lt;/p&gt;
&lt;p&gt;Which chip and SDK version are you using?&lt;/p&gt;
&lt;p&gt;(I also want to mention that you can get a better software for the power profiler, as the &lt;a href="https://www.google.no/search?q=nrf+connect+dekstop&amp;amp;oq=nrf+connect+dekstop&amp;amp;aqs=chrome..69i57j0.3343j1j7&amp;amp;sourceid=chrome&amp;amp;ie=UTF-8"&gt;nRF Connect for Desktop&lt;/a&gt; now has a Power Profiler plugin.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High power when connected and Sleeping</title><link>https://devzone.nordicsemi.com/thread/134814?ContentTypeID=1</link><pubDate>Tue, 05 Jun 2018 21:02:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6b2bc9b-6a96-4b38-bb99-8f24fd5d3d8c</guid><dc:creator>mraposo1</dc:creator><description>&lt;p&gt;Here is my code:&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;NRF_BLE_GATT_DEF(m_gatt); // GATT module instance.&lt;/p&gt;
&lt;p&gt;ble_gap_adv_params_t const adv_params =&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; .type = BLE_GAP_ADV_TYPE_ADV_IND,&lt;br /&gt;&amp;nbsp; .p_peer_addr = NULL,&lt;br /&gt;&amp;nbsp; .fp = BLE_GAP_ADV_FP_ANY,&lt;br /&gt;&amp;nbsp; .interval = ADV_INTERVAL,&lt;br /&gt;&amp;nbsp; .timeout = 30,&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;static MTU_params_t CocoonService_MTU_Params =&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; .att_mtu = NRF_SDH_BLE_GATT_MAX_MTU_SIZE,&lt;br /&gt;&amp;nbsp; .conn_interval = CONN_INTERVAL_DEFAULT,&lt;br /&gt;&amp;nbsp; .data_len_ext_enabled = true,&lt;br /&gt;&amp;nbsp; .conn_evt_len_ext_enabled = true,&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp; .phys.tx_phys = BLE_GAP_PHY_2MBPS | BLE_GAP_PHY_1MBPS,&lt;br /&gt;&amp;nbsp; .phys.rx_phys = BLE_GAP_PHY_2MBPS | BLE_GAP_PHY_1MBPS,&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;static ble_gap_conn_params_t MyService_conn_param =&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; .min_conn_interval = CONN_INTERVAL_MIN, // Minimum connection interval.&lt;br /&gt;&amp;nbsp; .max_conn_interval = CONN_INTERVAL_MAX, // Maximum connection interval.&lt;br /&gt;&amp;nbsp; .slave_latency = SLAVE_LATENCY, // Slave latency.&lt;br /&gt;&amp;nbsp; .conn_sup_timeout = CONN_SUP_TIMEOUT // Supervisory timeout.&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;static ble_advdata_t const adv_data =&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; .name_type = BLE_ADVDATA_FULL_NAME,&lt;br /&gt;&amp;nbsp; .flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE,&lt;br /&gt;&amp;nbsp; .include_appearance = false,&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;static ble_advertising_init_t init;&lt;/p&gt;
&lt;p&gt;static ble_uuid_t m_adv_uuids[] = {{1523, BLE_UUID_TYPE_BLE}};&lt;br /&gt;static ble_advertising_t m_advertising; &lt;br /&gt;static Cocoon_ctx_t m_MyService_ctx;&lt;br /&gt;static bool volatile m_mtu_exchanged;&lt;br /&gt;static bool volatile m_data_length_updated;&lt;/p&gt;
&lt;p&gt;static bool volatile = false;&lt;br /&gt;static uint16_t BT_conn_handle = BLE_CONN_HANDLE_INVALID; /**&amp;lt; Handle of the current BLE connection .*/&lt;br /&gt;static bool volatile BT_conn_interval_configured = false;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;int main(void)&lt;br /&gt;{&lt;br /&gt;&amp;nbsp; uint8_t PendingInt;&lt;br /&gt;&amp;nbsp; ret_code_t err_code;&lt;br /&gt;&amp;nbsp; ble_gap_conn_sec_mode_t sec_mode;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; uint16_t service_handle;&lt;br /&gt;&amp;nbsp; ble_uuid_t ble_uuid;&lt;br /&gt;&amp;nbsp; ble_uuid128_t base_uuid = {SERVICE_UUID_BASE};&lt;/p&gt;
&lt;p&gt;&amp;nbsp; ble_stack_init();&lt;/p&gt;
&lt;p&gt;&amp;nbsp; CocoonUtils_LogInit();&lt;/p&gt;
&lt;p&gt;&amp;nbsp; BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;sec_mode);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; err_code = sd_ble_gap_device_name_set(&amp;amp;sec_mode, (uint8_t const *)DEVICE_NAME, strlen(DEVICE_NAME));&lt;br /&gt;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; err_code = sd_ble_gap_ppcp_set(&amp;amp;MyService_conn_param);&lt;br /&gt;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; err_code = nrf_ble_gatt_init(&amp;amp;m_gatt, gatt_evt_handler);&lt;br /&gt;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; err_code = ble_advdata_set(&amp;amp;adv_data, NULL);&lt;br /&gt;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; memset(&amp;amp;init, 0, sizeof(init));&lt;/p&gt;
&lt;p&gt;&amp;nbsp; init.advdata.name_type = BLE_ADVDATA_FULL_NAME;&lt;br /&gt;&amp;nbsp; init.advdata.include_appearance = true;&lt;br /&gt;&amp;nbsp; init.advdata.flags = BLE_GAP_ADV_FLAGS_LE_ONLY_GENERAL_DISC_MODE;&lt;br /&gt;&amp;nbsp; init.advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);&lt;br /&gt;&amp;nbsp; init.advdata.uuids_complete.p_uuids = m_adv_uuids;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; init.config.ble_adv_fast_enabled = true;&lt;br /&gt;&amp;nbsp; init.config.ble_adv_fast_interval = ADV_INTERVAL;&lt;br /&gt;&amp;nbsp; init.config.ble_adv_fast_timeout = ADV_TIMEOUT_IN_SECONDS;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; init.evt_handler = on_adv_evt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; err_code = ble_advertising_init(&amp;amp;m_advertising, &amp;amp;init);&lt;br /&gt;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; err_code = sd_ble_uuid_vs_add(&amp;amp;base_uuid, &amp;amp;(m_MyService_ctx.uuid_type));&lt;br /&gt;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; ble_uuid.type = m_MyService_ctx.uuid_type;&lt;br /&gt;&amp;nbsp; ble_uuid.uuid = AMT_SERVICE_UUID;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; // Add service.&lt;br /&gt;&amp;nbsp; err_code = sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY, &amp;amp;ble_uuid, &amp;amp;service_handle);&lt;br /&gt;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; err_code = ble_advertising_start(&amp;amp;m_advertising, BLE_ADV_MODE_FAST;&lt;br /&gt;&amp;nbsp; APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; while (1)&lt;br /&gt;&amp;nbsp; {&lt;br /&gt;&amp;nbsp; &amp;nbsp; err_code = sd_app_evt_wait();&lt;br /&gt;&amp;nbsp; &amp;nbsp; APP_ERROR_CHECK(err_code);&lt;br /&gt;&amp;nbsp; } &lt;/p&gt;
&lt;p&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High power when connected and Sleeping</title><link>https://devzone.nordicsemi.com/thread/134810?ContentTypeID=1</link><pubDate>Tue, 05 Jun 2018 20:39:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06cd775a-d98e-40f6-bd83-b2f89dd2c36b</guid><dc:creator>mraposo1</dc:creator><description>&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1528231136382v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High power when connected and Sleeping</title><link>https://devzone.nordicsemi.com/thread/134794?ContentTypeID=1</link><pubDate>Tue, 05 Jun 2018 17:14:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73465d6c-867b-49d9-bd0c-5363af2c2905</guid><dc:creator>mraposo1</dc:creator><description>&lt;p&gt;This is in connected state.&lt;br /&gt;My APP_ADV_INTERVAL is 2000.&lt;br /&gt;What level of resolution do you need to be able to have a better view of the power profile?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: High power when connected and Sleeping</title><link>https://devzone.nordicsemi.com/thread/134707?ContentTypeID=1</link><pubDate>Tue, 05 Jun 2018 11:11:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcde07f6-546c-4f38-a410-c97fc3829dca</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It is difficult to recognize the power profile as the time resolution is not good, but it looks like the device is advertising and not in a connected state. Can you verify that? If so, you have to adjust the advertising interval instead. You can increase the advertising interval by increasing the value of&amp;nbsp;&lt;code&gt;APP_ADV_INTERVAL&lt;/code&gt; in most BLE peripheral examples.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>