Adding clusters to Matter application Example

Hello Nordic team,

I followed the official guide to add a custom sensor cluster to my Matter application. Everything built and flashed successfully, and the application advertises correctly via BLE. However, I am facing issues when attempting to pair the device with both Apple Home and Google Home.

  • Apple Home: The device is detected, and after pressing the "Add anyway" button on the warning for an unverified device, the pairing process fails with the message:

    • "Device cannot be added"
    • "Failed to pair with the device"
  • Google Home: The pairing process fails with the message:

    • "Pairing Failed."

Apple Home Connection Log:
 

D: 112754 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 244)
D: 112824 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 112832 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 244)
D: 112944 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 112952 [DL]Sending indication for CHD: 113064 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 113072 [DL]Write request received for CHIPoBLE RX characteristic (ConnId 0x00)
I: 113081 [EM]>>> [E:52586r S:18000 M:149919918] (S) Msg RX from 0:FFFFFFFB00000000 [0000] --- Type 0001:08 (IM:InvokeCommandRequest)
I: 113093 [ZCL]OpCreds: Received an AttestationRequest command
I: 113127 [ZCL]OpCreds: AttestationRequest successful.
I: 113136 [EM]<<< [E:52586r S:18000 M:185040772] (S) Msg TX to 0:FFFFFFFB00000000 [0000] [BLE] --- Type 0001:09 (IM:InvokeCommandResponse)
D: 113148 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 244)
D: 113244 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 113252 [DL]Sending indication for CHD: 113364 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 113372 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 237)
D: 113484 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 113492 [DL]Write request received for CHIPoBLE RX characteristic (ConnId 0x00)
I: 113500 [EM]>>> [E:52587r S:18000 M:149919919] (S) Msg RX from 0:FFFFFFFB00000000 [0000] --- Type 0001:08 (IM:InvokeCommandRequest)
I: 113513 [FS]GeneralCommissioning: Received ArmFailSafe (60s)
I: 113520 [EM]<<< [E:52587r S:18000 M:185040773] (S) Msg TX to 0:FFFFFFFB00000000 [0000] [BLE] --- Type 0001:09 (IM:InvokeCommandResponse)
D: 113532 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 71)
D: 113604 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 116064 [DL]Write request received for CHIPoBLE RX characteristic (ConnId 0x00)
D: 117085 [DL]Write request received for CHIPoBLE RX characteristic (ConnId 0x00)
I: 117093 [EM]>>> [E:52588r S:18000 M:1499199FFB00000000 [0000] --- Type 0001:08 (IM:InvokeCommandRequest)
I: 117106 [ZCL]OpCreds: Received a CSRRequest command
I: 117167 [ZCL]OpCreds: AllocatePendingOperationalKey succeeded
I: 117201 [ZCL]OpCreds: CSRRequest successful.
I: 117208 [EM]<<< [E:52588r S:18000 M:185040774] (S) Msg TX to 0:FFFFFFFB00000000 [0000] [BLE] --- Type 0001:09 (IM:InvokeCommandResponse)
D: 117220 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 244)
E: 117228 [DL]Long dispatch time: 143 ms, for event D: 117324 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 117332 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 156)
D: 117444 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 117452 [DL]Write request received fom 0:FFFFFFFB00000000 [0000] --- Type 0001:08 (IM:InvokeCommandRequest)
I: 117473 [FS]GeneralCommissioning: Received ArmFailSafe (0s)
I: 117478 [FS]Fail-safe timer expired
I: 117483 [EM]<<< [E:52589r S:18000 M:185040775] (S) Msg TX to 0:FFFFFFFB00000000 [0000] [BLE] --- Type 0001:09 (IM:InvokeCommandResponse)
D: 117495 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 71)
E: 117503 [SVR]Failsafe timer expired
D: 117506 [IN]SecureSession[0x20004680]: MarkForEviction Type:1 LSID:18000
I: 117513 [SC]SecureSession[0x20004680, LSID:18000]: State change 'kActive' --> 'kPendingEviction'
D: 117522 [IN]SecureSession[0xation.
I: 117543 [DL]Closing BLE GATT connection (ConnId 00)
D: 117549 [IN]SecureSession[0x20004680]: Allocated Type:1 LSID:18002
D: 117555 [DL]CHIPoBLE advertising set to on
I: 117559 [DIS]Updating services using commissioning mode 1
E: 117565 [DIS]Failed to remove advertised services: 3
D: 117570 [DL]Using Thread extended MAC for hostname.
I: 117574 [DIS]Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 cp=0
E: 117584 [DIS]Failed to advertise commissionable node: 3
E: 117589 [DIS]Failed to finalize service update: 3
E: 117594 [ZCL]OpCreds: Got FailSafeTimerExpired
E: 117598 [ZCL]2023-10-14T01:16:48
I: 117619 [TS]Reverted Last Known Good Time to previous value
E: 117626 [DL]Long dispatch time: 122 ms, for event type 32784
I: 117631 [FS]Fail-safe cleanly disarmed
D: 117635 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x0e)
E: 117642 [BLE]no endpoint for BLE sent data ack
I: 117647 [DL]Current number of connections: 0/1
I: 117651 [DL]BLE GAP connection terminated (reason 0x13)
I: 117660 [DL]CHIPoBLE advertising started 

