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

Zigbee CLI example and light_bulb example

Hi, all! 

I'm using Nordic's sample program.

"Zigbee Light Control example"
https://infocenter.nordicsemi.com/topic/sdk_tz_v4.0.0/zigbee_example_light_control.html


has worked well.

"Testing" - "Zigbee CLI Agent example"
infocenter.nordicsemi.com/.../zigbee_example_cli_agent.html

It also worked well.

Next.
"Using CLI to control lighting devices"
infocenter.nordicsemi.com/.../zigbee_example_cli_agent.html

want to do.

I started nRF52840 where I wrote this. -> examples\zigbee\light_control\light_bulb

Next I wrote this in nF52840. -> examples\zigbee\experimental\cli\cli_agent_router

and typed the following


> bdb role zc
Coordinator set
Done.
> bdb start
Started coordinator
Done.
> bdb legacy enable
Done.
> zdo match_desc 0xfffd 0xfffd 0xxc05e 1 0 0
Sending broadcast request.
Done.


The nRF52840 for which light_bulb was written cannot be detected.

Any help?

  • Hello,

    The zdo match_desc is specified for IKEA and HUE light bulbs, which use a difference cluster than the light bulb example in the SDK.

    The description of zdo match_desc, which you can find here is:

    zdo match_desc <h:16-bit destination address>
                   <h:requested address/type> <h:profile ID>
                   <d:number of input clusters> [<h:input cluster IDs> ...]
                   <d:number of output clusters> [<h:output cluster IDs> ...]

    The first two parameters are the addresses that should respond to the message. If you insert 0xfffd, that means all non-sleepy devices. 0xffff means all devices. I usually use 0xffff.

    The next parameter is the profile ID. The IKEA and HUE bulbs use something called Light Link, which has ID 0xc05e, while the light bulb example in the SDK use the zigbee Home Automation (HA) ID, which is 0x0104.

    The rest of the parameters, let's call them a, b, c, and d.

    a is the number of input clusters, b is the list of these input clusters,

    c is the number of output clusters, and d is the list of these clusters.

    The light bulb example from the SDK has 6 input clusters, and no output clusters. The input clusters is listed in the light bulb example:

    ZB_HA_DECLARE_DIMMABLE_LIGHT_CLUSTER_LIST(dimmable_light_clusters,
                                              basic_attr_list,
                                              identify_attr_list,
                                              groups_attr_list,
                                              scenes_attr_list,
                                              on_off_attr_list,
                                              level_control_attr_list);

    (the last 6 lines).

    Let us use e.g. the attributes on_off and level_control. These have the ID 0x0006 and 0x0008, respectively.

    So if you use the command:

    zcl match_desc 0xffff 0xffff 0x0104 2 0x0006 0x0008 0

    You will ask all nodes: "What nodes use the HA profile and contain at least these two attributes: on_off and level_control?"

    Then you should see the short address of the light bulb.

    Best regards,

    Edvin

  • Hi Edvin! 

    Thank you for kindly reply.

    I try and I get as below:

    > zdo match_desc 0xffff 0xffff 0x0104 2 0x0006 0x0008 0
    Sending broadcast request.
    >
    src_addr=4D0A ep=10

    I get return value. Thank you!

    So, I request as:

    zdo simple_desc_req 0x4D0A 0
    >
    src_addr=0x4D0A ep=0 profile_id=0x0000 app_dev_id=0x0 app_dev_ver=0x0 in_clusters=out_clusters=
    Done

    Does the result of this mean that the input and output are none?

    Why?

  • Please refer the Zigbee CLI Reference. If you look at the description for zdo simple_desc_req, you can see that the last input is the endpoint.

    nanbuwks said:
    src_addr=4D0A ep=10

    From your zdo match_desc, you can see that the endpoint is 10:

    So try to use this as the last input parameter:

    zdo simple_desc_req 0x4D0A 10

    It should output something like:

    src_addr=0x4D0A ep=10 profile_id=0x0104 app_dev_id=0x101 app_dev_ver=0x1 in_clusters=0x0000,0x0003,0x0005,0x0004,0x0006,0x0008 out_clusters=

    BR,

    Edvin

  • Hi Edvin!

    I set the endpoint to 10 and got normal results.


    I put this together and wrote a post about it(Japanese).

    https://qiita.com/nanbuwks/items/308a421eaa61dd3f8fb4

    Thank you!

Related