Skip to content

Build chip tool on Raspberry PI

Tymoteusz Bloch edited this page Apr 12, 2021 · 6 revisions

Building CHIP Raspberry PI Ubuntu Client Example

An example application that uses CHIP to send messages to a CHIP server.



Building

  • Install tool chain

      $ sudo apt-get install git python pkg-config python3-venv python3-dev libssl-dev libdbus-1-dev libglib2.0-dev ninja-build libavahi-client-dev  
    
  • Build the example application:

      $ examples/chip-tool
      $ git submodule update --init
      $ source third_party/connectedhomeip/scripts/activate.sh
      $ gn gen out/debug
      $ ninja -C out/debug
    
  • Prerequisites

    1. A Raspberry Pi 4 board
    2. Ubuntu 20.04 or newer image for ARM64 platform.
  • Building

    Follow Building section of this document.

  • After the application is built, it can be found in the build directory as out/debug/chip-tool

Using the Client to Pair a device

In order to send commands to a device, it must be paired with the client.

Pair a device

To initiate a client pairing request to a device, run the built executable and choose the pairing mode.

Pair a device configured to bypass Rendezvous

The command below pair a device with the provided IP address and port of the server to talk to.

$ chip-tool pairing bypass 192.168.0.30 11097

Unpair a device

$ chip-tool pairing unpair

Using the Client to Send CHIP Commands

To use the Client to send a CHIP 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.

$ chip-tool onoff on 1

The client will send a single command packet and then exit.

How to get the list of supported clusters

To get the list of supported clusters, run the built executable without any arguments.

$ chip-tool

Example output:

Usage:
  ./chip-tool cluster_name command_name [param1 param2 ...]

  +-------------------------------------------------------------------------------------+
  | Clusters:                                                                           |
  +-------------------------------------------------------------------------------------+
  | * barriercontrol                                                                    |
  | * basic                                                                             |
  | * colorcontrol                                                                      |
  | * doorlock                                                                          |
  | * groups                                                                            |
  | * iaszone                                                                           |
  | * identify                                                                          |
  | * levelcontrol                                                                      |
  | * onoff                                                                             |
  | * pairing                                                                           |
  | * payload                                                                           |
  | * scenes                                                                            |
  | * temperaturemeasurement                                                            |
  +-------------------------------------------------------------------------------------+

How to get the list of supported commands for a specific cluster

To get the list of commands for a specific cluster, run the built executable with the target cluster name.

$ chip-tool onoff

How to get the list of supported attributes for a specific cluster

To the the list of attributes for a specific cluster, run the built executable with the target cluster name and the read command name.

$ chip-tool onoff read

How to get the list of parameters for a command

To get the list of parameters for a specific command, run the built executable with the target cluster name and the target command name

$ chip-tool onoff on