Advanced Matter Kconfig options
After enabling the Matter protocol and testing some of the samples, you can enable additional options in Kconfig and start developing your own Matter application.
You can use the
CONFIG_CHIP_PROJECT_CONFIG Kconfig option to define the path to the configuration file that contains project-specific Matter settings in the form of C preprocessor macros.
These macros cannot be altered using dedicated Kconfig options.
You can configure the Matter protocol to use NFC tag for commissioning, instead of the default QR code.
To enable NFC for commissioning and share the onboarding payload in an NFC tag, set the
CONFIG_CHIP_NFC_COMMISSIONING Kconfig option.
You can configure the Matter protocol to keep Matter subscriptions on the publisher node. This allows the device to save information about subscriptions and use it to re-establish the subscriptions immediately when coming back online after being offline for a longer time, for example due to a power outage. This is a much faster way than waiting for the subscriber node to notice that the publisher node is again available in the network.
To enable persistent subscriptions, set the
CONFIG_CHIP_PERSISTENT_SUBSCRIPTIONS Kconfig option.
Zephyr allows you to configure log levels of different software modules independently. To change the log level configuration for the Matter module, set one of the available options:
CONFIG_MATTER_LOG_LEVEL_WRN is not used in Matter.
See Using CLI in nRF Connect examples in the Matter documentation for the list of available Matter shell commands.
Matter has many ways to identify a specific device, both mandatory and optional. These can be used for various purposes, such as dividing devices into groups (by function, by vendor or by location), device commissioning or vendor-specific cases before the device was commissioned (for example, identifying factory software version or related features).
Some of these can be configured using the Kconfig options listed below:
CONFIG_CHIP_DEVICE_VENDOR_IDsets the device manufacturer identifier that is assigned by the Connectivity Standards Alliance.
CONFIG_CHIP_DEVICE_PRODUCT_IDsets the product identifier that is assigned by the product manufacturer.
CONFIG_CHIP_DEVICE_TYPEsets the type of the device using the Matter Device Type Identifier, for example Door Lock (0x000A) or Dimmable Light Bulb (0x0101).
CONFIG_CHIP_COMMISSIONABLE_DEVICE_TYPEenables including an optional device type subtype in the commissionable node discovery record. This allows filtering of the discovery results to find the nodes that match the device type.
CONFIG_CHIP_ROTATING_DEVICE_IDenables an optional rotating device identifier feature that provides an additional unique identifier for each device. This identifier is similar to the serial number, but it additionally changes at predefined times to protect against long-term tracking of the device.
Frustration-Free Setup (FFS) is Amazon’s proprietary technology that uses the user’s Amazon account and Alexa services to register an IoT device and provision it to a mesh network. It does not replace the default commissioning process, but uses the cloud-based Amazon Device Setup Service to provide commissioning information to the Matter network commissioner, instead of involving the user to provide it. FFS supports a variety of different network protocols, including Matter. For more information about how FFS works, see the Understanding Frustration-Free Setup page in the Amazon developer documentation.
The support for FFS over Matter in the nRF Connect SDK allows Matter devices to be automatically commissioned to the Matter network using the Matter-enabled Amazon Echo device. To enable the FFS support, set the following configuration options to meet the Amazon FFS setup prerequisites:
CONFIG_CHIP_DEVICE_TYPEto the appropriate value, depending on the device used. The value must be compliant with the Matter Device Type Identifier.
Every Matter device must use an unique device identifier for rotating device identifier calculation purpose.
By default, the identifier is set to a random value and stored in the factory data partition.
You can choose your own unique identifier value instead by setting the
CONFIG_CHIP_DEVICE_GENERATE_ROTATING_DEVICE_UID Kconfig option to
n and using the
CONFIG_CHIP_DEVICE_ROTATING_DEVICE_UID Kconfig option.
When using your own identifier, the value can be stored in either firmware or factory data.
For more information about the factory data generation, see the Matter Device Factory Provisioning page.
To read more about the FFS technology and its compatibility with Matter, see the following pages in the Amazon developer documentation:
When a Matter device is commissioned by the Matter controller, it then belongs to a specific Matter fabric. To ensure the interoperability of multiple applications and ecosystems, the device can join the Matter fabrics created by multiple ecosystems using the multi-fabric feature. As a result, the device can belong to multiple fabrics and can be managed by multiple Matter controllers.
To remove the device from a fabric, a Matter controller sends the leave request to it and then removes all information collected from the device. The device receives the leave request and removes all information about the fabric it is leaving.
When the device leaves the last fabric, one of several reactions can be set to happen.
To enable one of the reactions to the last fabric removal, set the corresponding Kconfig option to
CONFIG_CHIP_LAST_FABRIC_REMOVED_NONE- Do not react to the last fabric removal. The device will keep all saved data and network credentials, and will not reboot.
CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_ONLY- Remove all saved network credentials. The device will remove all saved network credentials, keep application-specific non-volatile data, and will not reboot.
CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_PAIRING_START- Remove all saved network credentials and start Bluetooth LE advertising. The device will remove all saved network credentials, keep application-specific non-volatile data, and start advertising Bluetooth LE Matter service. After that, it will be ready for commissioning to Matter over Bluetooth LE.
CONFIG_CHIP_LAST_FABRIC_REMOVED_ERASE_AND_REBOOT- Remove all saved network credentials and reboot the device. This option is selected by default.
CONFIG_CHIP_FACTORY_RESET_ERASE_NVSKconfig option is also set to
y, the device will also remove all non-volatile data stored on the device, including application-specific entries. This means the device is restored to the factory settings.
To create a delay between the chosen reaction and the last fabric being removed, set the
CONFIG_CHIP_LAST_FABRIC_REMOVED_ACTION_DELAY Kconfig option to a specific time in milliseconds.
By default this Kconfig option is set to 1 second.