Skip to main content
Ctrl+K
Matter  documentation - Home Matter  documentation - Home
  • GitHub

Contents

  • Matter Project Flow
  • Visual Studio Code Development
  • CI/CD Documentation
    • Daily Fail Summary
  • Development Controllers
    • chip-repl
      • Matter Python REPL
      • Using Python CHIP Controller advanced features
      • Working with Python CHIP Controller
    • chip-tool
      • Working with the CHIP Tool
  • Getting Started
    • Compiling, Running, and Controlling Matter examples
    • Changing Examples
    • SDK Architecture Overview
  • IDs and Codes
    • Matter SDK CHIP_ERROR enums values
    • List of currently defined spec clusters
    • List of currently defined ZAP clusters
  • Cluster and Device Type development
    • Implementing New Clusters & Device Types
    • Adding new clusters and device types to the codegen
    • Designing Clusters for Testing and Portability
  • Guides
    • Building Matter
    • Access Control Guide
    • Matter Development and Testing with/on Apple Devices
    • Device Attestation Revocation Testing Guide
    • Fabric Synchronization Guide
    • Joint Fabric Guide
    • The .matter IDL file format
    • Simulated Device How-To (Linux)
  • Platform Guides
    • Android
      • Building Android
    • ASR
      • ASR Getting Started Guide
    • Bouffalolab
      • Checking out the Matter code
      • Introduction to Matter factory data
      • Build OTA image
      • Bouffalo Lab SoCs
      • Bouffalo Lab with RPC console
    • Espressif (ESP32) Getting Started Guide
      • Bluetooth Low Energy (BLE)
      • ESP32 Application Usage Guide
      • Configuration options
      • Using ESP32 Factory Data Provider
      • Flash and NVS encryption
      • Matter OTA
      • Providers Implemented for ESP32 Platform
      • RPC Console and Device Tracing
      • Using esp_secure_cert partition
      • Setup ESP-IDF and Matter Environment
      • Visual Studio Code Development
    • Infineon
      • Matter Software Update with Infineon PSoC6 example applications
      • Infineon OPTIGA™ Trust M Provisioning for Matter
    • Linux
      • Bluetooth Low Energy (BLE)
      • Debugging tips
    • MbedOS
      • Mbed-OS add new hardware target
      • Matter Arm Mbed OS provisioning guide
      • Mbed-OS platform overview
    • NRF
      • Commissioning nRF Connect Accessory using Android CHIPTool
      • Using CLI in nRF Connect examples
      • Configuring nRF Connect examples
      • Performing Device Firmware Upgrade in the nRF Connect examples
      • Configuring factory data for the nRF Connect examples
      • nRF Connect platform overview
    • NXP
      • Matter Over-The-Air Software Update with NXP RTs example applications
      • NXP Matter Application Architecture for FreeRTOS platforms
      • Matter NXP Examples Guide for FreeRTOS platforms
      • Building and Running CHIP Linux Examples for i.MX 8M Mini EVK
      • NXP K32W0x1 OTA guide
      • Commissioning NXP K32W using Android CHIPTool
      • NXP Manufacturing data
      • NXP MCXW71/K32W1 OTA guide
      • Thread Border Router usage
      • MATTER NXP RT1060 Applications Guide
      • MATTER NXP RT1170 Applications Guide
      • Matter NXP RW61x Applications Guide targeting FreeRTOS OS
      • Matter NXP Zephyr Application
      • Matter Over-The-Air Software Update with NXP using Zephyr example applications
    • OpenIoTSDK
      • Commissioning Open IoT SDK devices
      • Matter Open IoT SDK Example Application
      • Matter Open IoT SDK Example Device Firmware Upgrade
      • Open IoT SDK platform port
      • Matter Open IoT SDK unit tests
    • OpenThread
      • Setup OpenThread Border Router on Raspberry Pi
      • Configuring OpenThread Radio Co-processor on nRF52840 Dongle
    • Silabs
      • Silabs CLI Guide
      • Standard Application Behavior Guide
      • Matter Software Update with EFR32 example applications
      • Silicon Labs Matter Solution Guide
    • STM32
      • STM32 Getting Started Guide
    • TI
      • Running Matter Examples on the TI SimpleLink CC2674P10 and CC2674R10
      • Get started with SysConfig
      • Configure The Board Files with SysConfig
      • Configuring OpenThread libraries on TI CC13x4_CC26x4 Platforms
      • Texas Instruments Matter Factory Data Programming User Guide
      • Configuring Intermittently Connected Devices on TI SimpleLink CC13x4_CC26x4 Platforms
      • Texas Instruments platform overview
      • Running Matter Examples on the TI SimpleLink CC2674P10 and CC2674R10
      • Get started with SysConfig
      • Configure The Board Files with SysConfig
      • Configuring Intermittently Connected Devices on TI SimpleLink CC13x4_CC26x4 Platforms
      • Texas Instruments Matter Factory Data Programming User Guide
      • Configuring OpenThread libraries on TI CC13x4_CC26x4 Platforms
  • Style Guides
    • Coding Style Guide
    • CHIP Makefile Style Guide
    • Matter Documentation Style Guide
  • Examples
    • Air Purifier
      • CHIP Air Purifier Example
      • CHIP Ameba Air Purifier Example
      • Matter CC32XXSF Air Purifier Example Application
      • CHIP Linux Air Purifier Example
    • Air Quality
      • Matter Linux Air Quality Example
      • Matter Air Quality Sensor Example
      • Matter Telink Air Quality Sensor Example Application
    • All clusters
      • CHIP Ameba All Clusters Example
      • Matter ASR All Clusters Example
      • Matter ESP32 All Clusters Example
      • CHIP PSoC6 All Clusters Example
      • Matter Linux/Mac All Clusters Example
      • Matter Arm Mbed OS All Clusters Example Application
      • Matter nRF Connect All Clusters Example Application
      • CHIP NXP All-clusters Application
      • Matter MW320 All Clusters Example Application
      • Matter Open IoT SDK All-Clusters-App Example Application
      • Matter BEE4 Lighting Example Application
      • Matter Telink All Clusters Example Application
    • All clusters minimal
      • CHIP Ameba All Clusters Example
      • Matter ASR All Clusters Example
      • CHIP ESP32 All Clusters Example
      • CHIP PSoC6 All Clusters Example
      • Matter Arm Mbed OS All Clusters Example Application
      • Matter nRF Connect All Clusters Example Application
      • Matter Telink All Clusters Minimal Example Application
    • Bridge
      • Matter ASR Bridge Example
      • Matter ESP32 Bridge App Example
      • Matter Linux Bridge Example
      • Matter Telink Bridge Example Application
    • Camera
      • CHIP Linux Camera Example App
    • Camera
      • Matter Camera Controller Example
    • CHEF
      • MATTER CHEF APP
      • Matter Shell - Device Layer module
      • Matter Shell - OpenThread CLI pass-through
      • Matter Shell Reference
      • CHIP nRF Connect SDK Shell Application
      • Chef Build Conventions
    • CHIP Tool example
      • Matter Client Example
    • Closure
      • Matter SiWx917 Closure Example
    • Contact Sensor
      • Matter Bouffalo Lab Contact Sensor Example
      • Matter Linux Contact Sensor Example
      • Matter NXP Contact Sensor Example Application
      • CHIP K32W061 Contact Sensor Example Application
      • Matter K32W1 Contact Sensor Example Application
      • Matter MCXW71 Contact Sensor Example Application
      • Matter Telink Contact Sensor Example Application
    • CHIP Tool Darwin
      • Matter darwin-framework-tool
    • Dishwasher
      • Matter Linux Dishwasher Example
      • Matter Silabs dishwasher Example
    • Energy Gateway
      • Matter ESP32 Energy Gateway Example
      • Matter Linux Energy Gateway Example
    • Energy Management
      • Matter ESP32 Energy Management Example
      • Matter Linux Energy Management Example
      • Matter EFR32 Energy Management Example
    • Fabric Admin
      • Matter Fabric Administrator Example
    • Fabric Bridge
      • Matter Linux Fabric Bridge Example
    • Fabric Sync
      • Matter Linux Fabric Sync Example
    • Java matter controller
      • Matter Controller Java App Example
    • Joint Fabric Admin
      • Matter Joint Fabric Admin Example
    • Joint Fabric Control
      • Matter Joint Fabric Control Example
    • Kotlin matter controller
      • Matter Controller Kotlin App Example
    • Laundry washer
      • CHIP RT1060 Thermostat Application
      • CHIP RT1170 Thermostat Application
      • CHIP RW61x Laundry washer Application
      • CHIP NXP Zephyr Laundry Washer Application
    • Light switch
      • CHIP Ameba Light Switch Example
      • Matter ASR Light Switch Example
      • Matter Light Switch Example Application
      • Matter ESP32 Light-switch Example
      • Matter Genio Light Switch Example
      • Matter CYW30739 Light Switch Example
      • Matter nRF Connect Light Switch Example Application
      • Matter QPG6105 SDK
      • Matter BEE4 Light Switch Example Application
      • Matter EFR32 Light Switch Example
      • Matter Telink Light Switch Example Application
      • Matter QPG6105 Light Switch Example Application
    • Lighting
      • CHIP Ameba Lighting Example
      • Matter ASR Lighting Example
      • Matter BEKEN Lighting Example
      • Matter Bouffalo Lab Lighting app Example
      • Matter Lighting Example Application
      • Matter ESP32 Lighting Example
      • Matter Genio Lighting Example
      • Matter CYW30739 Lighting Example
      • CHIP PSoC6 Lighting Example
      • CHIP Linux Lighting Example
      • Matter Arm Mbed OS Lighting Example Application
      • Matter nRF Connect Lighting Example Application
      • Matter NXP Lighting Example Application
      • CHIP K32W061 Lighting Example Application
      • Matter K32W1 Lighting Example Application
      • Matter MCXW71 Lighting Example Application
      • Python-based lighting example (bridge) device to DALI
      • Matter QPG6105 SDK
      • Matter BEE4 Lighting Example Application
      • Matter EFR32 Lighting Example
      • Matter STM32 Lighting Example over thread
      • Matter Telink Lighting Example Application
      • CHIP Tizen Lighting Example
      • Matter QPG6105 Lighting Example Application
    • Lighting without unique id
      • CHIP Linux Lighting Example (Data Mode, No Unique ID)
    • Lit ICD
      • Matter ESP32 LIT ICD Example
      • Matter nRF Connect LIT ICD Example Application
      • Matter EFR32 Lit ICD Example
    • Lock
      • Matter ASR Lock Example
      • Matter Lock Example Application
      • Matter CC32XXSF Lock Example Application
      • Matter ESP32 Lock Example
      • Matter Genio Lock Example
      • Matter CYW30739 Lock Example
      • Matter PSoC6 Lock Example
      • Lock Application for Linux
      • Matter Arm Mbed OS Lock Example Application
      • Matter nRF Connect Lock Example Application
      • Matter NXP Door Lock Example Application
      • Matter K32W1 Door Lock Example Application
      • Matter MCXW71 Door Lock Example Application
      • Matter Open IoT SDK Lock-App Example Application
      • Matter QPG6105 SDK
      • Matter BEE4 Lock Example Application
      • Matter EFR32 Lock Example
      • Matter Telink Lock Example Application
      • Matter QPG6105 Lock Example Application
    • Log source
      • log-source-app
    • Microwave ovens
      • Matter Linux Microwave Oven Example
    • Minimal MDNS
      • Minimal mDNS example
    • Network Infrastructure Manager
      • network-manager-app
    • OTA Provider
      • CHIP ESP32 OTA Provider Example
      • ota-provider-app
    • OTA Requestor
      • CHIP Ameba OTA Requestor Example
      • Matter ASR OTA Requestor Example
      • CHIP ESP32 OTA Requestor Example
      • Matter Genio Lighting Example
      • ota-requestor-app (Linux)
      • Matter Arm Mbed OS Lock Example Application
      • Matter Open IoT SDK OTA-Requestor-App Example Application
      • Matter BEE4 Lighting Example Application
      • Supported devices
    • Persistent storage
      • CHIP ESP32 Persistent Storage Example
      • CHIP PSoC6 Persistent Storage Example
      • CHIP Linux Persistent Storage Example
      • Matter QPG6105 SDK
      • CHIP QPG6105 Persistent Storage Application
    • Pigweed
      • CHIP Ameba Pigweed Example Application
      • CHIP ESP32 Pigweed Example Application
      • Matter Arm Mbed OS Pigweed Example Application
    • Pump
      • Matter Pump Example Application
      • Matter nRF Connect Pump Example Application
      • Matter EFR32 Pump Example
      • Matter Telink Pump Controller Example Application
    • Pump controller
      • Matter Pump Controller Example Application
      • Matter nRF Connect Pump Example Application
      • Matter Telink Pump Controller Example Application
    • Refrigerator
      • CHIP Linux Refrigerator Example
      • Matter Refrigerator and Temperature Controlled Example
    • RVC
      • RVC example app
    • Shell
      • Matter Shell Reference
      • Matter Shell - Device Layer module
      • Matter Shell - OpenThread CLI pass-through
      • Matter Shell - App Server module
      • Matter Shell Application
      • Matter Arm Mbed OS Shell Example Application
      • Matter nRF Connect SDK Shell Application
      • Matter Open IoT SDK Shell Example Application
      • Matter Telink Shell Example Application
    • Smoke CO Alarm example
      • Matter EFR32 Smoke CO Alarm Example
      • Matter Telink Smoke CO Alarm Example Application
    • Thread Border Router
      • Matter ESP32 Thread Border Router Example
    • Temperature measurement
      • Matter ASR Temperature Measurement Example
      • Matter ESP32 Temperature Sensor Example
      • Matter Telink Temperature Measurement Example Application
    • Thermostat
      • Matter ASR Thermostat Example
      • Matter Genio Thermostat Example
      • Matter CYW30739 Thermostat Example
      • CHIP NXP Thermostat Application
      • Matter QPG6105 SDK
      • Matter BEE4 Lighting Example Application
      • Matter EFR32 Thermostat Example
      • Matter Telink Thermostat Example Application
      • Matter QPG6105 Thermostat Example Application
    • TV
      • Matter tv app common-api
      • Content App
      • Matter TV Example
      • Matter Open IoT SDK TV-App Example Application
    • TV casting
      • Matter TV Casting Android App Example
      • Matter TV Casting iOS App Example
      • CHIP TV Casting App Example
      • Matter Casting APIs
    • Virtual Device App
      • Matter Android Virtual Device App Example
    • Water Leak Detector
      • Matter Linux Water Leak Detector Example
    • Window
      • Matter nRF Connect Window Covering Example Application
      • Matter BEE4 Lighting Example Application
      • Matter EFR32 Window Covering Example
      • Matter Telink Window Example Application
  • Discussion
    • LwIP changes for Matter
  • Testing Guides
    • Table of Contents
    • CI testing
    • Fuzz testing
    • Integration Test utilities
    • Integration and Certification Tests
    • PICS and PIXITs
    • Python framework tests
    • Unit testing
    • YAML tests
    • YAML Pseudo-clusters
    • YAML Schema
  • Tips and Troubleshooting
    • Device discovery from a Host computer (mDNS Scanning)
    • Troubleshooting Avahi
  • Tools
    • CHIP Certificate Tool
    • SPAKE2P Parameters Tool
    • Memory usage scripts
    • SPAKE2+ Python Tool
    • ELF binary size information
    • NXP Factory Data Generator
    • NXP OTA image tool
    • FactoryDataProvider for EFR32 Matter device
    • Silabs OTA image tool
    • Silabs Factory Data Generator
    • Manufacturing Partition Generator Utility
  • ZAP and Codegen
    • Code generation
    • ZAP
  • Reporting bugs
  • Upgrading notes
  • Project issues
  • Guidelines for writing pull requests
  • .md

