See the build guide for general background on build prerequisites.
Building the example application is quite straightforward.
scripts/examples/gn_build_example.sh examples/darwin-framework-tool SOME-PATH/
which puts the binary at SOME-PATH/darwin-framework-tool
.
In order to send commands to a device, it must be commissioned with the client. darwin-framework-tool currently only supports commissioning and remembering one device at a time. The configuration state is stored in /tmp/chip_tool_config.ini
; deleting this and other .ini
files in /tmp
can sometimes resolve issues due to stale configuration.
To initiate a client commissioning request to a device, run the built executable and choose the pairing mode.
The command below will pair devices with the provided IP, discriminator and setup code.
$ darwin-framework-tool pairing ethernet {NODE_ID_TO_ASSIGN} 20202021 3840 {IP_ADDRESS}
In this case, the device will be assigned node id ${NODE_ID_TO_ASSIGN}
(which must be a decimal number or a 0x-prefixed hex number).
$ darwin-framework-tool pairing unpair
To use the Client to send Matter commands, run the built executable and pass it the target cluster name, the target command name as well as an endpoint id.
The endpoint id must be between 1 and 240.
$ darwin-framework-tool onoff on 1
The client will send a single command packet and then exit.
To get the list of supported clusters, run the built executable without any arguments.
$ darwin-framework-tool
Example output:
Usage: ./darwin-framework-tool cluster_name command_name [param1 param2 ...] +-------------------------------------------------------------------------------------+ | Clusters: | +-------------------------------------------------------------------------------------+ | * basic | | * colorcontrol | | * doorlock | | * groups | | * iaszone | | * identify | | * levelcontrol | | * onoff | | * pairing | | * payload | | * scenes | | * temperaturemeasurement | +-------------------------------------------------------------------------------------+
To get the list of commands for a specific cluster, run the built executable with the target cluster name.
$ darwin-framework-tool onoff
To the the list of attributes for a specific cluster, run the built executable with the target cluster name and the read
command name.
$ darwin-framework-tool onoff read
To get the list of parameters for a specific command, run the built executable with the target cluster name and the target command name
$ darwin-framework-tool onoff on