The sample can be used for several purposes, including:
Initial configuration of the network - forming a network as coordinator, adding devices to the network with the install codes, setting the extended PAN ID.
Benchmarking - measuring time needed for a message to travel from one node to another.
The sample supports the following development kits:
You can use one or more of the development kits listed above and mix different development kits.
For this sample to work, the following samples also need to be programmed:
The Zigbee network coordinator sample on one separate device or using a second Zigbee shell sample.
Additionally, you can use this sample with any other Zigbee sample application for testing the communication or other sample-specific functionalities.
The Zigbee shell sample takes the Zigbee Router role and implements two clusters: Basic and Identify. The Basic cluster provides attributes and commands for determining basic information about the node. The Identify cluster allows to put the device into the identification mode, which provides a way to locate the device. The device also includes all Zigbee shell commands that allow for discovering, controlling and testing other Zigbee devices.
The Zigbee shell sample does not use the default logging settings for the nRF Connect SDK samples. Unlike the default sample logging in the nRF Connect SDK, the Zigbee shell sample’s logger is configured to also log module name and timestamps for every message. The sample has log shell commands enabled for configuring logging, for example the logging level for each log module.
The Zigbee shell library also enables the Zigbee endpoint logger library by default. This library will log information about every ZCL packet received, which can be useful for debugging. You can enable or disable logging from the endpoint logger module by using the commands described in the Enabling and disabling endpoint logging.
You can run the Zigbee shell commands after connecting and configuring any of the supported backends for testing. These interfaces are completely independent one from another and can be used simultaneously or exclusively. For information about setup, see Testing an application.
- LED 3:
Turns on when the device joins the network.
- LED 4:
Blinks to indicate that the identification mode is on.
- Button 4:
Toggles the identification mode on the device.
All other interactions with the application can be handled using serial communication. See Zigbee shell command list for available serial commands.
See Configuring your application for information about how to permanently or temporarily change the configuration.
Zigbee shell sample has Zigbee endpoint logger library enabled by default and will log every ZCL packet received.
You can enable and disable logs from endpoint logger using the
log enable and
log disable shell commands with the appropriate log module instance name, respectively:
To disable the logs from Zigbee endpoint logger, use the following command:
log disable zigbee.eprxzcl
To enable logs from Zigbee endpoint logger and set its logging to the info level (
inf), use the following command:
log enable inf zigbee.eprxzcl
You can also use the following command to see other available logging levels:
log enable --help
Make sure to configure the Zigbee stack before building and testing this sample. See Configuring Zigbee in nRF Connect SDK for more information.
This sample can be found under
samples/zigbee/shell in the nRF Connect SDK folder structure.
See Building and programming an application for information about how to build and program the application.
In this testing procedure, both of the development kits are programmed with the Zigbee shell sample. One of these samples acts as Zigbee Coordinator, the second one as Zigbee Router.
After building the sample and programming it to your development kits, test it by performing the following steps:
Turn on the development kits.
Set up the serial connection with the development kits using one of the Available shell interfaces.
Set one shell device to work as coordinator by running the following shell command:
bdb role zc
This shell device is now the shell coordinator node.
Issue the following command on the shell coordinator node to start a new Zigbee network:
Run the following command on the second board programmed with the shell sample:
The shell device joins the network.
Check that the shell device has commissioned by running the following command:
The command returns the acquired short address of the shell device.
Check the communication between the nodes by issuing a ping request with the acquired short address value and the payload size:
zcl ping zdo_short_address payload_size
zcl ping 0x2485 10
The ping time response is returned when the ping is successful, followed by the additional information from the endpoint logger. For example:
Ping time: 20 ms Done [00:00:21.261,810] <inf> zigbee.eprxzcl: Received ZCL command (0): src_addr=0x2485(short) src_ep=64 dst_ep=64 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] (0)
Disable the endpoint logger:
log disable zigbee.eprxzcl
Issuing another ping request:
zcl ping 0x2485 10
The result does not include the endpoint logger information anymore. For example:
Ping time: 20 ms Done
This sample uses the following nRF Connect SDK libraries:
This sample uses the following sdk-nrfxlib libraries:
In addition, it uses the following Zephyr libraries: