How can use CHIP tool to commission device by QR code or manual pairing code?

 

        This is my basic information:

        1. SDK version: V2.8.0

        2. Project: Matter Light Bulb

        3. Board: 52840DK

        This is my question:

        I can use this command to commission bulb pass:

        $ ./chip-tool pairing ble-thread <node_id> hex:<operational_dataset> <pin_code> <discriminator>

        But when I use below command instead, bulb has no response:

        $ ./chip-tool pairing code <node_id> <qrcode_payload-or-manual_code>

Parents
  • This is CHIP log:

    ubuntu@ubunbtu:~/apps$ ./chip-tool pairing code 5 34970112332
    [1758015816.420] [14688:14688] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_tool_kvs
    [1758015816.421] [14688:14688] [DL] ChipLinuxStorage::Init: Attempt to re-initialize with KVS config file: /tmp/chip_kvs
    [1758015816.427] [14688:14688] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_factory.ini
    [1758015816.427] [14688:14688] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_config.ini
    [1758015816.427] [14688:14688] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_counters.ini
    [1758015816.434] [14688:14688] [DL] Wrote settings to /tmp/chip_counters.ini
    [1758015816.434] [14688:14688] [DL] NVS set: chip-counters/reboot-count = 6 (0x6)
    [1758015816.435] [14688:14688] [DL] Got Ethernet interface: eth0
    [1758015816.435] [14688:14688] [DL] Found the primary Ethernet interface:eth0
    [1758015816.436] [14688:14688] [DL] Got WiFi interface: wlan0
    [1758015816.436] [14688:14688] [DL] Failed to reset WiFi statistic counts
    [1758015816.436] [14688:14688] [IN] UDP::Init bind&listen port=0
    [1758015816.436] [14688:14688] [IN] UDP::Init bound to port=45590
    [1758015816.436] [14688:14688] [IN] BLEBase::Init - setting/overriding transport
    [1758015816.436] [14688:14688] [IN] TransportMgr initialized
    [1758015816.436] [14688:14688] [FP] Initializing FabricTable from persistent storage
    [1758015816.436] [14688:14688] [TS] Last Known Good Time: 2023-10-14T01:16:48
    [1758015816.438] [14688:14688] [FP] Fabric index 0x1 was retrieved from storage. Compressed FabricId 0x4CBEDD0E38A1813B, FabricId 0x0000000000000001, NodeId 0x000000000001B669, VendorId 0xFFF1
    [1758015816.440] [14688:14688] [ZCL] Using ZAP configuration...
    [1758015816.446] [14688:14688] [DL] Avahi client registered
    [1758015816.446] [14688:14688] [IM] WARNING ┌────────────────────────────────────────────────────
    [1758015816.446] [14688:14688] [IM] WARNING │ Interaction Model Engine running in 'Checked' mode.
    [1758015816.446] [14688:14688] [IM] WARNING │ This executes BOTH ember and data-model code paths.
    [1758015816.447] [14688:14688] [IM] WARNING │ which is inefficient and consumes more flash space.
    [1758015816.447] [14688:14688] [IM] WARNING │ This should be done for testing only.
    [1758015816.447] [14688:14688] [IM] WARNING └────────────────────────────────────────────────────
    [1758015816.447] [14688:14688] [CTL] System State Initialized...
    [1758015816.447] [14688:14688] [CTL] Setting attestation nonce to random value
    [1758015816.447] [14688:14688] [CTL] Setting CSR nonce to random value
    [1758015816.447] [14688:14688] [IN] UDP::Init bind&listen port=5550
    [1758015816.448] [14688:14688] [IN] UDP::Init bound to port=5550
    [1758015816.448] [14688:14688] [IN] TransportMgr initialized
    [1758015816.448] [14688:14690] [DL] CHIP task running
    [1758015816.448] [14688:14690] [DL] HandlePlatformSpecificBLEEvent 32786
    [1758015816.449] [14688:14690] [CTL] Setting attestation nonce to random value
    [1758015816.449] [14688:14690] [CTL] Setting CSR nonce to random value
    [1758015816.450] [14688:14690] [CTL] Generating NOC
    [1758015816.451] [14688:14690] [FP] Validating NOC chain
    [1758015816.454] [14688:14690] [FP] NOC chain validation successful
    [1758015816.454] [14688:14690] [FP] Updated fabric at index: 0x1, Node ID: 0x000000000001B669
    [1758015816.454] [14688:14690] [TS] Last Known Good Time: 2023-10-14T01:16:48
    [1758015816.454] [14688:14690] [TS] New proposed Last Known Good Time: 2021-01-01T00:00:00
    [1758015816.454] [14688:14690] [TS] Retaining current Last Known Good Time
    [1758015816.457] [14688:14690] [FP] Metadata for Fabric 0x1 persisted to storage.
    [1758015816.458] [14688:14690] [TS] Committing Last Known Good Time to storage: 2023-10-14T01:16:48
    [1758015816.460] [14688:14690] [CTL] Joined the fabric at index 1. Fabric ID is 0x0000000000000001 (Compressed Fabric ID: 4CBEDD0E38A1813B)
    [1758015816.460] [14688:14690] [IN] UDP::Init bind&listen port=5550
    [1758015816.460] [14688:14690] [IN] UDP::Init bound to port=5550
    [1758015816.460] [14688:14690] [IN] TransportMgr initialized
    [1758015816.475] [14688:14690] [CTL] Setting attestation nonce to random value
    [1758015816.475] [14688:14690] [CTL] Setting CSR nonce to random value
    [1758015816.476] [14688:14690] [CTL] Stopping commissioning discovery over DNS-SD
    [1758015816.476] [14688:14690] [CTL] Starting commissioning discovery over DNS-SD
    [1758015816.487] [14688:14690] [DL] Avahi browse: cache exhausted
    [1758015817.491] [14688:14690] [DL] Avahi browse: all for now
    [1758015846.505] [14688:14690] [CTL] Discovery timed out
    [1758015846.505] [14688:14690] [CTL] Stopping commissioning discovery over DNS-SD
    [1758015846.505] [14688:14690] [TOO] Secure Pairing Failed
    [1758015846.506] [14688:14688] [CTL] Shutting down the commissioner
    [1758015846.506] [14688:14688] [CTL] Stopping commissioning discovery over DNS-SD
    [1758015846.506] [14688:14688] [CTL] Shutting down the controller
    [1758015846.506] [14688:14688] [IN] Expiring all sessions for fabric 0x1!!
    [1758015846.506] [14688:14688] [FP] Forgetting fabric 0x1
    [1758015846.506] [14688:14688] [TS] Pending Last Known Good Time: 2023-10-14T01:16:48
    [1758015846.507] [14688:14688] [TS] Previous Last Known Good Time: 2023-10-14T01:16:48
    [1758015846.507] [14688:14688] [TS] Reverted Last Known Good Time to previous value
    [1758015846.507] [14688:14688] [CTL] Shutting down the commissioner
    [1758015846.507] [14688:14688] [CTL] Shutting down the controller
    [1758015846.507] [14688:14688] [CTL] Shutting down the System State, this will teardown the CHIP Stack
    [1758015846.507] [14688:14688] [DMG] All ReadHandler-s are clean, clear GlobalDirtySet
    [1758015846.508] [14688:14688] [FP] Shutting down FabricTable
    [1758015846.508] [14688:14688] [TS] Pending Last Known Good Time: 2023-10-14T01:16:48
    [1758015846.508] [14688:14688] [TS] Previous Last Known Good Time: 2023-10-14T01:16:48
    [1758015846.508] [14688:14688] [TS] Reverted Last Known Good Time to previous value
    [1758015846.515] [14688:14688] [DL] Wrote settings to /tmp/chip_counters.ini
    [1758015846.515] [14688:14688] [DL] NVS set: chip-counters/total-operational-hours = 0 (0x0)
    [1758015846.515] [14688:14688] [DL] Inet Layer shutdown
    [1758015846.515] [14688:14688] [DL] BLE Layer shutdown
    [1758015846.515] [14688:14688] [DL] System Layer shutdown
    [1758015846.516] [14688:14688] [TOO] Run command failure: ../../examples/chip-tool/commands/pairing/PairingCommand.cpp:372: CHIP Error 0x00000003: Incorrect state

