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

Transmit sensor data every 15 minutes

Hi, 

We are using the heart rate example for developing our firmware, where we plan to send data out every 15 mins. But when we try to increase the advertisement interval beyond 15s the firmware doesn't seem to work. Is my approach correct where I am just increasing the advertisement interval?

#define APP_ADV_INTERVAL                24000//15sec                     /**< The advertising interval (in units of 0.625 ms (16 kHz). This value corresponds to 187.5 ms). */
#define APP_ADV_DURATION                1800                   /**< The advertising duration (180 seconds) in units of 10 milliseconds. */

#define APP_BLE_OBSERVER_PRIO           3                                       /**< Application's BLE observer priority. You shouldn't need to modify this value. */
#define APP_BLE_CONN_CFG_TAG            1                                       /**< A tag identifying the SoftDevice BLE configuration. */
#define MIN_CONN_INTERVAL               MSEC_TO_UNITS(100, UNIT_1_25_MS)        /**< Minimum acceptable connection interval (0.1 seconds). */
#define MAX_CONN_INTERVAL               MSEC_TO_UNITS(200, UNIT_1_25_MS)        /**< Maximum acceptable connection interval (0.2 second). */
#define SLAVE_LATENCY                   0                                       /**< Slave latency. */
#define CONN_SUP_TIMEOUT                MSEC_TO_UNITS(4000, UNIT_10_MS)         /**< Connection supervisory timeout (4 seconds). */

#define FIRST_CONN_PARAMS_UPDATE_DELAY  APP_TIMER_TICKS(5000)                   /**< Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (5 seconds). */
#define NEXT_CONN_PARAMS_UPDATE_DELAY   APP_TIMER_TICKS(30000)                  /**< Time between each call to sd_ble_gap_conn_param_update after the first call (30 seconds). */
#define MAX_CONN_PARAMS_UPDATE_COUNT    3                                       /**< Number of attempts before giving up the connection parameter negotiation. */

#define SEC_PARAM_BOND                  1                                       /**< Perform bonding. */
#define SEC_PARAM_MITM                  0                                       /**< Man In The Middle protection not required. */
#define SEC_PARAM_LESC                  0                                       /**< LE Secure Connections not enabled. */
#define SEC_PARAM_KEYPRESS              0                                       /**< Keypress notifications not enabled. */
#define SEC_PARAM_IO_CAPABILITIES       BLE_GAP_IO_CAPS_NONE                    /**< No I/O capabilities. */
#define SEC_PARAM_OOB                   0                                       /**< Out Of Band data not available. */
#define SEC_PARAM_MIN_KEY_SIZE          7                                       /**< Minimum encryption key size. */
#define SEC_PARAM_MAX_KEY_SIZE          16                                      /**< Maximum encryption key size. */

  • Hi,

    It sounds like you might be confusing advertising interval and connection interval. The advertising interval is used to specify the time between each advertising, and the connection interval is used to specify the time between each data transfer event.
    However, given that you are looking to do data transfer every 15 minutes, you will have significantly less power consumption if you terminate the connection between each data transfer(and perhaps also sleeping the device until next transfer, if it is not busy doing something else in the meantime). That is to say, turning off the radio for the entire duration it is not in active use.

    If you would like to familiarize yourself more with the intrinsics of BLE communication I can recommend you these tutorials: advertising process, BLE services, or BLE characteristics.

    Best regards,
    Karl

     

Related