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

Confused about polling interval

I have been studying the power consumption of a prototype and observe that the end device is polling very frequently.

The data request polling is backing off for a while to about every 3 seconds, but suddenly (efter 15 seconds or so) the device starts polling every 200 ms or so. 

If I disable the turbo polling mode then the polling will be every 500ms from start.

I'm wondering if you can help me put with some pointers to there I should start looking. 
My goal is to poll once every ten seconds or so, and maybe a increased polling rate after any device activity to fetch pending commands.  

My project is based on the multiprotocol doorlock example in sdk 4.0.0 and I am using SDK 16.0 to fill in the gaps to make it compile. Changes that I have meade includes moving the application out of the sdk-directory structure and I am using make and gcc to build it.

A log from wireshark: 

Power measurement:

Parents
  • Hi,

    Sorry for the late reply. The default value for long poll interval is 5 seconds. To change the data polling intervall you need to use zb_zdo_pim_set_long_poll_interval(zb_time_t ms).

    Best regards,

    Marjeris

  • I'd be happy even with the default value but it is not working. the interval is 280ms after 15s.

    When can I use the function call? I have done it in the callback when network is joined:

    ```

    void zboss_signal_handler(zb_bufid_t bufid)
    {
    zb_zdo_app_signal_hdr_t * p_sg_p = NULL;
    zb_zdo_app_signal_type_t sig = zb_get_app_signal(bufid, &p_sg_p);
    zb_ret_t status = ZB_GET_APP_SIGNAL_STATUS(bufid);
    zb_ret_t zb_err_code;

    /* Update network status LED */
    zigbee_led_status_update(bufid, ZIGBEE_NETWORK_STATE_LED);

    switch(sig)
    {
    case ZB_BDB_SIGNAL_DEVICE_REBOOT:
    /* fall-through */
    case ZB_BDB_SIGNAL_STEERING:
    if (status == RET_OK)
    {
    zb_ext_pan_id_t extended_pan_id;
    char ieee_addr_buf[17] = {0};
    int addr_len;

    zb_get_extended_pan_id(extended_pan_id);
    addr_len = ieee_addr_to_str(ieee_addr_buf, sizeof(ieee_addr_buf), extended_pan_id);
    if (addr_len < 0)
    {
    strcpy(ieee_addr_buf, "unknown");
    }

    NRF_LOG_INFO("Joined network successfully (Extended PAN ID: %s, PAN ID: 0x%04hx)", NRF_LOG_PUSH(ieee_addr_buf), ZB_PIBCACHE_PAN_ID());

    zb_zdo_pim_set_long_poll_interval(ZB_MILLISECONDS_TO_BEACON_INTERVAL(10000));
    // zb_zdo_pim_set_long_poll_interval(ZB_PIM_DEFAULT_LONG_POLL_INTERVAL);
    // zb_zdo_pim_start_turbo_poll_packets(10);
    }
    else
    {
    NRF_LOG_ERROR("Failed to join network (status: %d)", status);
    bsp_board_led_off(ZIGBEE_NETWORK_STATE_LED);
    zb_err_code = ZB_SCHEDULE_APP_ALARM(door_lock_leave_and_join, 0, ZB_TIME_ONE_SECOND);
    ZB_ERROR_CHECK(zb_err_code);
    }
    break;

    ```

Reply
  • I'd be happy even with the default value but it is not working. the interval is 280ms after 15s.

    When can I use the function call? I have done it in the callback when network is joined:

    ```

    void zboss_signal_handler(zb_bufid_t bufid)
    {
    zb_zdo_app_signal_hdr_t * p_sg_p = NULL;
    zb_zdo_app_signal_type_t sig = zb_get_app_signal(bufid, &p_sg_p);
    zb_ret_t status = ZB_GET_APP_SIGNAL_STATUS(bufid);
    zb_ret_t zb_err_code;

    /* Update network status LED */
    zigbee_led_status_update(bufid, ZIGBEE_NETWORK_STATE_LED);

    switch(sig)
    {
    case ZB_BDB_SIGNAL_DEVICE_REBOOT:
    /* fall-through */
    case ZB_BDB_SIGNAL_STEERING:
    if (status == RET_OK)
    {
    zb_ext_pan_id_t extended_pan_id;
    char ieee_addr_buf[17] = {0};
    int addr_len;

    zb_get_extended_pan_id(extended_pan_id);
    addr_len = ieee_addr_to_str(ieee_addr_buf, sizeof(ieee_addr_buf), extended_pan_id);
    if (addr_len < 0)
    {
    strcpy(ieee_addr_buf, "unknown");
    }

    NRF_LOG_INFO("Joined network successfully (Extended PAN ID: %s, PAN ID: 0x%04hx)", NRF_LOG_PUSH(ieee_addr_buf), ZB_PIBCACHE_PAN_ID());

    zb_zdo_pim_set_long_poll_interval(ZB_MILLISECONDS_TO_BEACON_INTERVAL(10000));
    // zb_zdo_pim_set_long_poll_interval(ZB_PIM_DEFAULT_LONG_POLL_INTERVAL);
    // zb_zdo_pim_start_turbo_poll_packets(10);
    }
    else
    {
    NRF_LOG_ERROR("Failed to join network (status: %d)", status);
    bsp_board_led_off(ZIGBEE_NETWORK_STATE_LED);
    zb_err_code = ZB_SCHEDULE_APP_ALARM(door_lock_leave_and_join, 0, ZB_TIME_ONE_SECOND);
    ZB_ERROR_CHECK(zb_err_code);
    }
    break;

    ```

Children
No Data
Related