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

How many retries in Eddystone beacon advertisement ?

Hello Everyone,

We have 2 devices. 1st device is flashed with the Eddystone example & sending TLM info. The 2nd device is flashed with a modified version of the ble_app_hrs_c example. We a added printout in ble_evt_handler for BLE_GAP_EVT_ADV_REPORT whenever it receives beacon. We set NRF_BLE_SCAN_SCAN_WINDOW 4 & NRF_BLE_SCAN_SCAN_INTERVAL 4 (2.5ms).

When the eddystone beacon sends an advertisement, the 2nd device receives anywhere from 0 to 8 beacons with the same ADV_COUNT on different advertisement channels.

Q1: When we tell the software to send an Eddystone beacon, how many beacons are actually sent (retries) with the same TLM information?

Q2: Can we limit/change the number of times beacons are sent per ADV_COUNT (retries)?

Q3: Can i know when Eddystone beacon send is done including retries ?

sdk 15.2, nrf52832

Thanks.

  • Hi,

    Q1) The TLM information is by default updated every 10 sec. (APP_CONFIG_TLM_TEMP_VBATT_UPDATE_INTERVAL_SECONDS in es_app_config.h).

    Information about temperature and battery voltage is updated every 30 sec(APP_CONFIG_TLM_TEMP_INTERVAL_SECONDS/ APP_CONFIG_TLM_VBATT_INTERVAL_SECONDS).

    We send a packet(one packet across 3 advertising channels) each APP_CFG_NON_CONN_ADV_INTERVAL_MS(default value 1000). When investigating this some more, I figured out that the SoftDevice expects this to be in 625 us units when calling sd_ble_gap_adv_set_configure(), and we unfortunately don't do this in adv_start() function in the file es_adv.c. This mismatch will affect the ADV_COUNT, so we should fix this. 

    The function adv_start() in es_adv.c with the fix should look like this:

    static void adv_start(ble_gap_adv_params_t * p_adv_params)
    {
        ret_code_t err_code = NRF_SUCCESS;
    
        es_tlm_adv_cnt_inc();
    
        uint32_t interval_0625 = MSEC_TO_UNITS(p_adv_params->interval,UNIT_0_625_MS);
    
        p_adv_params->interval = interval_0625;
    
        err_code = sd_ble_gap_adv_set_configure(mp_adv_handle, &m_adv_data, p_adv_params);
        APP_ERROR_CHECK(err_code);
    
        err_code = sd_ble_gap_adv_start(*mp_adv_handle, BLE_CONN_CFG_TAG_DEFAULT);
    
        if (err_code != NRF_ERROR_BUSY && err_code != NRF_SUCCESS)
        {
            APP_ERROR_CHECK(err_code);
        }
    }

     The ADV_COUNT is not the numbers of retries per say, it's just an incremented counter that is incremented for every APP_CONFIG_TLM_ADV_INTERLEAVE_RATIO packets that are sent.(default value 5).

    Q2) A packet will be send every APP_CFG_NON_CONN_ADV_INTERVAL_MS, and ADV_COUNT is increment when you have sent APP_CONFIG_TLM_ADV_INTERLEAVE_RATIO numbers of packet(s).

    Q3) It will send a packet each advertising interval(by defeault 1000 ms with the fix).

Related