Zigbee Communication with Network Coordinator with Light Switch

Hi,

Am Implementing Zigbee on NRF52840 chip with help of VS Code.

Zigbee Stack : 2.5.2

I configured nrf52840 DK as Zigbee network coordinator and another custom made board which having nrf52840 configured as Zigbee light switch.

I Established connection and created Binding between both. But am not able to communicate with Light Switch from Coordinator through ZCL Commands.

Please find the attached document which i tried in shell command.

1) How to establish communication between network coordinator with end device or router using Zigbee.

please guide me to solve the issue.

2) What is the Traffic Key Zigbee coordinator Example using ? where can we change (API To change traffice Key) it?

I: nRF5 802154 radio initialized
*** Booting nRF Connect SDK v2.5.2 ***
I: Starting ZBOSS Coordinator example
I: ZBOSS Coordinator example started


uart:~$ E: Zigbee shell endpoint: 1 is not registered.
I: Production configuration is not present or invalid (status: -1)
I: Zigbee stack initialized
I: Device started for the first time
I: Start network formation
I: Unimplemented signal (signal: 54, status: 0)
I: Network formed successfully, start network steering (Extended PAN ID: f4ce365044756cb7, PAN ID: 0xb435)
I: Unimplemented signal (signal: 54, status: 0)
I: Allow pre-Zigbee 3.0 devices to join the network
I: Network steering started

  bdb                clear              device             devmem
  flash              help               history            kernel
  nbr                nrf_clock_control  resize             retval
  sensor             shell              version            zcl
  zdo
uart:~$ bdb role set zc
role: wrong parameter count
role - Set/get role.
Subcommands:
  zc   :Set Coordinator role.
  zed  :Set End Device role.
  zr   :Set Router role.
uart:~$ bdb role
zc
Done
uart:~$ bdb start
Done
uart:~$ I: Unimplemented signal (signal: 54, status: 0)
I: Allow pre-Zigbee 3.0 devices to join the network
I: Network steering started
I: Network steering finished
I: Unimplemented signal (signal: 54, status: 0)
I: Network steering finished
I: nRF5 802154 radio initialized
*** Booting nRF Connect SDK v2.5.2 ***
I: Starting ZBOSS Coordinator example
I: ZBOSS Coordinator example started


uart:~$ E: Zigbee shell endpoint: 1 is not registered.
I: Production configuration is not present or invalid (status: -1)
I: Zigbee stack initialized
I: Device started for the first time
I: Start network formation
I: Unimplemented signal (signal: 54, status: 0)
I: Network formed successfully, start network steering (Extended PAN ID: f4ce365044756cb7, PAN ID: 0x7a66)
I: Unimplemented signal (signal: 54, status: 0)
I: Allow pre-Zigbee 3.0 devices to join the network
I: Network steering started
bdb start
Done
uart:~$ I: Unimplemented signal (signal: 54, status: 0)
I: Allow pre-Zigbee 3.0 devices to join the network
I: Network steering started
bdb roI: Device update received (short: 0x9153, long: f4ce369e3f3451ab, status: 1)
lI: New device commissioned or rejoined (short: 0x9153)
I: Joining period extended.
eI: Device authorization event received (short: 0x9153, long: f4ce369e3f3451ab, authorization type: 1, authorization status: 0)
I: Unimplemented signal (signal: 54, status: 0)

  bdb                clear              device             devmem
  flash              help               history            kernel
  nbr                nrf_clock_control  resize             retval
  sensor             shell              version            zcl
  zdo
uart:~$ zdo match_desc 0xfffd 0xfffd 0x0104 1 0 0
Sending broadcast request.

src_addr=9153 ep=1
uart:~$ zdo ieee_addr 9153
f4ce369e3f3451ab
Done
uart:~$ zdo eui64
f4ce365044756cb7
Done
uart:~$ zdo mgmt_bind 9153
[idx] src_address      src_endp cluster_id dst_addr_mode dst_addr         dst_endp
Total entries for the binding table: 0
Done
Done
uart:~$ zdo bind on f4ce369e3f3451ab 1 f4ce365044756cb7 10 2 0 3 0
on: wrong parameter count
on - Create bind entry.
     Usage: on <h:source_eui64> <d:source_ep> <h:destination_addr>
     <d:destination_ep> <h:source_cluster_id> <h:request_dst_addr>
