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

  • 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());
        }
    }
    
    

  • Short address defined to 0xffff means the broadcast message.Anyone can access the message.If you want to send the unique ZC, you have to fill the address of long or short address of coordinator.

    By the way, zigbee can assign the PANID and channel to define the group. 

  • At ZC (Zigby Light Coordinator sdk),
    The long address of ZC can be found by using zb_get_long_address.


    However, the function zb_get_short_address , which returns short-address, is missing and an error appears.


    However, I want to get the short or long address of ZC from ZED.

    Is there a way?

    thanks

  • Hi,

    I'm sorry for the late reply.

    The short address (Nwk Addr) of the ZC will be 0x0000. You can test this out yourself with the CLI agent sample if you want to. After setting the devices role as ZC with "bdb role zc" and starting the network with "bdb start", you can check the devices short address with "zdo short". You can get IEEE address using the short address with zb_address_ieee_by_short.

    Best regards,

    Marte

Related