Reply
  • This is CHIP log:

    ubuntu@ubunbtu:~/apps$ ./chip-tool pairing code 5 34970112332
    [1758015816.420] [14688:14688] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_tool_kvs
    [1758015816.421] [14688:14688] [DL] ChipLinuxStorage::Init: Attempt to re-initialize with KVS config file: /tmp/chip_kvs
    [1758015816.427] [14688:14688] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_factory.ini
    [1758015816.427] [14688:14688] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_config.ini
    [1758015816.427] [14688:14688] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_counters.ini
    [1758015816.434] [14688:14688] [DL] Wrote settings to /tmp/chip_counters.ini
    [1758015816.434] [14688:14688] [DL] NVS set: chip-counters/reboot-count = 6 (0x6)
    [1758015816.435] [14688:14688] [DL] Got Ethernet interface: eth0
    [1758015816.435] [14688:14688] [DL] Found the primary Ethernet interface:eth0
    [1758015816.436] [14688:14688] [DL] Got WiFi interface: wlan0
    [1758015816.436] [14688:14688] [DL] Failed to reset WiFi statistic counts
    [1758015816.436] [14688:14688] [IN] UDP::Init bind&listen port=0
    [1758015816.436] [14688:14688] [IN] UDP::Init bound to port=45590
    [1758015816.436] [14688:14688] [IN] BLEBase::Init - setting/overriding transport
    [1758015816.436] [14688:14688] [IN] TransportMgr initialized
    [1758015816.436] [14688:14688] [FP] Initializing FabricTable from persistent storage
    [1758015816.436] [14688:14688] [TS] Last Known Good Time: 2023-10-14T01:16:48
    [1758015816.438] [14688:14688] [FP] Fabric index 0x1 was retrieved from storage. Compressed FabricId 0x4CBEDD0E38A1813B, FabricId 0x0000000000000001, NodeId 0x000000000001B669, VendorId 0xFFF1
    [1758015816.440] [14688:14688] [ZCL] Using ZAP configuration...
    [1758015816.446] [14688:14688] [DL] Avahi client registered
    [1758015816.446] [14688:14688] [IM] WARNING ┌────────────────────────────────────────────────────
    [1758015816.446] [14688:14688] [IM] WARNING │ Interaction Model Engine running in 'Checked' mode.
    [1758015816.446] [14688:14688] [IM] WARNING │ This executes BOTH ember and data-model code paths.
    [1758015816.447] [14688:14688] [IM] WARNING │ which is inefficient and consumes more flash space.
    [1758015816.447] [14688:14688] [IM] WARNING │ This should be done for testing only.
    [1758015816.447] [14688:14688] [IM] WARNING └────────────────────────────────────────────────────
    [1758015816.447] [14688:14688] [CTL] System State Initialized...
    [1758015816.447] [14688:14688] [CTL] Setting attestation nonce to random value
    [1758015816.447] [14688:14688] [CTL] Setting CSR nonce to random value
    [1758015816.447] [14688:14688] [IN] UDP::Init bind&listen port=5550
    [1758015816.448] [14688:14688] [IN] UDP::Init bound to port=5550
    [1758015816.448] [14688:14688] [IN] TransportMgr initialized
    [1758015816.448] [14688:14690] [DL] CHIP task running
    [1758015816.448] [14688:14690] [DL] HandlePlatformSpecificBLEEvent 32786
    [1758015816.449] [14688:14690] [CTL] Setting attestation nonce to random value
    [1758015816.449] [14688:14690] [CTL] Setting CSR nonce to random value
    [1758015816.450] [14688:14690] [CTL] Generating NOC
    [1758015816.451] [14688:14690] [FP] Validating NOC chain
    [1758015816.454] [14688:14690] [FP] NOC chain validation successful
    [1758015816.454] [14688:14690] [FP] Updated fabric at index: 0x1, Node ID: 0x000000000001B669
    [1758015816.454] [14688:14690] [TS] Last Known Good Time: 2023-10-14T01:16:48
    [1758015816.454] [14688:14690] [TS] New proposed Last Known Good Time: 2021-01-01T00:00:00
    [1758015816.454] [14688:14690] [TS] Retaining current Last Known Good Time
    [1758015816.457] [14688:14690] [FP] Metadata for Fabric 0x1 persisted to storage.
    [1758015816.458] [14688:14690] [TS] Committing Last Known Good Time to storage: 2023-10-14T01:16:48
    [1758015816.460] [14688:14690] [CTL] Joined the fabric at index 1. Fabric ID is 0x0000000000000001 (Compressed Fabric ID: 4CBEDD0E38A1813B)
    [1758015816.460] [14688:14690] [IN] UDP::Init bind&listen port=5550
    [1758015816.460] [14688:14690] [IN] UDP::Init bound to port=5550
    [1758015816.460] [14688:14690] [IN] TransportMgr initialized
    [1758015816.475] [14688:14690] [CTL] Setting attestation nonce to random value
    [1758015816.475] [14688:14690] [CTL] Setting CSR nonce to random value
    [1758015816.476] [14688:14690] [CTL] Stopping commissioning discovery over DNS-SD
    [1758015816.476] [14688:14690] [CTL] Starting commissioning discovery over DNS-SD
    [1758015816.487] [14688:14690] [DL] Avahi browse: cache exhausted
    [1758015817.491] [14688:14690] [DL] Avahi browse: all for now
    [1758015846.505] [14688:14690] [CTL] Discovery timed out
    [1758015846.505] [14688:14690] [CTL] Stopping commissioning discovery over DNS-SD
    [1758015846.505] [14688:14690] [TOO] Secure Pairing Failed
    [1758015846.506] [14688:14688] [CTL] Shutting down the commissioner
    [1758015846.506] [14688:14688] [CTL] Stopping commissioning discovery over DNS-SD
    [1758015846.506] [14688:14688] [CTL] Shutting down the controller
    [1758015846.506] [14688:14688] [IN] Expiring all sessions for fabric 0x1!!
    [1758015846.506] [14688:14688] [FP] Forgetting fabric 0x1
    [1758015846.506] [14688:14688] [TS] Pending Last Known Good Time: 2023-10-14T01:16:48
    [1758015846.507] [14688:14688] [TS] Previous Last Known Good Time: 2023-10-14T01:16:48
    [1758015846.507] [14688:14688] [TS] Reverted Last Known Good Time to previous value
    [1758015846.507] [14688:14688] [CTL] Shutting down the commissioner
    [1758015846.507] [14688:14688] [CTL] Shutting down the controller
    [1758015846.507] [14688:14688] [CTL] Shutting down the System State, this will teardown the CHIP Stack
    [1758015846.507] [14688:14688] [DMG] All ReadHandler-s are clean, clear GlobalDirtySet
    [1758015846.508] [14688:14688] [FP] Shutting down FabricTable
    [1758015846.508] [14688:14688] [TS] Pending Last Known Good Time: 2023-10-14T01:16:48
    [1758015846.508] [14688:14688] [TS] Previous Last Known Good Time: 2023-10-14T01:16:48
    [1758015846.508] [14688:14688] [TS] Reverted Last Known Good Time to previous value
    [1758015846.515] [14688:14688] [DL] Wrote settings to /tmp/chip_counters.ini
    [1758015846.515] [14688:14688] [DL] NVS set: chip-counters/total-operational-hours = 0 (0x0)
    [1758015846.515] [14688:14688] [DL] Inet Layer shutdown
    [1758015846.515] [14688:14688] [DL] BLE Layer shutdown
    [1758015846.515] [14688:14688] [DL] System Layer shutdown
    [1758015846.516] [14688:14688] [TOO] Run command failure: ../../examples/chip-tool/commands/pairing/PairingCommand.cpp:372: CHIP Error 0x00000003: Incorrect state

Children
No Data
Related