This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Increased Power Consumption in HRS Example After Connection, Before Notifications Enabled

I loaded the BLE peripheral HRS example from the Nordic SDK 17.0.2 on an nrf52840 DK. I connected a PPK II while connecting the peripheral using an nrf52840 dongle and the nrfconnect BLE pc app. I would connect to the nrf52840 DK via nrfconnect and then manually enable notifications on the heart rate measurement characteristic. There was a delay of 20 seconds or so between the initial connection and when I enabled notifications.

I noticed that the average current is an order of magnitude greater after connecting to the peripheral but before notifications are enabled compared to after notifications are enabled. Any insight as to why the difference in average current draw is so great would be much appreciated.

post connection, pre notification enable

post connection, post notification enable

Parents Reply
  • I can see that the connection is maintained at a 400 ms interval when there is no data transfer, and it increases to a 7.5 ms interval during the notification period.

    I see those same connection intervals but in opposite portions of the trace than you reference, 7.5 ms when the connection has been established but no notifications enabled and 400 ms after notifications are enabled. Although, it would make more sense if it was as you say so maybe I am missing something.

    I am using the unaltered BLE HRS peripheral example from the 17.0.2 SDK (nRF5_SDK_17.0.2_d674dde/examples/ble_peripheral/ble_app_hrs/main.c). I believe that the minimum connection interval for that example is 400 ms and there is no renegotiation as far as I know.

Children
  • Hi, yes you are right. It's opposite of what I said. Or actually, it's not related to notifications being enabled or not at all. The central is deciding the connection interval, and the peripheral can only request the interval. So what happens is that during the initial connection request by the central, the connection interval is set to 7.5ms. This is not dependent on any peripheral application settings. When testing here, I see that the initial connection interval is set to 50ms. Then the peripheral performs a connection update request, and in the hrs example the requested value is 400 - 650 ms. The time it takes for the peripheral to request a new connection interval after the initial connection procedure is given by the FIRST_CONN_PARAMS_UPDATE_DELAY definition in main.c.

  • Ah, okay I see what you're saying.

    FIRST_CONN_PARAMS_UPDATE_DELAY is set to 5 seconds in the hrs example correct? The period of high power draw in the capture I linked earlier is ~16 seconds. I have another one where it is 30 seconds. That seems to indicate that it is not related to FIRST_CONN_PARAMS_UPDATE_DELAY?

    Are you able to recreate what I'm seeing with a period of high power draw after the initial connection and before notifications are enabled? It's totally possible that the period of high power draw is not actually related to notifications enabled, but that's what it seemed like to me.

  • Hi, I do not see the same here. It changes the connection interval to 650 ms after FIRST_CONN_PARAMS_UPDATE_DELAY ms, and does not change whether notifications are enabled or not.

    Looks to me like the central is requesting a shorter connection interval.

    Yes, it seems to make sense that the connection interval will decrease after notifications are enabled, because of the ble_conn_params_init() design. It takes an argument, start_on_notify_cccd_handle, which is set to the hrs notification handle, and that is supposed to initiate a new connection update procedure after notifications are enabled. However that does not explain the shorter connection interval before notifications are enabled. Are you able to capture a BLE sniffer log? It would tell us what is going on between the central and the peripheral. Also, have you tried using a different central? Can you try to set the start_on_notify_cccd_handle variable to BLE_GATT_HANDLE_INVALID?

Related