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:~$ 

Parents
  • Hi, 

    1. Could you use Zigbee: Shell to run as coordinator to test?

    2. See this post.

    Regards,
    Amanda H.

  • hi,

    Thank you for your feedback.

    1. I configured Zigbee Shell example Proj.conf as follows.

    //CONFIG_ZIGBEE_ROLE_ROUTER = y

    CONFIG_ZIGBEE_ROLE_COORDINATOR = y

    Does i need to modify anything else in source code ?

    Because i tried to steering and device is not connecting with it.

    2. Can u tell by default which key it is using in Network Coordinator Sample?

    3. I like to ask regarding Attribute Type and Attribute ID .

    is it generating dynamically or pre-configured?

    when coordinator generate or receive or know attribute id and type of end device cluster.

    how can i know attribute id and type of end device ?

    Regards,

    Nikhil.

  • Hi, 

    1.

    NikhilVV said:
    Does i need to modify anything else in source code ?

    No. See the Testing

    NikhilVV said:
    2. Can u tell by default which key it is using in Network Coordinator Sample?

    What do you mean by the "key"? Could you elaborate in more detail?

    NikhilVV said:

    3. I like to ask regarding Attribute Type and Attribute ID .

    is it generating dynamically or pre-configured?

    when coordinator generate or receive or know attribute id and type of end device cluster.

    how can i know attribute id and type of end device ?

    Zigbee Attribute Types and Attribute IDs are pre-configured and not generated dynamically. They are defined in the Zigbee Cluster Library (ZCL) and are used to identify specific attributes within a cluster. For example, in the Zigbee dimmable light level control attribute reporting, the Attribute ID for the On/Off cluster is ZB_ZCL_ATTR_ON_OFF_ON_OFF_ID and for the Level Control cluster, it's ZB_ZCL_ATTR_LEVEL_CONTROL_CURRENT_LEVEL_ID. These are predefined in the ZCL and used to set or get the attribute values.

    Here is an example of setting the attribute values: 

    https://github.com/nrfconnect/sdk-nrf/blob/v2.6.0/samples/zigbee/light_bulb/src/main.c#L412-L426 

    In the above code, ZB_ZCL_SET_ATTRIBUTE is a macro used to set the attribute value. The parameters include the endpoint, cluster ID, role, attribute ID, attribute value, and a flag to indicate if the attribute is reportable.

    -Amanda H.

  • Hi Amanda,

    Thank you for quick response.

    a)

    In shell Sample code i did the same but End Device is not joining to the network.

    following the steps i did.

    1. In proj.config changed 

    //CONFIG_ZIGBEE_ROLE_ROUTER = y

    CONFIG_ZIGBEE_ROLE_COORDINATOR = y

    2. builded and flashed the code.

    3. changed role to ZC  .. bdb role zc

    4. bdb start ..

    Started coordinator
    Done

    (Extended PAN ID: f4ce365044756cb7, PAN ID: 0x1205)

    5. bdb legacy enable.

    6. waited for joining device.

    7. after steering finished tried again bdb start.

    8 bdb short 

    0000

    done.

    9. ping 0000 10

    Ping time: 3 ms
    Done
    [00:01:59.551,086] <inf> zigbee.eprxzcl: Received ZCL command (0): src_addr=0x0000(short) src_ep=10 dst_ep=10 cluster_id=0xbeef profile_id=0x0104 cmd_dir=0 common_cmd=0 cmd_id=0x02 cmd_seq=0 disable_def_resp=1 manuf_code=void payload=[abababababababababab] (0)
    [00:01:59.552,734] <inf> zigbee.eprxzcl: Received ZCL command (1): src_addr=0x0000(short) src_ep=10 dst_ep=10 cluster_id=0xbeef profile_id=0x0104 cmd_dir=0 common_cmd=0 cmd_id=0x01 cmd_seq=0 disable_def_resp=1 manuf_code=void payload=[cdcdcdcdcdcdcdcdcdcd] (1)

    b) In Network coordinator we Enabled Shell and tried same and end device is connecting to coordinator and binded cluster 0x0000. but when we tried

    zcl attr read 9153 1 0x0000 0x0104 0

    Error: Request timed out

    c) Also tried with Network Coordinator (Shell Enabled)  with another( Custom Made , NOT NRF) device which is configured as router.

    That moment also Router joined and Binded with coordinator.

    we tried zcl attr read and still getting time out. (In shell) 

    We monitored the traffic between coordinator and router we noticed that when NRF request for reading attribute , Router sends read response and NRF not showing the response data.

    is coordinator sample enabled read response printing ? if not how to get and print the data.

    Please refer attached screen shot.

     d) Regarding KEY.

    The KEY i mentioned in previous post is Network Key.

    In coordinator sample code which network is used ?

    E) Can i add cluster in coodinator / shell sample or should i use template sample?

    kindly provide the guidance to add cluster in coordinator side.

    zigbee SDK 2.5.2

    Toolchain 2.5.2

    VSCode

    thanks,

    Nikhil

  • hi Amanda,

     A) Currently am able to read basic attribute from zigbee device using shell sample.

    Thank you for your guidance.

    Later i will reuse the payload read from Zigbee device to pass to uart buffer.

    B) Regarding KEY.

    The KEY i mentioned in previous post is Network Key.

    In Shell sample code which network is used ?

    C) Can i add custom cluster shell sample or should i use template sample?

    kindly provide the guidance to add cluster in coordinator side.

    Am referring following Link to declare cluster. 

    https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.thread_zigbee.v3.0.0%2Fusing_zigbee__z_c_l.html&anchor=att_declaration

    thanks,

    Nikhil

Reply Children
  • 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.

  • HI,

    I have tried following points in Shell Sample code which as working as Coordinator.

    1) coordinator Send : ZCL attr read 0xA009 2 0x0000 0x0104 0 

    Responds Received from Node and printed on terminal.

    2) Similarly

    coordinator Send : ZCL cmd 0x5df 2 0x0000 0x0104 0

    uart:~$ zcl cmd 65df 2 0x0000 0x0104 0
    Default Response received: Command: 4, Status: 129
    Error: Command not successful
    Done
    [00:15:45.006,256] <inf> zigbee_shell: RECEIVED CMD zbshellutil.c

    [00:15:45.006,652] <inf> zigbee.eprxzcl: Received ZCL command (4): src_addr=0x65df(short) src_ep=2 dst_ep=64 cluster_id=0x0000 profile_id=0x0104 cmd_dir=1 common_cmd=1 cmd_id=0x0b cmd_seq=10 disable_def_resp=0 manuf_code=void payload=[0481] (4)

    3) End Device sending ZCL CMD in every seconds but not receiving at zigbee_logger_eprxzcl_ep_handler().

    Attached herewith the traffic captured for reference.

    Kindly find the attachment and let me know why it is not receiving the ZCL generic command.

    the only difference i found is manufacturing specific bit  in ZCL Frame Control. 

    how to overcome this issue. 

    I also tried the following callback 

    1)  ZB_ZCL_REGISTER_CALLBACK();

    2)  ZB_ZCL_SET_DISC_MANUFACTURE_COMMAND_CALLBACK();

    3) ZB_AF_SET_ENDPOINT_HANDLER();

    The incoming message is not hitting any of the above callback which i tried one by one.

    i have observed that if i try ZCL on-off command from end device it is hitting at ZB_ZCL_Handler().

    if i add a callback does the stack callback will disabled or not?

    _nikhil

Related