nRF5 SDK for Thread and Zigbee v3.0.0
Zigbee CLI Agent example

Table of Contents

The Zigbee Command Line Interface Agent example demonstrates a Zigbee router (with the possibility of being a coordinator) that interacts with the user by employing the Command Line Interface. This CLI Agent is a tool can be used for several purposes, including:

The CLI can be accessed by using the following interfaces:

These interfaces are completely independent one from another and can be used simultaneously or exclusively.

Both interfaces use the following speed and parity settings:

The CLI uses its own dedicated library. See the Zigbee CLI library for more details.

The Command Line Interface consists of several commands. See the Zigbee CLI Reference page for details.

Driver installation on host

The CLI example requires for the host PC to be able to connect to it. Some PC USB drivers might be needed. The driver installation depends on the host operating system.

Operating System Installation procedure
Windows XP or 7 If the native USB CDC connectivity is used, manually install the nordic_cdc_acm.inf driver.
The file that is located at <InstallFolder>\examples\usb_drivers
Windows 8 and later Hosts pick the correct usbser.sys driver file automatically.
Most of modern Linux and MacOS Hosts handle the driver installation automatically.
Driver installation per Operating System

The CLI application starts in the disconnected state and remains in this state until the appropriate commands are issued by the user. These commands can be issued by using a serial line connection with a terminal application like PuTTy.


You can find the source code and the makefiles in the following folder: <InstallFolder>\examples\zigbee\experimental\cli\cli_agent_router

To set up the example:

  1. Flash the board with the compiled binaries.
  2. Connect to the CLI with one of the following:
    • J-Link UART Virtual Port (not available when using the nRF52840 Dongle (PCA10059))
    • USB CDC Port (the other USB port on the DK)
  3. By default, the CLI Agent implements the Zigbee Router functionality. If you have a coordinator nearby that is listening on the channel 16, run the following command:
    bdb channel 16
  4. Run the following command:
    bdb start
    The CLI Agent joins the network.
  5. Check the network short address:
    zdo short
    The command returns the acquired short address of the CLI node.


  • To test the CLI Agent example, prepare two boards and a Zigbee Coordinator or a third board.
  • Make sure you disabled the Mass Storage Device and forced Hardware Flow Control in SEGGER J-Link. See Configuring SEGGER J-Link software for details.

To test the example:

  1. Build the CLI example and flash it into the two boards.
  2. Do one of the following:
    • If you have a standalone Zigbee Coordinator, make sure it is able to accept new nodes.
    • If you do not have a standalone Zigbee Coordinator, use a Zigbee Coordinator from the Zigbee Light Control example and flash it on a third board (see also the note following this procedure).
  3. Connect to the CLI on both boards that have the CLI example flashed on by using the connection appropriate for you.
  4. On both CLIs, issue:
    bdb start
  5. Check that the devices have commissioned by issuing the following command:
    zdo short
    The command must return the received short address of the board.
  6. Check the EUI64 addresses of both boards by issuing:
    zdo eui64
  7. On one board, issue:
    zcl ping <eui64 address of the other board> 30

The board pings the other board with 30 bytes of payload data and prints the time passed between sending a request and receiving a reply.

If you do not have access to the coordinator (standalone or on a third board), you can have one of the CLIs to act as a coordinator. To do so:
  1. Set CLI device to work as a coordinator:
    bdb role zc
  2. Issue the following command on the CLI coordinator node to start a new Zigbee network:
    bdb start
  3. Now you can proceed with testing the Zigbee ping functionality.

For a full list of CLI commands, see Zigbee CLI Reference.

Documentation feedback | Developer Zone | Subscribe | Updated