cancel
Showing results for 
Search instead for 
Did you mean: 

Zigbee identify and groups cluster

CH3
Associate II

Hi evryone,

I've been trying to work on Zigbee communication for a while now, so far I've just learned how to read and write attributes. Now I'd like to try to learn how to use cluster Identify and groups, but I dont understand several thing, so I need help. For these cluster I'm working in Server.

Identify Cluster (only IdentifyTime attribute)

so i create my cluster, i allocate it as usual, i use the ZbZclIdentifyServerSetTime function and then i write in my attribute the value of the remaining time. what i don't understand is the part where in my code i'm going to receive the command that says "it's ok i can start the timer". i've seen that there's a start and stop structure that can be used via a callback, but i don't understand how to use it.

 

Groups Cluster 

I don't really understand how to use this one.
I suppose that my device will receive an order to say "I've been added to such and such a group", in which case, as above, how can I manage the reception of this order? How does this cluster server really work?

 

if someone could explain it to me, that would be great!
thanks
have a nice day

1 ACCEPTED SOLUTION

Accepted Solutions
Ouadi
ST Employee

Hello,

I'm not sure to understand exactly your question about ZbApsmeAddGroupReq which was used in my example to set a group addressing mode using APS layer, but this is not the purpose of the application provided to demonstrate mainly the use of the groups cluster according to your previous request. 
Identification mode is needed only when client use the command ZbZclGroupsClientAddIdentifyingReq, and this was not the case in my example. 

Please find a new example implementing Identify cluster as follow :

  • Initialization of the cluster done inside APP_ZIGBEE_ConfigEndpoints function
  • Set Callback using ZbZclIdentifyServerSetCallback
  /* Idenfity server */
  zigbee_app_info.identify_server = ZbZclIdentifyServerAlloc(zigbee_app_info.zb, SW1_ENDPOINT, NULL);
  assert(zigbee_app_info.identify_server != NULL);
  ZbZclClusterEndpointRegister(zigbee_app_info.identify_server);
  ZbZclIdentifyServerSetCallback(zigbee_app_info.identify_server, ZbZclIdentifyCallback);
  • Set time and enter to identify mode by pressing SW1 button
  • Get current time by pressing SW2 button using ZbZclIdentifyServerGetTime

Regards,

Ouadi

View solution in original post

12 REPLIES 12
Billy OWEN
ST Employee

Hi @CH3 

 

The forum moderator had marked your post as needing a little more investigation and direct support. An online support case has been created on your behalf, please stand by for just a moment and you will hear from us.

 

Regards,

Billy

Ouadi
ST Employee

Hello @CH3 ,

Thanks for your post and welcome to the community.

Please find below my answers:

  • Identify Cluster

Identify cluster is used during network commissioning process to allow the identification of each node in the network, this feature is mandatory for Find and Bind process giving the possibility for the device to enter in identify mode.

Identify mode can be done during an interval of time configured using ZbZclIdentifyServerSetTime function as you mentioned, the timer starts automatically once this function is called and the callback ZbZclIdentifyServerSetCallback is raised with ZCL_IDENTIFY_START param.

When the timer expires, the same callback is called to inform that the timer stopped => ZCL_IDENTIFY_STOP

To configure the callback function, you need to call ZbZclIdentifyServerSetCallback function after initialization of the cluster in (APP_ZIGBEE_ConfigEndpoints()).

To get the local identify server time => ZbZclIdentifyServerGetTime function returns the current time.

You can refer to the project example ..\Applications\Zigbee\Zigbee_Find_Bind_Coord that implements this cluster.

  • Groups Cluster

A groups cluster is a feature of APS stack layer providing a mechanism to manage a group of an end point by enabling the transmission of a command to multiple devices through group addressing.

To add an entry in a group table =>  ZbApsmeAddGroupReq 

To remove an entry in a group table => ZbApsmeRemoveGroupReq

To enable the group addressing mode => ZB_APSDE_ADDRMODE_GROUP

To better understand the use of this cluster, you can refer to the project example ..\Applications\Zigbee\Zigbee_OnOff_Client_Router which implements a toggle command sent over a groups cluster.

I hope this will be helpful for you.

Best regards,

Ouadi

 

CH3
Associate II

Hi Ouadi, 

thank you for your reply, it's a great help !

for Groups cluster, what will be the difference between your method (that of  ..\Applications\Zigbee\Zigbee_OnOff_Client_Router ) and the functions taken from the zcl.group.h file? for example, between ZbApsmeAddGroupReq and ZbZclGroupsClientAddReq?
thank you

APIs listed on my answer uses APS stack layer and could be used independently of ZCL library.

APIs located in file zcl.group.h uses ZCL library and allows to create a group cluster either as a Server or Client with the existing attributes and commands ( add, view, remove..)

BR,

Ouadi

CH3
Associate II

okay, in my case I need to work with the ZCL library as a server, ZbZclGroupsClientAddReq command will be more useful. How does this work? My application will tell my device to add itself to the group, this order will be "stored" in the attribute corresponding to the order and so when it is received I send my ZbZclGroupsClientAddReq command?

Actually, if your device is configured as a server using ZbZclGroupsServerAlloc it can only receive commands from the client to modify the local group table.

In case of your device is configured as a client (ZbZclGroupsClientAlloc), it is able to send commands to the server requesting add, view, get group membership or remove to the group table.

ZbZclGroupsClientAddReq function is to be used from the client side in order to be added ( endpoint) to the group.

ZbZclGroupsClientAddIdentifyingReq function is to be used from the client side in order to request the addition of the endpoint to the group, when the target device is in identification mode.

Best regards,

Ouadi

For more details using ZbZclGroupsClientAddReq command, you can call this function anytime after the establishment of the network between the server and the client.

On the server side, a group ID is created based on data sent by your device ( client), then it will generate an add group response command which will be received on the callback defined in your function argument (Client side).

BR,

Ouadi

CH3
Associate II

yes, we're in server mode, and it's the local table that we want to modify. the order we receive, do we get it via the attribute? for example, the addgroup attribute is set to 0 when no add order is received, then the attribute becomes non-null, so we've received our add order? i deduce that once we've received the order, all we need to do is create a group structure and fill it in. do you have any examples where you use the groups cluster in this way?
Thanks

Hello @CH3,

Indeed, for the groups cluster, the server has only 1 attributes called NameSupport  as mentioned in "zcl.groups.h"

As discussed previously, the server's role is to receive commands from the client and to manage the group table internally ( this is done by the stack), so no need to create or modify the group table manually.

I made an example to understand the use of this cluster with a focus on ZbZclGroupsClientAddReq function:

Ouadi_0-1706791099173.png

The client send a Group Add Request to the server by pressing SW1

On receipt of this command, the server add the group ID and the group name ( if supported) to its group table, then generate the appropriate Add group response indicating success of failure.

The response is generated on client side AddGroupCallback  

The response is displayed over the UART with the status, the source adresse, and the payload ( Group ID).

Please find in attachment files for both client/server.

BR,

Ouadi