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

[ZIGBEE] SLEEPY ZED TIMER BEHAVIOR

SDK: 4.1.0

CHIP: 52840

old question

Hi, I have developed sleepy zed.

I have success to send "request data" in every 5 sec.

I wants to add regular job which is send set attribute ias zone state in every 5 minutes.

 

static void zigbee_timer_handler(void * p_context)
{
    // DEBUG_FUNC();
    m_timer_s += ZIGBEE_TIMER_SEC;
    if (m_timer_s >= ZIGBEE_ATTR_TIMEOUT) {
        m_timer_s = 0;
        zb_ret_t zb_err_code;
        zb_err_code = ZB_SCHEDULE_APP_CALLBACK(
            send_ias_zone_audit_status_msg, 
            0);
        ZB_ERROR_CHECK(zb_err_code);
    }
}

void send_ias_zone_audit_status_msg(uint8_t param)
{
    uint16_t ias_zone_status;
    ias_zone_status = ... ;
    _send_ias_zone_audit_status_msg(ias_zone_status);
}

void _send_ias_zone_audit_status_msg(uint16_t ias_zone_status)
{
    zb_bool_t ret = false;
    zb_bufid_t buf_id = zb_buf_get_out();
    
    ret = zb_zcl_ias_zone_set_status(DOOR_LOCK_ENDPOINT,
                                    (zb_uint16_t) ias_zone_status,
                                    0,
                                    buf_id);
}

Adding this code makes the zed timer behave weird.

It works in the beginning. but After a few minutes, zed doesn't send data request. and doesn't wake regularly.

After a few minutes, zed send out multiple data request packets. 

and finally, It never send data request packet.

In this condition, zb_zcl_ias_zone_set_status always returns false.

How can I fix this?

The zigbee stack is too hard to be developed. 

I'm not using FreeRTOS. the behavior is very similar with link.

Parents
  • Hi,

    When you use multiprotocol Zigbee and BLE, the radio hardware is time-sliced between the two protocols, and each radio protocol requests a timeslot prior to any radio operation.

    Because of the BLE protocol nature (TDMA), the BLE has priority over Zigbee. Therefore, any kind of application or Zigbee stack logic can be interrupted by the BLE activity, which can result in the node missing a frame and not responding with a MAC-level acknowledgment. You can read about this and other multiprotocol considerations here.

    This might affect your application and be a reason for why it doesn't send data request or wake, and then suddenly sends out multiple data requests. I'll need to research some more to figure out exactly what is failing in your application. Could you please capture a sniffer log of this happening and attach it here as a pcap file?

    Best regards,

    Marte

Reply
  • Hi,

    When you use multiprotocol Zigbee and BLE, the radio hardware is time-sliced between the two protocols, and each radio protocol requests a timeslot prior to any radio operation.

    Because of the BLE protocol nature (TDMA), the BLE has priority over Zigbee. Therefore, any kind of application or Zigbee stack logic can be interrupted by the BLE activity, which can result in the node missing a frame and not responding with a MAC-level acknowledgment. You can read about this and other multiprotocol considerations here.

    This might affect your application and be a reason for why it doesn't send data request or wake, and then suddenly sends out multiple data requests. I'll need to research some more to figure out exactly what is failing in your application. Could you please capture a sniffer log of this happening and attach it here as a pcap file?

    Best regards,

    Marte

Children
Related