uart:~$ zdo bind on f4ce369e3f3451ab 1 f4ce365044756cb7 10 2 0 3I: Network steering finished
zdo bind on f4ce369e3f3451ab 1 f4ce365044756cb7 10 I: Network steering finished
I: Unimplemented signal (signal: 54, status: 0)
zdo bind on f4ce369e3f3451ab 1 f4ce365044756cb7 10 0x0000 9153
Done
uart:~$ zdo mgmt_bind 9153
[idx] src_address      src_endp cluster_id dst_addr_mode dst_addr         dst_endp
[  0] f4ce369e3f3451ab        1       0000           003 f4ce365044756cb7      010
Total entries for the binding table: 1
Done
uart:~$ zcl attr read 9153 1 0x0000 0x0104 0
Error: Request timed out
uart:~$ zdo match_desc 0xfffd 0xfffd 0x0104 1 0 0
Sending broadcast request.

src_addr=9153 ep=1
Done
uart:~$ zcl attr read 9153 1 0x0000 0x0104 0x00 0x21 0x0F
read: wrong parameter count
read - Send Read Attribute Zigbee command.
       Usage: read <h:dst_addr> <d:ep> <h:cluster> [-c] <h:profile> <h:attr_id>
       -c switches the server-to-client direction.
       h: is for hex, d: is for decimal.
uart:~$ zcl attr write 9153 1 0x0000 0x0104 0x00 0x21 0x0F
Error: Request timed out
uart:~$ I: Enter identify mode
zdo nwk_addr f4ce365044756cb7
Error: Network address request timed out
uart:~$ zdo match_desc 0xfffd 0xfffd 0x0104 1 0 0
Sending broadcast request.

src_addr=9153 ep=1
Done
uart:~$ zdo match_desc 0xfffd 0xfffd 0x0104 1 0 0I: Find and bind target finished (status: 0)
zdo simple_desc_req 9153 1
Sending broadcast request.

src_addr=9153 ep=1
uart:~$ zdo simple_desc_req 0x9153 1
src_addr=0x9153 ep=1 profile_id=0x0104 app_dev_id=0x104 app_dev_ver=0x0 in_clusters=0x0000,0x0003 out_clusters=0x0003,0x0005,0x0004,0x0006,0x0008 
Done
Done
uart:~$ zdo cmd f4ce369e3f3451ab 1 0x0008 -p 0x0104 0x00 -l 0affff
zdo - ZDO manipulation.
Subcommands:
  active_ep        :Send active endpoint request.
                    Usage: active_ep <h:16-bit destination_address>
  simple_desc_req  :Send simple descriptor request.
                    Usage: simple_desc_req <h:16-bit destination_address>
                    <d:endpoint>
  match_desc       :Send match descriptor request.
                    Usage: 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> ...] [-t | --timeout
                    d:number of seconds to wait for answers]
  nwk_addr         :Resolve EUI64 address to short network address.
                    Usage: nwk_addr <h:EUI64>
  ieee_addr        :Resolve network short address to EUI64 address.
                    Usage: ieee_addr <h:short_addr>
  eui64            :Get/set the eui64 address of the node.
                    Usage: eui64 [<h:eui64>]
  short            :Get the short address of the node.
  bind             :Create/remove the binding entry in the remote node.
  mgmt_bind        :Get binding table (see spec. 2.4.3.3.4)
                    Usage: <h:short> [d:start_index]
  mgmt_leave       :Perform mgmt_leave_req (see spec. 2.4.3.3.5)
                    Usage: mgmt_leave <h:16-bit dst_addr> [h:device_address
                    eui64] [--children] [--rejoin]
                    --children - Device should also remove its children when
                    leaving.
                    --rejoin - Device should rejoin network after leave.
  mgmt_lqi         :Perform mgmt_lqi request.
                    Usage: mgmt_lqi <h:short> [d:start index]
uart:~$ zdo
zdo - ZDO manipulation.
Subcommands:
  active_ep        :Send active endpoint request.
                    Usage: active_ep <h:16-bit destination_address>
  simple_desc_req  :Send simple descriptor request.
                    Usage: simple_desc_req <h:16-bit destination_address>
                    <d:endpoint>
  match_desc       :Send match descriptor request.
                    Usage: 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> ...] [-t | --timeout
                    d:number of seconds to wait for answers]
  nwk_addr         :Resolve EUI64 address to short network address.
                    Usage: nwk_addr <h:EUI64>
  ieee_addr        :Resolve network short address to EUI64 address.
                    Usage: ieee_addr <h:short_addr>
  eui64            :Get/set the eui64 address of the node.
                    Usage: eui64 [<h:eui64>]
  short            :Get the short address of the node.
  bind             :Create/remove the binding entry in the remote node.
  mgmt_bind        :Get binding table (see spec. 2.4.3.3.4)
                    Usage: <h:short> [d:start_index]
  mgmt_leave       :Perform mgmt_leave_req (see spec. 2.4.3.3.5)
                    Usage: mgmt_leave <h:16-bit dst_addr> [h:device_address
                    eui64] [--children] [--rejoin]
                    --children - Device should also remove its children when
                    leaving.
                    --rejoin - Device should rejoin network after leave.
  mgmt_lqi         :Perform mgmt_lqi request.
                    Usage: mgmt_lqi <h:short> [d:start index]
