#CHIP P6 All Clusters Example
An example showing the use of Matter on the Infineon CY8CKIT-062S2-43012 board.
The P6 clusters example provides a baseline demonstration of a Cluster control device, built using Matter and the Infineon Modustoolbox SDK. It can be controlled by Matter controller over Wi-Fi network.
The P6 device can be commissioned over Bluetooth Low Energy where the device and the Matter controller will exchange security information with the Rendezvous procedure. Wi-Fi Network credentials are then provided to the P6 device which will then join the network.
Refer to integrations/docker/images/chip-build-infineon/Dockerfile
or scripts/examples/gn_p6_example.sh
for downloading the Software and related tools.
Install some additional tools (likely already present for Matter developers): $ sudo apt install gcc g++ clang ninja-build python python3-venv libssl-dev libavahi-client-dev libglib2.0-dev git cmake python3-pip
Supported hardware: CY8CKIT-062S2-43012
Build the example application:
$ ./scripts/examples/gn_p6_example.sh ./examples/all-clusters-app/p6 out/clusters_app_p6
To delete generated executable, libraries and object files use:
$ cd ~/connectedhomeip $ rm -rf out/
Put CY8CKIT-062S2-43012 board on KitProg3 CMSIS-DAP Mode by pressing the MODE SELECT
button. KITPROG3 STATUS
LED is ON confirms board is in proper mode.
On the command line:
$ cd ~/connectedhomeip $ python3 out/clusters_app_p6/chip-p6-clusters-example.flash.py
Commissioning can be carried out using BLE.
Once P6 is up and running, we need to set up a device controller on Raspberry Pi 4 to perform commissioning and cluster control.
Set up python controller.
$ cd {path-to-connectedhomeip} $ ./scripts/build_python.sh -m platform
Execute the controller.
$ source ./out/python_env/bin/activate $ chip-device-ctrl
Establish the secure session over BLE.
- chip-device-ctrl > ble-scan - chip-device-ctrl > connect -ble 3840 20202021 1234 Parameters: 1. Discriminator: 3840 2. Setup-pin-code: 20202021 3. Node ID: Optional. If not passed in this command, then it is auto-generated by the controller and displayed in the output of connect. The same value should be used in the next commands. We have chosen a random node ID which is 1234.
Add credentials of the Wi-Fi network you want the P6 to connect to, using the AddOrUpdateWiFiNetwork
command and then enable the P6 to connect to it using EnableWiFiNetwork
command. In this example, we have used WIFI_SSID
and WIFI_PASSWORD
as the SSID and passphrase respectively.
- chip-device-ctrl > zcl NetworkCommissioning AddOrUpdateWiFiNetwork 1234 0 0 ssid=str:WIFI_SSID credentials=str:WIFI_PASSWORD breadcrumb=0 - chip-device-ctrl > zcl NetworkCommissioning ConnectNetwork 1234 0 0 networkID=str:WIFI_SSID breadcrumb=0
Close the BLE connection to P6, as it is not required hereafter.
- chip-device-ctrl > close-ble
Resolve DNS-SD name and update address of the node in the device controller.
- chip-device-ctrl > resolve 1234
Raspberry Pi 4 BLE connection issues can be avoided by running the following commands. These power cycle the BlueTooth hardware and disable BR/EDR mode.
$ sudo btmgmt -i hci0 power off $ sudo btmgmt -i hci0 bredr off $ sudo btmgmt -i hci0 power on