Google Home Connection  Log:

D: 460076 [IM]Received Read request
I: 460083 [EM]<<< [E:52601r S:18002 M:191897857] (S) Msg TX to 0:FFFFFFFB00000000 [0000] [BLE] --- Type 0001:05 (IM:ReportData)
D: 460094 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 185)
D: 460169 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 460177 [DL]Write request received for CHIPoBLE RX characteristic (ConnId 0x00)
I: 460185 [EM]>>> [E:52602r S:1800<<< [E:52602r S:18002 M:191897858] (S) Msg TX to 0:FFFFFFFB00000000 [0000] [BLE] --- Type 0001:09 (IM:InvokeCommandResponse)
D: 460216 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 71)
D: 460289 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 460297 [DL]Write request received for CHIPoBLE RX characteristic (ConnId 0x00)
I: 460305 [EM]>>> [E:52603r S:18002 M:9046977] (S) Msg RX from 0:FFFFFFFB00000000 [0000] --- Type 0001:08 (IM:InvokeCommandRequest)
I: 460319 [EM]<<< [E:52603r S:18002 M:191897859] (S) Msg TX to 0:FFFFFFFB00000000 [0000] [BLE] --- Type 0001:09 (IM:InvokeCommanD: 460409 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 460417 [DL]Write request received for CHIPoBLE RX characteristic (ConnId 0x00)
I: 460425 [EM]>>> [E:52604r S:18002 M:9046978] (S) Msg RX from 0:FFFFFFFB00000000 [0000] --- Type 0001:08 (IM:InvokeCommandRequest)
I: 460437 [ZCL]OpCreds: Certificate Chain request received for PAI
I: 460446 [EM]<<< [E:52604r S:18002 M:191897860] (S) Msg TX to 0:FFFFFFFB00000000 [0000] [BLE] --- Type 0001:09 (IM:InvokeCommandResponse)
D: 460459 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 244)
D: 460529 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 460536 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 244)
D: 460649 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 460657 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 48)
D: 460769 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 460777 [DL]Write request received fo2605r S:18002 M:9046979] (S) Msg RX from 0:FFFFFFFB00000000 [0000] --- Type 0001:08 (IM:InvokeCommandRequest)
I: 460797 [ZCL]OpCreds: Certificate Chain request received for DAC
I: 460807 [EM]<<< [E:52605r S:18002 M:191897861] (S) Msg TX to 0:FFFFFFFB00000000 [0000] [BLE] --- Type 0001:09 (IM:InvokeCommandResponse)
D: 460819 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 244)
D: 460889 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 460897 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 244)
D: 461009 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 461017 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 78)
D: 461129 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 461137 [DL]Write request received foI: 461145 [EM]>>> [E:52606r S:18002 M:9046980] (S) Msg RX from 0:FFFFFFFB00000000 [0000] --- Type 0001:08 (IM:InvokeCommandRequest)
I: 461157 [ZCL]OpCreds: Received an AttestationRequest command
I: 461191 [ZCL]OpCreds: AttestationRequest successful.
I: 461200 [EM]<<< [E:52606r S:18002 M:191897862] (S) Msg TX to 0:FFFFFFF (ConnId 00, len 244)
D: 461309 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 461317 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 244)
D: 461429 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 461437 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 237)
D: 461549 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 461557 [DL]Write request received for CHIPoBLE RX characteristic (ConnId 0x00)
I: 461565 [I: 461584 [EM]<<< [E:52607r S:18002 M:191897863] (S) Msg TX to 0:FFFFFFFB00000000 [0000] [BLE] --- Type 0001:09 (IM:InvokeCommandResponse)
D: 461596 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 71)
D: 461669 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 462930 [DL]Write request received for CHIPoBLE RX characteristic (ConnId 0x00)
I: 462938 [EM]>>> [E:52608r S:18002 M:9046982] (S) Msg RX from 0:FFFFFFFB00000000 [0000] --- Type 0001:08 (IM:InvokeCommandRequest)
I: 462950 [ZCL]OpCreds: Received a CSRRequest command
I: 463012 [ZCL]OpCreds: AllocatePendingOperationalKey succeeded
I: 463045 [ZCL]OpCreds: CSRRequest successful.
I: 463052 [EM]<<< [E:52608r S:18002 M:191897864] (S) Msg TX to 0:FFFFFFFB00000000 [0000] [BLE] --- Type 0001:09 (IM:InvokeCommandResponse)
D: 463064 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 244)
E: 463072 [DL]Long dispatch time: 142 ms, for event type 16388
D: 463169 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 463177 [DL]Sending indication for CHIPoBLE TX characteristic (ConnId 00, len 156)
D: 463289 [DL]Indication for CHIPoBLE TX characteristic done (ConnId 0x00, result 0x00)
D: 463297 [DL]Write request received for CHIPoBLE RX characteristic (ConnId 0x00)
I: 463305 [EM]>>> [E:52609r S:18002 M:9046983] (S) Msg RX from 0:FFFFFFFB00000000 [0000] --- Type 0001:08 (IM:InvokeCommandRequest)
I: 463317 [FS]GeneralCommissioning: Received ArmFailSafe (0s)
I: 463323 [FS]Fail-safe timer expired
I: 463327 [EM]<<< [E:52609r S:180463347 [SVR]Failsafe timer expired
D: 463351 [IN]SecureSession[0x20004680]: MarkForEviction Type:1 LSID:18002
I: 463358 [SC]SecureSession[0x20004680, LSID:18002]: State change 'kActive' --> 'kPendingEviction'
D: 463366 [IN]SecureSession[0x20004680]: Released - Type:1 LSID:18002
E: 463372 [SVR]Commissioning failed (attempt 2): 32
D: 463377 [IN]Clearing BLE pending packets.
I: 463381 [BLE]Releasing end point's BLE connection back to application.
I: 463387 [DL]Closing BLE GATT connection (ConnId 00)
D: 463393 [IN]SecureSession[0x20004680]: Allocated Type:1 LSID:18003
D: 463399 [DL]CHIPoBLE a
I: 463419 [DIS]Advertise commission parameter vendorID=65521 productID=32768 discriminator=3840/15 cm=1 cp=0
E: 463428 [DIS]Failed to advertise commissionable node: 3
E: 463433 [DIS]Failed to finalize service update: 3
E: 463438 [ZCL]OpCreds: Got FailSafeTimerExpired
E: 463442 [ZCL]OpCreds: Proceeding to FailSafeCleanup on fail-safe expiry!
I: 463452 [TS]Pending Last Known Good Time: 2023-10-14T01:16:48
I: 463458 [TS]Previous Last Known Good Time: 2023-10-14T01:16:48
I: 463464 [TS]Reverted Last Known Good Time to previous value
E: 463470 [DL]Long dispatch time: 123 ms, for e
I: 463491 [DL]Current number of connections: 0/1
I: 463496 [DL]BLE GAP connection terminated (reason 0x13)
I: 463505 [DL]CHIPoBLE advertising started
I: 493508 [DL]CHIPoBLE advertising mode changed to slow
I: 493517 [DL]CHIPoBLE advertising started

I am currently a student working to understand and integrate the Matter Smart Home system into practical applications. This project is a part of my efforts to learn and apply Matter technology effectively. I would greatly appreciate any guidance or suggestions to help resolve these issues and better understand the system.

Thank you for your support!

Additional Information

Related