uart:~$ zdo active_ep 0x9153
src_addr=9153 ep=1 
Done
uart:~$ zcl cmd f4ce369e3f3451ab 1 0x0008 -p 0x0104 0x00 -l 0affff
Error: Request timed out
uart:~$ zdo ping f4ce369e3f3451ab 30
zdo - ZDO manipulation.
Subcommands:
  active_ep        :Send active endpoint request.
                    Usage: active_ep <h:16-bit destination_address>
  simple_desc_req  :Send simple descriptor request.
                    Usage: simple_desc_req <h:16-bit destination_address>
                    <d:endpoint>
  match_desc       :Send match descriptor request.
                    Usage: 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> ...] [-t | --timeout
                    d:number of seconds to wait for answers]
  nwk_addr         :Resolve EUI64 address to short network address.
                    Usage: nwk_addr <h:EUI64>
  ieee_addr        :Resolve network short address to EUI64 address.
                    Usage: ieee_addr <h:short_addr>
  eui64            :Get/set the eui64 address of the node.
                    Usage: eui64 [<h:eui64>]
  short            :Get the short address of the node.
  bind             :Create/remove the binding entry in the remote node.
  mgmt_bind        :Get binding table (see spec. 2.4.3.3.4)
                    Usage: <h:short> [d:start_index]
  mgmt_leave       :Perform mgmt_leave_req (see spec. 2.4.3.3.5)
                    Usage: mgmt_leave <h:16-bit dst_addr> [h:device_address
                    eui64] [--children] [--rejoin]
                    --children - Device should also remove its children when
                    leaving.
                    --rejoin - Device should rejoin network after leave.
  mgmt_lqi         :Perform mgmt_lqi request.
                    Usage: mgmt_lqi <h:short> [d:start index]
uart:~$ zcl ping f4ce369e3f3451ab 30
Error: Request timed out after 9900 ms.
uart:~$ zdo mgmt_bind 9153
[idx] src_address      src_endp cluster_id dst_addr_mode dst_addr         dst_endp
[  0] f4ce369e3f3451ab        1       0000           003 f4ce365044756cb7      010
Total entries for the binding table: 1
Done
uart:~$ zdo cmd f4ce369e3f3451ab 1 0x0008 -p 0x0104 0x00 -l 0affff
zdo - ZDO manipulation.
Subcommands:
  active_ep        :Send active endpoint request.
                    Usage: active_ep <h:16-bit destination_address>
  simple_desc_req  :Send simple descriptor request.
                    Usage: simple_desc_req <h:16-bit destination_address>
                    <d:endpoint>
  match_desc       :Send match descriptor request.
                    Usage: 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> ...] [-t | --timeout
                    d:number of seconds to wait for answers]
  nwk_addr         :Resolve EUI64 address to short network address.
                    Usage: nwk_addr <h:EUI64>
  ieee_addr        :Resolve network short address to EUI64 address.
                    Usage: ieee_addr <h:short_addr>
  eui64            :Get/set the eui64 address of the node.
                    Usage: eui64 [<h:eui64>]
  short            :Get the short address of the node.
  bind             :Create/remove the binding entry in the remote node.
  mgmt_bind        :Get binding table (see spec. 2.4.3.3.4)
                    Usage: <h:short> [d:start_index]
  mgmt_leave       :Perform mgmt_leave_req (see spec. 2.4.3.3.5)
                    Usage: mgmt_leave <h:16-bit dst_addr> [h:device_address
                    eui64] [--children] [--rejoin]
                    --children - Device should also remove its children when
                    leaving.
                    --rejoin - Device should rejoin network after leave.
  mgmt_lqi         :Perform mgmt_lqi request.
                    Usage: mgmt_lqi <h:short> [d:start index]
