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

Reverse finding and binding role, initiator and target.

Hello,

Originally, the Zigbee light_control examples ships with a bulb that can call the zb_bdb_finding_binding_target() functionand a light switch that calls zb_bdb_finding_binding_initiator() functionThis allows the light switch to add the bulb to its binding table. Here are the corresponding WireShark packets, which shows the Simple Descriptor Request being sent using the Zigbee ZDP protocol. The request is sent from the switch to the bulb.

I am now trying to implement the reverse. Have the light switch call zb_bdb_finding_binding_target(), then call zb_bdb_finding_binding_initiator() on the bulb, in order to have the bulb add the switch to its binding table. 

However, this does not work. I am using the CLI example in coordinator mode to query the bulb using the zdo mgmt_bind 0xXXXX command to see if there are any entries in the bulbs binding table, but it consistently shows the binding table to be empty.

There are no errors thrown inside the bulb or the switch, and the entire system (joining network, turning bulbs on and off, etc.) works just fine. One possible clue is when using WireShark, I can can see the bulb is never able to send the Simple Descriptor Request that is sent during a normal interaction. Instead, a default response is sent indicating an unsupported cluster. In addition to this, it is not being sent via the Zigbee ZDP protocol, but is instead using Zigbee HA.

I was wondering if you could help me with this dilemma, and hopefully point me in the correct direction.

Thank you,
Angry Oatmeal

  • Reply from our Zigbee team:

    The short answer:

    • I was able to reproduce the issue both on SDKv3.1 and SDKv4.1.
    • If you generate ZCL client commands, you should implement ZCL client cluster.
    • If you add the Identify client cluster to you device's cluster list, the Finding&Binding procedure works perfectly well.
      For example, copy/modify the ZB_HA_DECLARE_DIMMABLE_LIGHT_CLUSTER_LIST macro by adding the following item at the end of the list:

        ZB_ZCL_CLUSTER_DESC(          \
          ZB_ZCL_CLUSTER_ID_IDENTIFY, \
          0,                          \
          NULL,                       \
          ZB_ZCL_CLUSTER_CLIENT_ROLE, \
          ZB_ZCL_MANUF_CODE_INVALID   \
        ) 

    When it comes to topology questions:

    • Zigbee network may be considered as star topology networks (ZR - center/star, ZED/SED leafs/planets), connected with a full mesh (between both ZRs and ZR-ZC).
    • If you want to draw the topology, please take a look at the zdo mgmt_lqi CLI command - it prints out the neighbor table of a selected node.

    If you are targeting not the network topology, but sort of "application" topology, meaning which device controls which, you should draw:

    • Connections based on binding tables (the command to read it was already mentioned inside the ticket).
    • Grouping, by reading APS groups from each endpoint on each device (this covers switches that turn off/on the whole room/floor/building).
    • This still will not cover manufacturer-specific ways of making connections between devices (such as match descriptor request/response-based).

    When it comes to finding and binding:

    • The idea of it is to provide an easy way of binding client clusters to server clusters (for example On/Off client a.k.a. switch with On/Off server a.k.a. light bulb).
    • The procedure on an initiator device (usually the one that controls, e.g. light switch) is triggered manually.
    • The selection of the target devices (e.g. light bulb) is by putting it into identify mode (this is quite obvious in case of lightning - you look for a bulb to control by sending identify command and checking which one starts blinking. One you find the right one, you initiate the initiator to bind with it).
    • The bulb does not know if the switch was bound. It only knows that it was identifying and that someone queried for the identify state. The binding status may be queried only by reading out the binding table from the switch.

    The usage of Finding&Binding procedure is presented in Multiprotocol Light Switch with NUS example (F&B initiator, sending Identify commands).
    Reading binding tables, as well as neighbor tables is implemented in Zigbee CLI example.

  • Hi Edvin,

    Thank you so much for this response, it is extremely detailed and provides the answers I need.

    I will give these a try and and let you know how they go.

    Thank you,
    Angry Oatmeal

Related