GeneralCommissioning Cluster

Cluster ID: 0x0030  |  Endpoint: Fixed on Endpoint 0 (Root Endpoint)

GeneralCommissioning is the master control Cluster for the Matter commissioning flow — responsible for managing the entire commissioning lifecycle. It does not handle specific network credentials (that is NetworkCommissioning's job), but rather controls the "start," "progress," and "end" of the commissioning flow, and ensures the device can safely roll back on failure through the Fail-Safe mechanism.

Core Purpose

If the commissioning flow is like a database transaction, GeneralCommissioning is the role responsible for BEGIN / COMMIT / ROLLBACK. ArmFailSafe is equivalent to BEGIN (start transaction), CommissioningComplete is equivalent to COMMIT (commit transaction), and Fail-Safe timeout automatically triggers ROLLBACK (rollback all changes).

Commands

The GeneralCommissioning Cluster has 3 request commands, each with a corresponding response command. These three commands form the backbone of the commissioning flow: first start the safety timer, then set regulatory configuration, and finally submit completion. Click a command ID in the table below to jump to its detailed description.

Client → Server (Request Commands)

ID Name Description Response
0x00 ArmFailSafe Start/renew the Fail-Safe timer ArmFailSafeResponse
0x02 SetRegulatoryConfig Set the device regulatory area configuration SetRegulatoryConfigResponse
0x04 CommissioningComplete Confirm commissioning complete, commit all changes CommissioningCompleteResponse

Server → Client (Response Commands)

ID Name Description Corresponding Request
0x01 ArmFailSafeResponse Return Fail-Safe activation result ArmFailSafe
0x03 SetRegulatoryConfigResponse Return regulatory configuration result SetRegulatoryConfig
0x05 CommissioningCompleteResponse Return commissioning complete result CommissioningComplete

ArmFailSafe — Start Fail-Safe (0x00)

Starts or renews the Fail-Safe timer. This is the first step in the commissioning flow — before any commissioning operation, this must be called to enable safety protection. Once the Fail-Safe timer starts, the device enters a "commissionable" state; if the timer expires before commissioning completes (CommissioningComplete not received), the device will automatically roll back all commissioning changes and restore to its pre-commissioning state.

ParameterTypeDescription
ExpiryLengthSeconds uint16 Fail-Safe timeout in seconds. Set to 0 to immediately cancel the current Fail-Safe (active rollback)
Breadcrumb uint64 Commissioning progress marker, written to the device's Breadcrumb attribute

ArmFailSafeResponse Response Fields

FieldTypeDescription
ErrorCode CommissioningErrorEnum Operation result
DebugText String Optional debug information
Core Constraints of Fail-Safe

ExpiryLengthSeconds cannot exceed BasicCommissioningInfo.MaxCumulativeFailsafeSeconds (typically 900 seconds = 15 minutes). Exceeding this limit returns a ValueOutsideRange error. Additionally, only one Commissioner can hold the Fail-Safe at a time — if another Commissioner is already commissioning, a BusyWithOtherAdmin error is returned.

Usage Scenarios & Notes

The Commissioner (App) calls ArmFailSafe to start the timer at the beginning of commissioning. If the commissioning process takes a long time (e.g., waiting for the user to enter the Wi-Fi password), ArmFailSafe can be called again to renew before timeout. Setting ExpiryLengthSeconds to 0 is the way to actively abandon commissioning — the device will immediately roll back all changes.

SetRegulatoryConfig — Set Regulatory Configuration (0x02)

Set the device's regulatory area (indoor/outdoor) and country code. Different countries and regions have different regulatory requirements for wireless devices (e.g., transmission power, available bands), and the device needs to adjust its wireless parameters based on the regulatory configuration.

ParameterTypeDescription
NewRegulatoryConfig RegulatoryLocationTypeEnum Target regulatory configuration (Indoor / Outdoor / IndoorOutdoor)
CountryCode String (2 characters) ISO 3166-1 alpha-2 country code (e.g., "CN", "US"). "XX" means unspecified
Breadcrumb uint64 Commissioning progress marker

SetRegulatoryConfigResponse Response Fields

FieldTypeDescription
ErrorCode CommissioningErrorEnum Operation result
DebugText String Optional debug information
Regulatory Configuration and Device Capability

The NewRegulatoryConfig setting cannot exceed the device's LocationCapability. For example: if the device's LocationCapability is Indoor (indoor only), you cannot set RegulatoryConfig to Outdoor, or a ValueOutsideRange error is returned. Most consumer devices have LocationCapability set to IndoorOutdoor (unrestricted), so this check rarely fails.

Usage Scenarios & Notes

Called after ArmFailSafe and before CommissioningComplete. Typically the Commissioner automatically obtains the user's geographic location and fills in the corresponding country code. If the location cannot be determined, "XX" can be used to indicate unspecified. Regulatory configuration affects which Wi-Fi channels and transmission power the device can use; incorrect settings may prevent the device from connecting to certain networks.

CommissioningComplete — Complete Commissioning (0x04)

The final step of the commissioning flow. After a successful call, the device will:

  1. Stop the Fail-Safe timer
  2. Permanently save all changes made during commissioning (network credentials, NOC certificates, ACL permissions, etc.)
  3. Reset Breadcrumb to 0

This command has no parameters. Only the Commissioner currently holding the Fail-Safe can call it.

CommissioningCompleteResponse Response Fields

FieldTypeDescription
ErrorCode CommissioningErrorEnum Operation result
DebugText String Optional debug information
Prerequisites

CommissioningComplete must be called while the Fail-Safe is active, and the caller must be the same Commissioner that started the Fail-Safe. If there is no active Fail-Safe, a NoFailSafe error is returned; if called by a different Commissioner, an InvalidAuthentication error is returned.

Usage Scenarios & Notes

After all commissioning steps (network configuration, NOC certificate installation, ACL permission setup, etc.) are complete, send this command to lock in the changes. Once called successfully, the device officially joins the Matter Fabric and can be managed by controllers within the Fabric. If this command fails or is not sent, the device automatically rolls back after the Fail-Safe timeout, restoring everything to its original state.

Attributes

The GeneralCommissioning Cluster has 5 attributes. Click an attribute ID in the summary table below to jump to its detailed description.

ID Name Type Group Description
0x0000 Breadcrumb uint64 Commissioning Tracking Progress marker set by the Commissioner
0x0001 BasicCommissioningInfo struct Basic Commissioning Info Fail-Safe timeout parameters
0x0002 RegulatoryConfig RegulatoryLocationTypeEnum Regulatory Config Current regulatory area configuration
0x0003 LocationCapability RegulatoryLocationTypeEnum Regulatory Config Device's supported regulatory area capability
0x0004 SupportsConcurrentConnection bool Connection Capability Whether concurrent connections are supported during commissioning

Commissioning Tracking (0x0000)

Used by the Commissioner to track the progress of the commissioning flow.

IDNameTypeDescription
0x0000 Breadcrumb
Progress Marker
uint64 Progress tracking value written by the Commissioner through command parameters. Each commissioning command (ArmFailSafe, SetRegulatoryConfig, etc.) includes a Breadcrumb parameter, and the device updates this attribute upon successful execution. The Commissioner can read it to confirm whether the previous command actually took effect. Automatically reset to 0 after commissioning completes (CommissioningComplete)
Practical Use of Breadcrumb

Breadcrumb is a simple but practical "which step has been executed" marker. For example, the Commissioner sets Breadcrumb = 1 during ArmFailSafe, 2 during SetRegulatoryConfig, and 3 when writing network credentials. If commissioning encounters an error mid-way and needs to retry, reading Breadcrumb reveals which step was last executed, allowing resumption from the checkpoint instead of starting over.

Basic Commissioning Info (0x0001)

Describes the device's Fail-Safe time limits, which the Commissioner uses to set reasonable timeout parameters.

IDNameTypeDescription
0x0001 BasicCommissioningInfo
Basic Commissioning Info
struct Contains key Fail-Safe timeout parameters (see structure below)

BasicCommissioningInfo Structure

FieldTypeDescription
FailSafeExpiryLengthSeconds uint16 Default Fail-Safe timeout in seconds. The Commissioner typically uses this value in the ArmFailSafe command
MaxCumulativeFailsafeSeconds uint16 Maximum cumulative Fail-Safe duration. ArmFailSafe's ExpiryLengthSeconds cannot exceed this value, otherwise ValueOutsideRange is returned
Typical Values

Most devices have FailSafeExpiryLengthSeconds of 60 seconds and MaxCumulativeFailsafeSeconds of 900 seconds (15 minutes). This means a single ArmFailSafe can be set to a maximum of 900 seconds. If the commissioning flow needs more time (e.g., waiting for user action), the Commissioner needs to call ArmFailSafe again to renew before timeout, but the total duration cannot exceed 900 seconds.

Regulatory Config (0x0002, 0x0003)

Describes the device's regulatory area configuration and its capability constraints.

IDNameTypeDescription
0x0002 RegulatoryConfig
Current Regulatory Config
RegulatoryLocationTypeEnum The device's current regulatory area setting. Modified via the SetRegulatoryConfig command
0x0003 LocationCapability
Location Capability
RegulatoryLocationTypeEnum The regulatory area range supported by the device hardware. RegulatoryConfig values cannot exceed this capability. Read-only attribute determined by device firmware
Developer Tip

In practice, most consumer Matter devices have LocationCapability set to IndoorOutdoor (2), and correspondingly RegulatoryConfig also defaults to IndoorOutdoor. Only industrial or special-purpose devices are restricted to Indoor-only or Outdoor-only.

Connection Capability (0x0004)

Describes the device's network connection capability during commissioning.

IDNameTypeDescription
0x0004 SupportsConcurrentConnection
Supports Concurrent Connection
bool Whether the device can maintain multiple network connections simultaneously during commissioning. true = device can maintain BLE channel while connecting to Wi-Fi (most devices); false = device disconnects BLE after connecting to Wi-Fi, Commissioner needs to rediscover the device through the Wi-Fi network
Impact of SupportsConcurrentConnection = false

When this attribute is false, the Commissioner loses communication with the device after sending ConnectNetwork. The Commissioner then needs to: (1) Rediscover the device on the target network via mDNS; (2) Establish a CASE secure channel (since the PASE channel has disconnected); (3) Only then can it continue sending CommissioningComplete. This increases the complexity and duration of the commissioning flow.

Enum Definitions

CommissioningErrorEnum

All GeneralCommissioning command responses include this error code to indicate the operation result.

0
OK Operation successful
1
ValueOutsideRange Parameter value outside allowed range (e.g., ExpiryLengthSeconds exceeds limit, or RegulatoryConfig exceeds device capability)
2
InvalidAuthentication Invalid authentication — caller is not the Commissioner that started the Fail-Safe
3
NoFailSafe No active Fail-Safe — attempting CommissioningComplete without calling ArmFailSafe
4
BusyWithOtherAdmin Another Commissioner is currently commissioning — only one Fail-Safe session is allowed at a time
Common Errors Quick Reference

ArmFailSafe returns BusyWithOtherAdmin → Another App or controller is commissioning this device, wait for it to complete or timeout; CommissioningComplete returns NoFailSafe → The Fail-Safe has already timed out and auto-rolled back, the entire commissioning flow needs to restart; SetRegulatoryConfig returns ValueOutsideRange → Check the device's LocationCapability and select a supported area type.

RegulatoryLocationTypeEnum

Identifies the device's regulatory use scenario. Used for the RegulatoryConfig and LocationCapability attributes and the SetRegulatoryConfig command.

0
Indoor Indoor use only — device follows indoor radio regulations (typically less restrictive)
1
Outdoor Outdoor use only — device follows outdoor radio regulations (some bands have stricter restrictions)
2
IndoorOutdoor Both indoor and outdoor — device meets both indoor and outdoor regulatory requirements (most common)

Example Data

Attribute Data Example

The following is typical attribute data for a GeneralCommissioning Cluster of a device currently being commissioned:

{
  // --- Commissioning Tracking ---
  "0x0000": 3,                // Breadcrumb = 3(Progress marker set by the Commissioner)

  // --- Basic Commissioning Info ---
  "0x0001": {                 // BasicCommissioningInfo
    "failSafeExpiryLengthSeconds": 60,    // Fail-Safe default 60 seconds
    "maxCumulativeFailsafeSeconds": 900   // Maximum cumulative 900 seconds (15 minutes)
  },

  // --- Regulatory Config ---
  "0x0002": 2,                // RegulatoryConfig = IndoorOutdoor (current config)
  "0x0003": 2,                // LocationCapability = IndoorOutdoor (device capability)

  // --- Concurrent Connection ---
  "0x0004": true              // SupportsConcurrentConnection = true (supports concurrent connection)
}

ArmFailSafe Interaction Example

Commissioner request and response for starting the Fail-Safe timer:

// Commissioner → Device: Start Fail-Safe timer
{
  "invokeRequests": [{
    "commandPath": {
      "endpointId": 0,
      "clusterId": "0x0030",
      "commandId": "0x00"        // ArmFailSafe
    },
    "commandFields": {
      "expiryLengthSeconds": 60, // 60 second timeout
      "breadcrumb": 1            // Commissioning progress marker
    }
  }]
}

// Device → Commissioner: Confirm Fail-Safe started
{
  "errorCode": 0,               // OK
  "debugText": ""
}

CommissioningComplete Interaction Example

Final confirmation when commissioning completes:

// Commissioner → Device: Complete commissioning
{
  "invokeRequests": [{
    "commandPath": {
      "endpointId": 0,
      "clusterId": "0x0030",
      "commandId": "0x04"        // CommissioningComplete
    },
    "commandFields": {}          // No parameters
  }]
}

// Device → Commissioner: Confirm commissioning complete
{
  "errorCode": 0,               // OK
  "debugText": ""
}
Developer Tip

In practice, Commissioner SDKs (such as Android's chip-tool or iOS's Matter.framework) typically handle the GeneralCommissioning command sequence automatically. App developers rarely need to send these commands manually, but understanding how they work helps troubleshoot commissioning failures.

Common Scenarios

Scenario 1: Standard Commissioning Flow (Normal Path)
  1. Commissioner establishes a PASE secure channel with the device via BLE
  2. Read BasicCommissioningInfo (0x0001) to get Fail-Safe timeout parameters
  3. Send ArmFailSafe (0x00) with ExpiryLengthSeconds = 60, Breadcrumb = 1
  4. Send SetRegulatoryConfig (0x02) to set country code and regulatory area, Breadcrumb = 2
  5. Configure network credentials and connect via NetworkCommissioning (0x0031)
  6. Install NOC certificate (OperationalCredentials Cluster)
  7. Set ACL permissions (AccessControl Cluster)
  8. Send CommissioningComplete (0x04) to commit all changes
  9. Commissioning complete, device officially joins the Fabric

The entire flow typically completes within 30 seconds (excluding user input time).

Scenario 2: Fail-Safe Timeout Rollback
  1. Commissioner sends ArmFailSafe (60 second timeout)
  2. Successfully wrote Wi-Fi credentials
  3. But encountered an error during NOC certificate installation, Commissioner decides to abandon
  4. Commissioner does not send CommissioningComplete
  5. After 60 seconds, the Fail-Safe timer expires
  6. Device automatically rolls back: deletes the just-written Wi-Fi credentials, resets Breadcrumb to 0
  7. Device returns to its pre-commissioning state, ready to restart commissioning

Active rollback is also possible: Send ArmFailSafe(ExpiryLengthSeconds = 0) to trigger an immediate rollback without waiting for the 60-second timeout. This is faster and more courteous than waiting for timeout.

Scenario 3: Regulatory Configuration Handling
  1. Read LocationCapability (0x0003) to confirm supported area types
  2. Determine CountryCode based on the user's region (e.g., China = "CN", US = "US")
  3. Select RegulatoryConfig based on the device's actual use scenario:
    • Smart lights, plugs, sensors → typically IndoorOutdoor (2)
    • Outdoor security cameras → Outdoor (1)
    • Unsure → use IndoorOutdoor (2) (if the device supports it)
  4. Send SetRegulatoryConfig
  5. If ValueOutsideRange is returned, fall back to a value allowed by the device's LocationCapability and retry