uart:~$ zcl cmd f4ce369e3f3451ab 1 0x0008 -p 0x0104 0x00 -l 0affff
Error: Request timed out
uart:~$ zdo simple_desc_req 0x9153 10
Error: Simple descriptor request failed
uart:~$ zdo simple_desc_req 0x9153 1
src_addr=0x9153 ep=1 profile_id=0x0104 app_dev_id=0x104 app_dev_ver=0x0 in_clusters=0x0000,0x0003 out_clusters=0x0003,0x0005,0x0004,0x0006,0x0008 
Done
uart:~$ zdo bind on f4ce369e3f3451ab 1 f4ce365044756cb7 10 3 
on: wrong parameter count
on - Create bind entry.
     Usage: on <h:source_eui64> <d:source_ep> <h:destination_addr>
     <d:destination_ep> <h:source_cluster_id> <h:request_dst_addr>
uart:~$ zdo bind on f4ce369e3f3451ab 1 f4ce365044756cb7 10 3 0
Error: Incorrect destination network address for the request
uart:~$ zdo bind on f4ce369e3f3451ab 1 f4ce365044756cb7 10 2 3 0
on: wrong parameter count
on - Create bind entry.
     Usage: on <h:source_eui64> <d:source_ep> <h:destination_addr>
     <d:destination_ep> <h:source_cluster_id> <h:request_dst_addr>
uart:~$ zdo bind on f4ce369e3f3451ab 1 f4ce365044756cb7 10 2 0 3 0
on: wrong parameter count
on - Create bind entry.
     Usage: on <h:source_eui64> <d:source_ep> <h:destination_addr>
     <d:destination_ep> <h:source_cluster_id> <h:request_dst_addr>
uart:~$ zdo bind on f4ce369e3f3451ab 1 f4ce365044756cb7 10 2 0 3 0
on: wrong parameter count
on - Create bind entry.
     Usage: on <h:source_eui64> <d:source_ep> <h:destination_addr>
     <d:destination_ep> <h:source_cluster_id> <h:request_dst_addr>
uart:~$ zdo bind on f4ce369e3f3451ab 1 f4ce365044756cb7 10 3 0 0
on: wrong parameter count
on - Create bind entry.
     Usage: on <h:source_eui64> <d:source_ep> <h:destination_addr>
     <d:destination_ep> <h:source_cluster_id> <h:request_dst_addr>
uart:~$ zdo bind on f4ce369e3f3451ab 1 f4ce365044756cb7 10 3 0 
Error: Incorrect destination network address for the request
uart:~$ zdo bind on f4ce369e3f3451ab 1 f4ce365044756cb7 10 3
on: wrong parameter count
on - Create bind entry.
     Usage: on <h:source_eui64> <d:source_ep> <h:destination_addr>
     <d:destination_ep> <h:source_cluster_id> <h:request_dst_addr>