Matter Telink Light Switch Example Application

Contents

  • Supported devices
  • Build and flash
  • Usage
    • UART
    • Buttons
    • LEDs
      • Indicate current state of Thread network
      • Indicate identify of device
    • CHIP tool commands
    • Binding cluster and endpoints
      • Unicast binding to a remote endpoint using the CHIP Tool
      • Group multicast binding to the group of remote endpoints using the CHIP Tool
    • Testing the communication
    • OTA with Linux OTA Provider

Matter Telink Light Switch Example Application#

The Telink Light Switch Example demonstrates how to remotely control a lighting devices such as light bulbs or LEDs. The application should be used together with the lighting app example. The light switch uses buttons to test changing the lighting application example LED state and works as a brightness dimmer. You can use this example as a reference for creating your own application.

Telink B91 EVK

Supported devices#

The example supports building and running on the following devices:

Board/SoC

Build target

Zephyr Board Info

B91 TLSR9518ADK80D

tlsr9518adk80d, tlsr9518adk80d-mars, tlsr9518adk80d-usb

TLSR9518ADK80D

B92 TLSR9528A

tlsr9528a, tlsr9528a_retention

TLSR9528A

W91 TLSR9118BDK40D

tlsr9118bdk40d

TLSR9118BDK40D

Build and flash#

  1. Run the Docker container:

    $ docker run -it --rm -v $PWD:/host -w /host ghcr.io/project-chip/chip-build-telink:$(wget -q -O - https://raw.githubusercontent.com/project-chip/connectedhomeip/master/.github/workflows/examples-telink.yaml 2> /dev/null | grep chip-build-telink | awk -F: '{print $NF}' | head -n1)
    

    The default Docker container includes the recommended Zephyr version, as specified in:

    $ integrations/docker/images/stage-2/chip-build-telink/Dockerfile
    

    If you need to use Zephyr 3.3.0, use the following container instead:

    $ docker run -it --rm -v $PWD:/host -w /host ghcr.io/project-chip/chip-build-telink-zephyr_3_3:$(wget -q -O - https://raw.githubusercontent.com/project-chip/connectedhomeip/master/.github/workflows/examples-telink.yaml 2> /dev/null | grep chip-build-telink-zephyr_3_3 | awk -F: '{print $NF}')
    

    You can check the compatible Docker image version in:

    $ .github/workflows/examples-telink.yaml
    
  2. Activate the build environment:

    $ source ./scripts/activate.sh -p all,telink
    
  3. Build the example (replace <build_target> with your board name, see Supported devices):

    $ west build -b <build_target>
    

    Also use key -DFLASH_SIZE, if your board has memory size different from 2 MB, for example, -DFLASH_SIZE=1m or -DFLASH_SIZE=4m:

    $ west build -b <build_target> -- -DFLASH_SIZE=4m
    

    You can find the target built file called zephyr.bin under the build/zephyr directory.

  4. Flash binary:

    $ west flash --erase
    

Usage#

UART#

To get output from device, connect UART to following pins:

Name

Pin

RX

PB3 (pin 17 of J34 connector)

TX

PB2 (pin 16 of J34 connector)

GND

GND

Baud rate: 115200 bits/s

Buttons#

The following buttons are available on tlsr9518adk80d board:

Name

Function

Description

Button 1

Factory reset

Perform factory reset to forget currently commissioned Thread network and return to a decommissioned state (to activate, push the button 3 times)

Button 2

Light Switch control

Manually triggers the light switch state

Button 3

Thread start

Commission thread with static credentials and enables the Thread on device

Button 4

Open commission window

The button is opening commissioning window to perform commissioning over BLE

LEDs#

Indicate current state of Thread network#

Red LED indicates current state of Thread network. It is able to be in following states:

State

Description

Blinks with short pulses

Device is not commissioned to Thread, Thread is disabled

Blinks with frequent pulses

Device is commissioned, Thread enabled. Device trying to JOIN thread network

Blinks with wide pulses

Device commissioned and joined to thread network as CHILD

Indicate identify of device#

Green LED used to identify the device. The LED starts blinking when the Identify command of the Identify cluster is received. The command’s argument can be used to specify the the effect. It is able to be in following effects:

Effect

Description

Blinks (200 ms on/200 ms off)

Blink (Clusters::Identify::EffectIdentifierEnum::kBlink)

Breathe (during 1000 ms)

Breathe (Clusters::Identify::EffectIdentifierEnum::kBreathe)

Blinks (50 ms on/950 ms off)

Okay (Clusters::Identify::EffectIdentifierEnum::kOkay)

Blinks (1000 ms on/1000 ms off)

Channel Change ( Clusters::Identify::EffectIdentifierEnum::kChannelChange)

Blinks (950 ms on/50 ms off)

Finish ( Clusters::Identify::EffectIdentifierEnum::kFinishEffect)

LED off

Stop (Clusters::Identify::EffectIdentifierEnum::kStopEffect)

CHIP tool commands#

  1. Build chip-tool cli

  2. Pair with device

    ${CHIP_TOOL_DIR}/chip-tool pairing ble-thread ${NODE_ID} hex:${DATASET} ${PIN_CODE} ${DISCRIMINATOR}
    

    Example:

    ./chip-tool pairing ble-thread 1234 hex:0e080000000000010000000300000f35060004001fffe0020811111111222222220708fd61f77bd3df233e051000112233445566778899aabbccddeeff030e4f70656e54687265616444656d6f010212340410445f2b5ca6f2a93a55ce570a70efeecb0c0402a0fff8 20202021 3840
    

Binding cluster and endpoints#

Binding links clusters and endpoints on both devices, which enables them to communicate with each other.

To perform binding, you need a controller that can write the binding table to the light switch device and write proper ACL to the endpoint light bulb on the Lighting Example application. For example, you can use the CHIP Tool as the controller. The ACL should contain information about all clusters that can be called by the light switch application. See the section about interacting with ZCL clusters in the CHIP Tool’s user guide for more information about ACLs.

You can perform the binding process to a single remote endpoint (unicast binding) or to a group of remote endpoints (group multicast).

Note: To use a light switch without brightness dimmer, apply only the first binding command with cluster no. 6.

Unicast binding to a remote endpoint using the CHIP Tool#

In this scenario, commands are provided for a light switch device with the nodeId = <light-switch-node-id> and a light bulb device with nodeId = <lighting-node-id>, both commissioned to the same Matter network.

To perform the unicast binding process, complete the following steps:

  1. Add an ACL to the development kit that is programmed with the Lighting Application Example by running the following command:

    $ ./chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": [<light-switch-node-id>], "targets": [{"cluster": 6, "endpoint": 1, "deviceType": null}, {"cluster": 8, "endpoint": 1, "deviceType": null}]}]' <lighting-node-id> 0
    

    In this command:

    • {"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null} is an ACL for the communication with the CHIP Tool.

    • {"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [<light-switch-node-id>], "targets": [{"cluster": 6, "endpoint": 1, "deviceType": null}, {"cluster": 8, "endpoint": 1, "deviceType": null}]} is an ACL for binding (cluster no. 6 is the On/Off cluster and the cluster no. 8 is the Level Control cluster).

    This command adds permissions on the lighting application device that allows it to receive commands from the light switch device.

  2. Add a binding table to the Light Switch binding cluster:

    $ ./chip-tool binding write binding '[{"fabricIndex": 1, "node": <lighting-node-id>, "endpoint": 1, "cluster": 6}]' <light-switch-node-id> 1
    

    In this command:

    • {"fabricIndex": 1, "node": <lighting-node-id>, "endpoint": 1, "cluster": 6} is a binding for the On/Off cluster.

    • {"fabricIndex": 1, "node": <lighting-node-id>, "endpoint": 1, "cluster": 8} is a binding for the Level Control cluster.

Group multicast binding to the group of remote endpoints using the CHIP Tool#

The group multicast binding lets you control more than one lighting device at a time using a single light switch.

The group multicast binding targets all development kits that are programmed with the Lighting Application Example and added to the same multicast group. After the binding is established, the light switch device can send multicast requests, and all of the devices in the bound groups can run the received command.

In this scenario, commands are provided for a light switch device with the nodeId = <light-switch-node-id> and a light bulb device with nodeId = <lighting-node-id>, both commissioned to the same Matter network.

To perform the unicast binding process, complete the following steps:

  1. Add an ACL to the lighting endpoint permissions by running the following command:

    $ ./chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": [<light-switch-node-id>], "targets": [{"cluster": 6, "endpoint": 1, "deviceType": null}, {"cluster": 8, "endpoint": 1, "deviceType": null}]}]' <lighting-node-id> 0
    

    In this command:

    • {"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null} is an ACL for the communication with the CHIP Tool.

    • {"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [<light-switch-node-id>], "targets": [{"cluster": 6, "endpoint": 1, "deviceType": null}, {"cluster": 8, "endpoint": 1, "deviceType": null}]} is an ACL for binding (cluster no. 6 is the On/Off cluster and the cluster no. 8 is the Level Control cluster).

    This allows the lighting application device to receive commands from the light switch device.

  2. Add the light switch device to the multicast group by running the following command:

    $ ./chip-tool tests TestGroupDemoConfig --nodeId <light-switch-node-id>
    
  3. Add all light bulbs to the same multicast group by applying command below for each of the light bulbs, using the appropriate <lighting-node-id> (the user-defined ID of the node being commissioned except <light-switch-node-id> due to use this <light-switch-node-id> for light-switch) for each of them:

    $ ./chip-tool tests TestGroupDemoConfig --nodeId <lighting-node-id>
    
  4. Add Binding commands for group multicast:

    $ ./chip-tool binding write binding '[{"fabricIndex": 1, "group": 257}]' <light-switch-node-id> 1
    

Testing the communication#

To test the communication between the light switch device and the bound devices, use light switch buttons.

OTA with Linux OTA Provider#

OTA feature enabled by default only for ota-requestor-app example. To enable OTA feature for another Telink example:

  • set CONFIG_CHIP_OTA_REQUESTOR=y in corresponding “prj.conf” configuration file.

After build application with enabled OTA feature, use next binary files:

  • merged.bin - main binary to flash PCB (Use at least 2MB PCB).

  • matter.ota - binary for OTA Provider

All binaries has the same SW version. To test OTA “matter.ota” should have higher SW version than base SW. Set CONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2 in corresponding “prj.conf” configuration file.

Usage of OTA:

  • Build the Linux OTA Provider

    ./scripts/examples/gn_build_example.sh examples/ota-provider-app/linux out/ota-provider-app chip_config_network_layer_ble=false
    
  • Run the Linux OTA Provider with OTA image.

    ./chip-ota-provider-app -f matter.ota
    
  • Provision the Linux OTA Provider using chip-tool

    ./chip-tool pairing onnetwork ${OTA_PROVIDER_NODE_ID} 20202021
    

    here:

    • ${OTA_PROVIDER_NODE_ID} is the node id of Linux OTA Provider

  • Configure the ACL of the ota-provider-app to allow access

    ./chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": [112233], "targets": null}, {"fabricIndex": 1, "privilege": 3, "authMode": 2, "subjects": null, "targets": null}]' ${OTA_PROVIDER_NODE_ID} 0
    

    here:

    • ${OTA_PROVIDER_NODE_ID} is the node id of Linux OTA Provider

  • Use the chip-tool to announce the ota-provider-app to start the OTA process

    ./chip-tool otasoftwareupdaterequestor announce-otaprovider ${OTA_PROVIDER_NODE_ID} 0 0 0 ${DEVICE_NODE_ID} 0
    

    here:

    • ${OTA_PROVIDER_NODE_ID} is the node id of Linux OTA Provider

    • ${DEVICE_NODE_ID} is the node id of paired device

Once the transfer is complete, OTA requestor sends ApplyUpdateRequest command to OTA provider for applying the image. Device will restart on successful application of OTA image.

previous

Matter EFR32 Light Switch Example

next

Matter QPG6105 Light Switch Example Application

Contents
  • Supported devices
  • Build and flash
  • Usage
    • UART
    • Buttons
    • LEDs
      • Indicate current state of Thread network
      • Indicate identify of device
    • CHIP tool commands
    • Binding cluster and endpoints
      • Unicast binding to a remote endpoint using the CHIP Tool
      • Group multicast binding to the group of remote endpoints using the CHIP Tool
    • Testing the communication
    • OTA with Linux OTA Provider

By Matter Contributors

© Copyright 2020-2023, Matter Contributors.