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

Question) How to Send Payload from ZED to ZC?

Hello, I'm testing an example of a zigby light bulb with a nrf52840 (pca 10056) board.

Here, when I press "BUTNERT 1" on ZED, I want to send the [ON/OFF] status of the current light bulb to ZC.

I was told to use a  Here   at the next link, so I put it in and used it. 

But it was not sent to ZC.
Did you miss anything while developing it?

ZCL Messaging Cluster used it

Code written by me

/* MESSAGE TEST */
static zb_zcl_messaging_display_message_payload_t test_disp;




static void test_light(zb_bufid_t bufid, zb_uint16_t on_off){
    zb_uint16_t ZC_short_addr = 0xFFFF;
    test_disp.extended_message_control =0x00;

    test_disp.message = "HELLO WORLD";
    test_disp.message_len = sizeof("HELLO WORLD");

    ZB_ZCL_MESSAGING_SEND_DISPLAY_MSG((zb_uint8_t)bufid,ZC_short_addr,ZB_APS_ADDR_MODE_16_ENDP_PRESENT,
                                      (zb_uint8_t)0,(zb_uint8_t)10,&test_disp);
}

static void buttons_handler(bsp_event_t evt)
{
    zb_ret_t zb_err_code;

    switch(evt)
    {
        case IDENTIFY_MODE_BSP_EVT:
            /* Check if endpoint is in identifying mode, if not put desired endpoint in identifying mode. */
            if (m_dev_ctx.identify_attr.identify_time == ZB_ZCL_IDENTIFY_IDENTIFY_TIME_DEFAULT_VALUE)
            {
                NRF_LOG_INFO("Bulb put in identifying mode");
                zb_err_code = zb_bdb_finding_binding_target(HA_DIMMABLE_LIGHT_ENDPOINT);
                ZB_ERROR_CHECK(zb_err_code);
            }
            else
            {
                NRF_LOG_INFO("Cancel F&B target procedure");
                zb_bdb_finding_binding_target_cancel();
            }
            break;
        case BSP_EVENT_KEY_0 :
            zb_buf_get_out_delayed_ext(test_light,ZB_TRUE,32);
            break;
        default:
            NRF_LOG_INFO("Unhandled BSP Event received: %d", evt);
            break;
    }
}

Are the coordinators short_addr and ep always 0xFFFF and 0?

thanks

Parents
  • The ZC was set up as follows:

    /* receive test */
    
    static zb_void_t zcl_receive(zb_bufid_t  *bufid)
    {
        NRF_LOG_INFO("zcl test");
    }
    /* receive test */
    
    
    
    
    int main(void)
    {
        zb_ret_t       zb_err_code;
        zb_ieee_addr_t ieee_addr;
        
        timers_init();
        log_init();
        leds_buttons_init();
        
        ZB_SET_TRACE_LEVEL(ZIGBEE_TRACE_LEVEL);
        ZB_SET_TRACE_MASK(ZIGBEE_TRACE_MASK);
        ZB_SET_TRAF_DUMP_OFF();
    
        /* Initialize Zigbee stack. */
        ZB_INIT("zc");
    
        /* Set device address to the value read from FICR registers. */
        zb_osif_get_ieee_eui64(ieee_addr);
        zb_set_long_address(ieee_addr);
    
        /* Set channels on which the coordinator will try to create a new network. */
        zb_set_network_coordinator_role(IEEE_CHANNEL_MASK);
        zb_set_max_children(MAX_CHILDREN);
        
         /* zigbee receive test */
        ZB_ZCL_REGISTER_DEVICE_CB(zcl_receive);
        
        zigbee_erase_persistent_storage(ERASE_PERSISTENT_CONFIG);
        
        zb_err_code = zboss_start_no_autostart();
        ZB_ERROR_CHECK(zb_err_code);
        
        while(1)
        {
            zboss_main_loop_iteration();
            UNUSED_RETURN_VALUE(NRF_LOG_PROCESS());
        }
    }
    
    

Reply
  • The ZC was set up as follows:

    /* receive test */
    
    static zb_void_t zcl_receive(zb_bufid_t  *bufid)
    {
        NRF_LOG_INFO("zcl test");
    }
    /* receive test */
    
    
    
    
    int main(void)
    {
        zb_ret_t       zb_err_code;
        zb_ieee_addr_t ieee_addr;
        
        timers_init();
        log_init();
        leds_buttons_init();
        
        ZB_SET_TRACE_LEVEL(ZIGBEE_TRACE_LEVEL);
        ZB_SET_TRACE_MASK(ZIGBEE_TRACE_MASK);
        ZB_SET_TRAF_DUMP_OFF();
    
        /* Initialize Zigbee stack. */
        ZB_INIT("zc");
    
        /* Set device address to the value read from FICR registers. */
        zb_osif_get_ieee_eui64(ieee_addr);
        zb_set_long_address(ieee_addr);
    
        /* Set channels on which the coordinator will try to create a new network. */
        zb_set_network_coordinator_role(IEEE_CHANNEL_MASK);
        zb_set_max_children(MAX_CHILDREN);
        
         /* zigbee receive test */
        ZB_ZCL_REGISTER_DEVICE_CB(zcl_receive);
        
        zigbee_erase_persistent_storage(ERASE_PERSISTENT_CONFIG);
        
        zb_err_code = zboss_start_no_autostart();
        ZB_ERROR_CHECK(zb_err_code);
        
        while(1)
        {
            zboss_main_loop_iteration();
            UNUSED_RETURN_VALUE(NRF_LOG_PROCESS());
        }
    }
    
    

Children
Related