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

I want to create 2 endpoints on the same zigbee device.

I want to create two switch EP(if it is possible I would like to it as much switches as possible).

I am using WIndows 10 with Segger and nRF COnnect SDK v1.5.0.

I tried it in the following way(I tried other many ways but seems that defining the same macro is conflicting):

zb_zcl_basic_attrs_ext_t         basic_attr;

ZB_ZCL_DECLARE_BASIC_ATTRIB_LIST_EXT(
	basic_attr_list,
	&basic_attr.zcl_version,
	&basic_attr.app_version,
	&basic_attr.stack_version,
	&basic_attr.hw_version,
	basic_attr.mf_name,
	basic_attr.model_id,
	basic_attr.date_code,
	&basic_attr.power_source,
	basic_attr.location_id,
	&basic_attr.ph_env,
	basic_attr.sw_ver);

/* Declare attribute list for Identify cluster. */
ZB_ZCL_DECLARE_IDENTIFY_ATTRIB_LIST(identify_attr_list, &attr_identify_time);

/* Declare cluster list for Dimmer Switch device (Identify, Basic, Scenes,
 * Groups, On Off, Level Control).
 * Only clusters Identify and Basic have attributes.
 */
ZB_HA_DECLARE_DIMMER_SWITCH_CLUSTER_LIST(dimmer_switch_clusters,
					 basic_attr_list,
					 identify_attr_list);

/* Declare endpoint for Dimmer Switch device. */
ZB_HA_DECLARE_DIMMER_SWITCH_EP(dimmer_switch_ep,
			       LIGHT_SWITCH_ENDPOINT,
			       dimmer_switch_clusters);

ZB_HA_DECLARE_DIMMER_SWITCH_EP(dimmer_switch_ep_snd,
			       LIGHT_SWITCH_ENDPOINT_SND,
			       dimmer_switch_clusters);

/* Declare application's device context (list of registered endpoints)
 * for Dimmer Switch device.
 */
#ifndef CONFIG_ZIGBEE_FOTA
//ZBOSS_DECLARE_DEVICE_CTX_1_EP(dimmer_switch_ctx, dimmer_switch_ep);
ZBOSS_DECLARE_DEVICE_CTX_2_EP(dimmer_switch_ctx, dimmer_switch_ep, dimmer_switch_ep_snd);
#else

I get the following error:

Do I have to create different atributes/clusters to each end point?

What way would be the best to do it?

Also I would like the best approach to send and receive data(integers, arrays, etc) over zigbee. Specially receive.

  • Where does the compiler point to if you double click the line saying "originally defined here" or "previous declaration of 'zb_af_simple_desc_2_5_t was here"?

  • Hm, then where is the redefinition? (the one with the crosses?) Can I reproduce this? Is it possible for me to reproduce this? Can you zip the project folder so that I can unzip it in an unmodified SDK (please test that you get the same behavior in an unmodified SDK, and that all the files you need are included in the zip folder).

    BR,
    Edvin

  • 7652.light_switch.zip

    There you have. The sketch is a bit messy because I tried many things. From line 193 you will find the declarations of the endpoints.

    Thank you!

  • Hello,

    Ok, I see. So you want to create two endpoints with the light switch. I assume this is because you want to send light switch commands to two separate groups, is that correct?

    I see that the compiler error isn't related to the ZBOSS_DECLARE_DEVICE_CTX_2_EP, because it still occurs if I comment it out and use the 

    ZBOSS_DECLARE_DEVICE_CTX_1_EP instead. The issue is that you are using two calls to ZB_HA_DECLARE_DIMMER_SWITCH_EP(). Inside this, it uses:
    ZB_ZCL_DECLARE_DIMMER_SWITCH_SIMPLE_DESC() -> ZB_DECLARE_SIMPLE_DESC(), and the latter doesn't consider any names, only the in_clust_num and the out_clost_num. This means you can't use this two times with two instances of the same number of input and output clusters. 
    Can you please try to add the attached file to your project (Just copy it into the "include" folder together with nus_cmd.h and zb_mem_config_custom.h", and add it to main using '#include "zigbee_dimmable_light_switch.h" '.
    Then replace the calls to ZB_HA_DECLARE_DIMMER_SWITCH_EP() with ZB_ZCL_DECLARE_DIMMER_SWITCH_EP() in your main.c file. In my case, that made it compile, at least.
    If the intention is to control two different light bulb groups, you don't necessarily need two light switch endpoints. You can acheive the same sending the command to two different groups.
    Best regards,
    Edvin
Related