uart:~$ zdo bind on f4ce369e3f3451ab 1 f4ce365044756cb7 10 0x0003 9153
Done
uart:~$ zdo mgmt_bind 9153
[idx] src_address      src_endp cluster_id dst_addr_mode dst_addr         dst_endp
[  0] f4ce369e3f3451ab        1       0000           003 f4ce365044756cb7      010
[  1] f4ce369e3f3451ab        1     0x0003           003 f4ce365044756cb7      010
Total entries for the binding table: 2
Done
uart:~$ zcl attr read 9153 1 0x0003 0x0104 0
Error: Request timed out
uart:~$ zcl attr write 9153 1 0x0003 0x0104 0x00 0x21 0x0F
Error: Request timed out
uart:~$ 
uart:~$ 
uart:~$ 

  • hi,

    Thanks for the response.

    I will check the same and let you the result.

    -nikhil

  • hi Amanda,

    the link which you shared describes how to add a preconfigured cluster.

    Where am looking for how to add a custom cluster in coordinator. In my application coordinator continuously receive data from node. The endnode is using some custom profile. 

    kindly guide me to how to add custom cluster in coordinator.

    _nikhil

  • HI,

    1) 

     https://docs.nordicsemi.com/bundle/ncs-latest/page/nrf/protocols/zigbee/adding_clusters.html 

    By referring above the link i added temperature Sensor in zigbee template example. when building it is failed due to errors.

    warning: data definition has no type or storage class
       86 | ZB_HA_DECLARE_TEMPERATURE_SENSOR_CLUSTER_LIST(
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ../src/main.c:86:1: error: type defaults to 'int' in declaration of 'ZB_HA_DECLARE_TEMPERATURE_SENSOR_CLUSTER_LIST' [-Werror=implicit-int]
    ../src/main.c:90:9: warning: parameter names (without types) in function declaration
       90 |         temp_measurement_attr_list);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
    ../src/main.c:99:31: error: expected ')' before numeric constant
       99 |         temperature_sensor_ep,
          |                               ^
          |                               )
    ../src/main.c:110:1: warning: data definition has no type or storage class
      110 | ZB_DECLARE_DEVICE_CTX_2_EP(
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~
    ../src/main.c:110:1: error: type defaults to 'int' in declaration of 'ZB_DECLARE_DEVICE_CTX_2_EP' [-Werror=implicit-int]
    ../src/main.c:113:9: warning: parameter names (without types) in function declaration
      113 |         temperature_sensor_ep);
          |         ^~~~~~~~~~~~~~~~~~~~~
    In file included from C:/ncs/v2.5.2/nrfxlib/zboss/production/include/zboss_api.h:52,
                     from ../src/main.c:16:
    ../src/main.c: In function 'main':
    ../src/main.c:270:36: error: 'app_template_ctx' undeclared (first use in this function)
      270 |         ZB_AF_REGISTER_DEVICE_CTX(&app_template_ctx);
          |                                    ^~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/nrfxlib/zboss/production/include/zboss_api_af.h:657:74: note: in definition of macro 'ZB_AF_REGISTER_DEVICE_CTX'
      657 | #define ZB_AF_REGISTER_DEVICE_CTX(_device_ctx) zb_af_register_device_ctx(_device_ctx)
          |                                                                          ^~~~~~~~~~~
    ../src/main.c:270:36: note: each undeclared identifier is reported only once for each function it appears in
      270 |         ZB_AF_REGISTER_DEVICE_CTX(&app_template_ctx);
          |                                    ^~~~~~~~~~~~~~~~
    C:/ncs/v2.5.2/nrfxlib/zboss/production/include/zboss_api_af.h:657:74: note: in definition of macro 'ZB_AF_REGISTER_DEVICE_CTX'
      657 | #define ZB_AF_REGISTER_DEVICE_CTX(_device_ctx) zb_af_register_device_ctx(_device_ctx)
          |                                                                          ^~~~~~~~~~~
    cc1.exe: some warnings being treated as errors
    [109/316] Building C object zephyr/CMakeFiles/zephyr.dir/lib/os/heap.c.obj
    ninja: build stopped: subcommand failed.

    2) 

    In my project Zigbee Node which sends data is sending data in customised manufacture cluster. 

    Is it possible the zigbee Shell example receive ZCL CMD  not ZCL ATTR READ command from node without adding any other Cluster. 

    is it mandatory to add the cluster in coordinator side too to receive zcl cmd & zcl attr read commands.

    3) 

    When the i try to read the added cluster (Basic) info from node am able get the responds.

    can i use the same zigbee_logger_eprxzcl_ep_handler() to receive ZCL CMD from router Node.

    if the zigbee_logger_eprxzcl_ep_handler() doent work to receive ZCL CMD how to add a handler or call back to receive ZCL CMD.

    -Nikhil

  • 1. 

    See this post

    2.

    NikhilVV said:
    Is it possible the zigbee Shell example receive ZCL CMD  not ZCL ATTR READ command from node without adding any other Cluster. 



    Yes, it is possible for the Zigbee Shell example to receive ZCL (Zigbee Cluster Library) commands without adding any other cluster. The Zigbee Shell library implements a set of Zigbee shell commands that can be used for testing and debugging. These commands include 
    zcl cmd for sending a generic ZCL command to a remote node and zcl attr read for retrieving the attribute value of a remote node. 

    NikhilVV said:
    is it mandatory to add the cluster in coordinator side too to receive zcl cmd & zcl attr read commands.

    No, it is not mandatory to add the cluster on the coordinator side to receive ZCL commands and ZCL attribute read commands. The Zigbee Shell in the coordinator can issue commands to any device in the network, regardless of the clusters implemented on the coordinator side.

    3. 

    NikhilVV said:

    When the i try to read the added cluster (Basic) info from node am able get the responds.

    can i use the same zigbee_logger_eprxzcl_ep_handler() to receive ZCL CMD from router Node.

    Yes, you can use the zigbee_logger_eprxzcl_ep_handler() function to receive ZCL commands from a router node. This function is part of the Zigbee endpoint logger library and is used for parsing incoming ZCL frames and logging their fields and command payload.

    For more information, you can refer to the Zigbee endpoint logger documentation and the Configuring Zigbee endpoint logger documentation.

Related