ZigBee Groups Handler Bug

Hello,

I am using nRF Connect SDK 1.7.0 and wrote a light-bulb-device. It has two identical dimmer-endpoints and I reconized there is a bug with the ZCL Groups cluster.

For example:

Adding a group to endpoint number 1 (ZB_ZCL_CMD_GROUPS_ADD_GROUP).

Now asking endpoint number 2 (the other one) for its list of groups

It should return an empty list as the group was added to the first one. (ZB_ZCL_CMD_GROUPS_GET_GROUP_MEMBERSHIP)

-> It actually returns the group of the other endpoint

From what I checked in the library it looks like internal there is only one list of groups for all endpoints together.

The GET_GROUP_MEMBERSHIP command will always return the complete list, without checking the group membership of each endpoint before returning the items.

The Cluster Library says:

4422 If the group count field of the command frame has a value of 0 indicating that the group list field is empty,
4423 the entity SHALL respond with all group identifiers of which the entity is a member.

The "get group membership " command is unicasted to the endpoint. So I would expect the endpoint to be "the entity". And when the endpoint answers its group list it should only list those who the endpoint is part of.

The Library actually sends all groups known to the device - which looks wrong to me (as if the device would be seen as "the entity").

Is there a workaround for this problem?

I know how to override the command handler to implement an own handler for the ZB_ZCL_CMD_GROUPS_GET_GROUP_MEMBERSHIP command, but how to access the list of groups from application-level? Commands like zb_apsme_get_group_membership_request don't seem to be accessible from application? I only find zb_aps_is_endpoint_in_group but checking for 0-0xFFFF is not really an option...

Thanks & best regards,

Alex

Parents
  • Hi Alex,

    Can you share how you are implementing this, especially how you add the endpoint to a group and how you send the get group membership command? Can you also get a sniffer log of when you send the get group membership command and upload it here as a pcap file?

    When I tested this myself, only the endpoint with a group membership sent a Get Group Membership Response command.

    Best regards,

    Marte

Reply
  • Hi Alex,

    Can you share how you are implementing this, especially how you add the endpoint to a group and how you send the get group membership command? Can you also get a sniffer log of when you send the get group membership command and upload it here as a pcap file?

    When I tested this myself, only the endpoint with a group membership sent a Get Group Membership Response command.

    Best regards,

    Marte

Children
  • Hi Marte,

    I have modified a devboard as send-tool for sending packets to my DUT-device.

    Please find Sniffer logs of what I am doing attached. Key for wireshark ist "7a2cc0bb6504e93b7a55ff79d45569f0".

    recommended filter in wireshark: ((!(wpan.frame_type == 0x2)) && !(zbee_aps.type == 0x2)) && !(zbee_nwk.cmd.id == 0x08)

    I think the sniffer log is explaining my problem best:

    Starting with two identical dimmer endpoints (ep10 and ep11):

    - First I verify both are in no group.

    - add group id 1 to ep10

    - add group id 2 to ep10

    - add group id 2 to ep11

    - get group membership of ep10 (sending with group count 0 - means return all groups of the entity)

    -> ep10 has both groups as expected

    - get group membership of ep11 (sending with group count 0 - means return all groups of the entity)

    -> ep11 also has both groups!?? -> BUG!

    - remove the additinal shown group 1 from ep11

    -> ep11 says error that group 1 is not found (on this endpoint)

    - verify group membership with get group membership of ep11 (sending with group count 0 - means return all groups of the entity)

    -> still says both groups are present on this endpoint

    Best regards,

    Alex

    Groups_7a2cc0bb6504e93b7a55ff79d45569f0.pcapng

  • Hi Alex,

    Thank you for providing the sniffer log, it was very helpful in seeing the behavior you described. I have been able to confirm this on my side, and I also saw that when groupcasting a command the endpoint that was not part of the group the command was sent to would respond with an ACK to the command.

    I will report this internally to our developers.

    Best regards,

    Marte

  • Hi Marte,

    Great when you can reproduce it now. Looking forward to a workaround for this.

    I can change zcl_groups.c to get this fixed but as far as I know this would be "changing the library" which is part of the "certified platform" which would make the certification process complicated?

    Where do I actually find out which files belong to the certified platform and which files may be changed?

    Best regards,

    Alex

  • Hi Alex,

    You are correct that making changes to zcl_groups.c would be to change the library. You can read about certification of the Zigbee ZBOSS stack and Zigbee libraries in nRF Connect SDK here: ZBOSS library certification. The ZBOSS stack from DSR is certified together with nRF Connect SDK and Nordic SoCs. This stack is precompiled so part of the stack is not possible to change by the user anyway, and the stack is included as the ZBOSS Zigbee stack library in nrfxlib, so all the files under ncs/nrfxlib/zboss.

    I have not heard from the developers yet, but I will let you know as soon as I hear anything.

    Best regards,

    Marte

  • Hi Marte,

    Okay, thank you!

    Maybe you know a way for reading a list of existing groups so I can overwrite these commands from my application level?

    The zb_apsme_get_group_membership_conf_t & zb_apsme_get_group_membership_request does not seem to be accessible.

    As far as I can tell there is only the zb_aps_is_endpoint_in_group function available to access groups. Finding the list of groups would mean checking (bruteforcing) group 0-ffff for membership which is not really an option.

    Best regards,

    Alex

Related