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

Configure TLM Frame type by default in Eddystone beacon - SDK 12.2.0

Hi, in the current project I'm working on, I need to develop an Eddystone beacon with UID and TLM frames configured by default. Based on the experimental_eddystone example, there is only one slot (slot 0) for configuring a default frame type. I successfully set it as UID frame type (in example it is URL type) and for configuring TLM frame type by default in slot 1, I modified es_slots.c. When I run the code on nRF51822xxAA and then scanning the device using nRFConnect, I receive both frame types, UID and TLM, but for TLM, voltage and temperature values are missed. However, after 2 and a half minutes, I started receiving voltage and temperature values.

When I test the same code on nRF52DK, TLM frame is OK since power-up so I'm not sure if the issue is related with changes I've made to es_slots.c or is something with ADC handling.

Is there any recommendation on how to set properly more than one slot with a default frame?

EDIT 1:

I've found that beacon starts sending real values of voltage and temperature when adv_cnt is 58-60, it is not time-related. In my first description I had an advertising interval in 5 seconds which results in 2 minutes and a half for 60 adv pkts (2.5 secs * 60 adv pkts = 150 secs). Then I test using 2 seconds as advertising interval, and after a minute, voltage and temperature values sent, were correct (1 sec * 60 adv pkts = 60 secs)

Parents
  • Hi @sigurdon, I was using a function to update temperature and voltage values but advertising packet was not filled. Also, the name of the defines you mentioned (APP_CONFIG_TLM__INTERVAL_SECONDS) are misleading because the interval is not in seconds but in advertising tries instead. That works on the example because advertising interval is set to 1 second. This caused the delay in updating my variables values. BTW, I already successfully configured both slots, 0 and 1 to UID and TLM frame types, respectively. Should I close this question without an answer or should I convert this comment into answer?

    EDIT (Solution):

    I added this line to es_app_config.h:

    #define APP_ENABLE_TLM_BY_DEFAULT    1    // Enable a TLM frame in slot 0 by default
    

    and this to es_slot.c, after this conditional if (err_code == FDS_ERR_NOT_FOUND):

    if (err_code == FDS_ERR_NOT_FOUND)
    {
    	// Factory reset or initial boot, load default data
    	memcpy(&m_reg.slots[default_uid_slot], p_default_slot, sizeof(*p_default_slot));
    	es_slot_reg_update_slot_list_info_on_add(&m_reg, default_uid_slot, p_default_slot->adv_frame.type, true);
    
    #if APP_ENABLE_TLM_BY_DEFAULT == 1
        es_slot_reg_update_slot_list_info_on_add(&m_reg, default_tlm_slot, ES_FRAME_TYPE_TLM, true);
    	m_reg.slots[default_tlm_slot].adv_frame.type = ES_FRAME_TYPE_TLM;
    	memcpy(&m_reg.slots[default_tlm_slot].adv_frame.frame, &m_reg.slots[default_tlm_slot].adv_frame.type, 1);
    	m_reg.slots[default_tlm_slot].adv_frame.length = ES_TLM_LENGTH;
    #endif
    }
    
  • Great that you figured it out! and thank you for adding the answer here. I will report this misleading name to the Eddystone developers. I have converted your comment into an answer and given you an up-vote.

Reply Children
No Data
Related