The Zigbee CLI supports the following commands:
Every command prints Done
when it is finished, or Error: <reason>
in case of errors.
command [arg]
: square brackets mean that an argument is optional.command <d:arg1> <h:arg2>
: a single letter before an argument name defines the format of the argument:h:
hexadecimal strings (arg2),d:
decimal values (arg1).command <arg> ...
: the ellipsis after an argument means that the preceding argument can be repeated several times.bdb role - Set or get the Zigbee role of a device.
If the optional argument is not provided, get the state of the device.
Returns:
zc
if it is a coordinator,zr
it it is a router,zed
if it is an end device.If the optional argument is provided, set the device role to role
. Can be either zc
or zr
.
bdb extpanid - Set or get the Zigbee Extended Pan ID value.
If the optional argument is not provided, gets the extended PAN ID of the joined network.
If the optional argument is provided, gets the extended PAN ID to id
.
bdb panid - Set or get the Zigbee PAN ID value.
If the optional argument is not provided, gets the PAN ID of the joined network. If the optional argument is provided, sets the PAN ID to id
.
bdb start - Start the commissioning process.
bdb channel - Set or get the 802.15.4 channel.
If the optional argument is not provided, get the current number and bitmask of the channel.
If the optional argument is provided:
n
is in [11:26] range, set to that channel.n
as bitmask (logical or of a single bit shifted by channel number).Example:
bdb ic - Set install code on the device, add information about the install code on the trust center, set the trust center install code policy.
bdb ic set
must only be used on a joining device.
bdb ic add
must only be used on a coordinator.
bdb ic policy
must only be used on a coordinator.
Provide the install code as an ASCII-encoded hex that includes CRC16.
For production devices, an install code must be installed by the production configuration present in flash.
Example:
bdb legacy - Enable or disable the legacy device support.
Allow or disallow legacy pre-r21 devices on the Zigbee network.
Example:
Set a pre-defined network key instead of a random one.
Example:
zdo simple_desc_req - Send Simple Descriptor Request.
Send Simple Descriptor Request to the given node and endpoint.
Example:
zdo active_ep - Send Active Endpoint Request.
Send Active Endpoint Request to the node addressed by the short address.
Example:
zdo match_desc - Send match descriptor request.
Send Match Descriptor Request to the dst_addr
node that is a query about the req_addr
node of the prof_id
profile ID, which must have at least one of n_input_clusters
(whose IDs are listed in {...}
) or n_output_clusters
(whose IDs are listed in {...}
). The IDs can be either decimal values or hexadecimal strings.
Example:
In this example, the command sends a Match Descriptor Request to all non-sleeping nodes regarding all non-sleeping nodes that have 1 input cluster ON/OFF (ID 6) and 0 output clusters.
zdo bind on - Create a binding between two endpoints on two nodes.
Create bound connection between a device identified by source eui64
and endpoint source ep
, and a device identified by destination eui64
and endpoint destination ep
. The connection is created for ZCL commands and attributes assigned to the ZCL cluster source cluster id
on the request dst addr
node (usually, the same address as for the source eui64
device).
Example:
zdo bind off - Remove a binding between two endpoints on two nodes.
Remove bound connection between a device identified by source eui64
and endpoint source ep
, and a device identified by destination eui64
and endpoint destination ep
. The connection is removed for ZCL commands and attributes assigned to the ZCL cluster source cluster id
on the request dst addr
node (usually, the same address as for the source eui64
device).
zdo mgmt_bind - Read the binding table from a node.
Send a request to the remote device identified by dst_addr
to read the binding table through zdo mgmt_bind_req
(see spec. 2.4.3.3.4). If the whole binding table does not fit into a single mgmt_bind_resp
frame, the request initiates a series of mgmt_bind_req
requests to perform the full download of the binding table. start_index
is the index of the first entry in the binding table where the reading starts. It is zero by default.
Example:
Sends mgmt_bind_req
to the device with short address 0x1234
, asking it to return its binding table.
Sample output:
zdo nwk_addr - Resolve the EUI64 address to a short network address.
Example:
zdo ieee_addr - Resolve the EUI64 address by sending the IEEE address request.
zdo eui64 - Get the EUI64 address of the Zigbee device.
zdo short - Get the short 16-bit address of the Zigbee device.
zdo mgmt_leave - Send a request to a remote device to leave the network through zdo mgmt_leave_req (see the specification section 2.4.3.3.5).
Send mgmt_leave_req
to a remote node specified by dst_addr
. If device_address
is omitted or it has value 0000000000000000
, the remote device at address dst_addr
will remove itself from the network. If device_address
has other value, it must be a long address corresponding to dst_addr
or a long address of child node of dst_addr
. The request is sent with Remove Children and Rejoin flags set to 0
by default. Use options --children
or --rejoin
do change the respective flags to 1
. For more details, see the section 2.4.3.3.5 of the specification.
Examples:
Sends mgmt_leave_req
to the device with the short address 0x1234
, asking it to remove itself from the network.
Sends mgmt_leave_req
to the device with the short address 0x1234
, asking it to remove itself from the network and perform rejoin.
Sends mgmt_leave_req
to the device with the short address 0x1234
, asking it to remove device 0b010ef8872c633e
from the network. If the target device with the short address 0x1234
has also a long address 0b010ef8872c633e
, it will remove itself from the network If the target device with the short address 0x1234
has a child with long address 0b010ef8872c633e
, it will remove the child from the network.
Sends mgmt_leave_req
to the device with the short address 0x1234
, asking it to remove itself and all its children from the network.
zcl cmd - Send a generic command to the remote node.
Send a generic command with ID cmd_ID
and payload payload
to the cluster cluster
. The cluster belongs to the profile profile
, which resides on the endpoint ep
of the remote node dst_addr
. Optional default response can be set with -d
.
eui64
and ep
to 0.zcl attr read - Retrieve the attribute value of the remote node.
Read the value of the attribute attr_id
in the cluster cluster
. The cluster belongs to the profile profile
, which resides on the endpoint ep
of the remote node dst_addr
.
zcl attr write - Write the attribute value to the remote node.
Write the attr_value
value of the attribute attr_id
of the type attr_type
in the cluster cluster
. The cluster belongs to the profile profile
, which resides on the endpoint ep
of the remote node dst_addr
.
attr_value
value must be in the hexadecimal format, unless it is a string (attr_type == 42
), then it must be a string.zcl subscribe on - Subscribe to the attribute changes on the remote node.
Enable reporting on the node identified by the address eui64
, with the endpoint ep
that uses the profile profile
of the attribute attr ID
with the type attr type
in the cluster cluster
.
The reports must be generated in intervals not shorter than min interval
(1 second by default) and not longer than max interval
(60 seconds by default).
zcl subscribe off - Unsubscribe from the attribute reports.
Disable reporting on the node identified by the address eui64
, with the endpoint ep
that uses the profile profile
of the attribute attr ID
with the type attr type
in the cluster cluster
.
zcl ping - Issue a ping over ZCL.
Example:
Issue a ping-style command to another CLI device of the address dst_addr
by using payload_size
bytes of payload.
Optionally, the device can request an APS acknowledgement (--aps-ack
) or ask the destination not to sent ping reply (--no-echo
).
To implement the ping-like functionality, a new custom cluster has been defined with ID 64. There are four custom commands defined inside it, each with its own ID.
See the following flow graphs for details.
Case 1: Ping with echo, without the APS acknowledgement (default mode):
In this default mode, the ping
command measures the time needed for a Zigbee frame to travel between two nodes in the network (there and back again). The command uses a custom "overloaded" ZCL frame, which is constructed as a ZCL frame of the new custom ping ZCL cluster (ID 64).
radio fem - Activate or deactivate the Front-End Modules (FEM).
The configuration of the FEM is the default one (defined at compile time; see the define NRF_802154_FEM_DEFAULT_SETTINGS).
For more information, see the description of the FEM on the 802.15.4 radio driver Wiki.
radio channel set - Set the 802.15.4 channel directly.
The <d:channel_number> must be between 11 and 26 (included), since these channels are supported by the driver.
bdb channel
function, which defines the channels allowed for the Zigbee network formation.radio channel get - Get the current 802.15.4 channel.
version - Print the firmware version.
debug - Enable/Disable debug mode in the CLI.
This command unblocks several additional commands in the CLI. They can render the device unstable. It is implied that you know what you are doing.
zscheduler suspend - Suspend Zigbee scheduler processing.
zscheduler resume - Resume Zigbee scheduler processing.