Control the group of light bulbs

Dear Nordic:

        I used V2.8.0 SDK to build light bulb, and I have commissioned bulb A(node id: 11) and bulb B(node id: 11) successfully!

        Then I used below command to add two bulbs to group successfully:

              ./chip-tool groups add-group 0x4141 Bulb 11 1
              ./chip-tool groups add-group 0x4141 Bulb 12 1

        Finally, I want to control this group, so I use this command:

               ./chip-tool onoff on 0xffffffffffff4141 1

        But the tool popup error msg, as blow:

user@NB24010009-UB2401:~/Public/PC/CHIP_tool$ ./chip-tool onoff on 0xffffffffffff4141 1
[1747107598.917] [20847:20847] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_tool_kvs
[1747107598.918] [20847:20847] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_kvs
[1747107598.918] [20847:20847] [DL] ChipLinuxStorage::Init: Attempt to re-initialize with KVS config file: /tmp/chip_kvs
[1747107598.919] [20847:20847] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_factory.ini
[1747107598.919] [20847:20847] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_config.ini
[1747107598.919] [20847:20847] [DL] ChipLinuxStorage::Init: Using KVS config file: /tmp/chip_counters.ini
[1747107598.919] [20847:20847] [DL] wrote settings to /tmp/chip_counters.ini
[1747107598.919] [20847:20847] [DL] NVS set: chip-counters/reboot-count = 214 (0xD6)
[1747107598.919] [20847:20847] [DL] Got Ethernet interface: enp0s31f6
[1747107598.919] [20847:20847] [DL] Found the primary Ethernet interface:enp0s31f6
[1747107598.919] [20847:20847] [DL] Got WiFi interface: wlp0s20f3
[1747107598.920] [20847:20847] [DL] Found the primary WiFi interface:wlp0s20f3
[1747107598.920] [20847:20847] [IN] UDP::Init bind&listen port=0
[1747107598.920] [20847:20847] [IN] UDP::Init bound to port=36849
[1747107598.920] [20847:20847] [IN] UDP::Init bind&listen port=0
[1747107598.920] [20847:20847] [IN] UDP::Init bound to port=48168
[1747107598.920] [20847:20847] [IN] BLEBase::Init - setting/overriding transport
[1747107598.920] [20847:20847] [IN] TransportMgr initialized
[1747107598.920] [20847:20847] [FP] Initializing FabricTable from persistent storage
[1747107598.920] [20847:20847] [TS] Last Known Good Time: 2023-10-14T01:16:48
[1747107598.920] [20847:20847] [FP] Fabric index 0x1 was retrieved from storage. Compressed FabricId 0xDCA3061115C193DE, FabricId 0x0000000000000001, NodeId 0x000000000001B669, VendorId 0xFFF1
[1747107598.926] [20847:20847] [ZCL] Using ZAP configuration...
[1747107598.926] [20847:20847] [DIS] GlobalMinimalMdnsServer::StartServer port(5353)
[1747107598.926] [20847:20847] [DIS] listenUdp Bind: addressType(1), port(5353), interfaceId(3)
[1747107598.926] [20847:20847] [DIS] listenUdp Listen
[1747107598.927] [20847:20847] [DIS] listenUdp Bind: addressType(2), port(5353), interfaceId(3)
[1747107598.927] [20847:20847] [DIS] listenUdp Listen
[1747107598.927] [20847:20847] [CTL] System State Initialized...
[1747107598.927] [20847:20847] [CTL] Setting attestation nonce to random value
[1747107598.927] [20847:20847] [CTL] Setting CSR nonce to random value
[1747107598.927] [20847:20847] [IN] UDP::Init bind&listen port=5550
[1747107598.927] [20847:20847] [IN] UDP::Init bound to port=5550
[1747107598.927] [20847:20847] [IN] UDP::Init bind&listen port=5550
[1747107598.927] [20847:20847] [IN] UDP::Init bound to port=5550
[1747107598.927] [20847:20847] [IN] TransportMgr initialized
[1747107598.927] [20847:20849] [DL] CHIP task running
[1747107598.927] [20847:20849] [DL] HandlePlatformSpecificBLEEvent 32786
[1747107598.927] [20847:20849] [CTL] Setting attestation nonce to random value
[1747107598.927] [20847:20849] [CTL] Setting CSR nonce to random value
[1747107598.927] [20847:20849] [CTL] Generating NOC
[1747107598.927] [20847:20849] [FP] Validating NOC chain
[1747107598.928] [20847:20849] [FP] NOC chain validation successful
[1747107598.928] [20847:20849] [FP] Updated fabric at index: 0x1, Node ID: 0x000000000001B669
[1747107598.928] [20847:20849] [TS] Last Known Good Time: 2023-10-14T01:16:48
[1747107598.928] [20847:20849] [TS] New proposed Last Known Good Time: 2021-01-01T00:00:00
[1747107598.928] [20847:20849] [TS] Retaining current Last Known Good Time
[1747107598.928] [20847:20849] [FP] Metadata for Fabric 0x1 persisted to storage.
[1747107598.928] [20847:20849] [TS] Committing Last Known Good Time to storage: 2023-10-14T01:16:48
[1747107598.929] [20847:20849] [CTL] Joined the fabric at index 1. Fabric ID is 0x0000000000000001 (Compressed Fabric ID: DCA3061115C193DE)
[1747107598.929] [20847:20849] [IN] UDP::Init bind&listen port=5550
[1747107598.929] [20847:20849] [IN] UDP::Init bound to port=5550
[1747107598.929] [20847:20849] [IN] UDP::Init bind&listen port=5550
[1747107598.929] [20847:20849] [IN] UDP::Init bound to port=5550
[1747107598.929] [20847:20849] [IN] TransportMgr initialized
[1747107598.931] [20847:20849] [TOO] Sending command to group 0x4141
[1747107598.931] [20847:20849] [TOO] Sending cluster (0x00000006) command (0x00000001) on Group 16705
[1747107598.931] [20847:20849] [DMG] ICR moving to [AddingComm]
[1747107598.931] [20847:20849] [DMG] ICR moving to [AddedComma]
[1747107598.931] [20847:20847] [CTL] Shutting down the commissioner
[1747107598.931] [20847:20847] [CTL] Shutting down the controller
[1747107598.931] [20847:20847] [IN] Expiring all sessions for fabric 0x1!!
[1747107598.931] [20847:20847] [FP] Forgetting fabric 0x1
[1747107598.931] [20847:20847] [TS] Pending Last Known Good Time: 2023-10-14T01:16:48
[1747107598.931] [20847:20847] [TS] Previous Last Known Good Time: 2023-10-14T01:16:48
[1747107598.931] [20847:20847] [TS] Reverted Last Known Good Time to previous value
[1747107598.931] [20847:20847] [CTL] Shutting down the commissioner
[1747107598.931] [20847:20847] [CTL] Shutting down the controller
[1747107598.931] [20847:20847] [CTL] Shutting down the System State, this will teardown the CHIP Stack
[1747107598.931] [20847:20847] [DMG] All ReadHandler-s are clean, clear GlobalDirtySet
[1747107598.931] [20847:20847] [FP] Shutting down FabricTable
[1747107598.931] [20847:20847] [TS] Pending Last Known Good Time: 2023-10-14T01:16:48
[1747107598.931] [20847:20847] [TS] Previous Last Known Good Time: 2023-10-14T01:16:48
[1747107598.931] [20847:20847] [TS] Reverted Last Known Good Time to previous value
[1747107598.932] [20847:20847] [DL] wrote settings to /tmp/chip_counters.ini
[1747107598.932] [20847:20847] [DL] NVS set: chip-counters/total-operational-hours = 0 (0x0)
[1747107598.932] [20847:20847] [DL] Inet Layer shutdown
[1747107598.932] [20847:20847] [DL] BLE Layer shutdown
[1747107598.932] [20847:20847] [DL] System Layer shutdown
[1747107598.932] [20847:20847] [TOO] Run command failure: src/transport/SessionManager.cpp:257: CHIP Error 0x000000AC: Internal error

        Is there anything wrong, and how can I fix this issue?

BR

Chuan

Parents
  • Hi Chuan,

    Can you share the log from chip-tool when you add the devices to the group with add-group?

    Best regards,
    Marte

  • ./chip-tool onoff on 0xffffffffffff4141 1

    log as below:

    [1747303654.661457][29067:29067] CHIP:DL: ChipLinuxStorage::Init: Attempt to re-initialize with KVS config file: /tmp/chip_kvs
    [1747303654.661592][29067:29067] CHIP:DL: writing settings to file (/tmp/chip_counters.ini-mv8snL)
    [1747303654.661672][29067:29067] CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini)
    [1747303654.661676][29067:29067] CHIP:DL: NVS set: chip-counters/reboot-count = 251 (0xFB)
    [1747303654.661865][29067:29067] CHIP:DL: Got Ethernet interface: enp0s31f6
    [1747303654.662002][29067:29067] CHIP:DL: Found the primary Ethernet interface:enp0s31f6
    [1747303654.662172][29067:29067] CHIP:DL: Got WiFi interface: wlp0s20f3
    [1747303654.662187][29067:29067] CHIP:DL: Failed to reset WiFi statistic counts
    [1747303654.662240][29067:29067] CHIP:TS: Last Known Good Time: 2023-10-14T01:16:48
    [1747303654.662316][29067:29067] CHIP:FP: Fabric index 0x1 was retrieved from storage. Compressed FabricId 0xDCA3061115C193DE, FabricId 0x0000000000000001, NodeId 0x000000000001B669, VendorId 0xFFF1
    [1747303654.668677][29067:29067] CHIP:ZCL: Using ZAP configuration...
    [1747303654.670500][29067:29067] CHIP:DL: Avahi client registered
    [1747303654.670571][29067:29067] CHIP:CTL: Setting attestation nonce to random value
    [1747303654.670575][29067:29067] CHIP:CTL: Setting CSR nonce to random value
    [1747303654.670803][29067:29070] CHIP:CTL: Setting attestation nonce to random value
    [1747303654.670810][29067:29070] CHIP:CTL: Setting CSR nonce to random value
    [1747303654.673130][29067:29070] CHIP:CTL: Generating NOC
    [1747303654.675581][29067:29070] CHIP:FP: Validating NOC chain
    [1747303654.683345][29067:29070] CHIP:FP: NOC chain validation successful
    [1747303654.683364][29067:29070] CHIP:FP: Updated fabric at index: 0x1, Node ID: 0x000000000001B669
    [1747303654.683368][29067:29070] CHIP:TS: Last Known Good Time: 2023-10-14T01:16:48
    [1747303654.683369][29067:29070] CHIP:TS: New proposed Last Known Good Time: 2021-01-01T00:00:00
    [1747303654.683370][29067:29070] CHIP:TS: Retaining current Last Known Good Time
    [1747303654.683814][29067:29070] CHIP:FP: Metadata for Fabric 0x1 persisted to storage.
    [1747303654.683920][29067:29070] CHIP:TS: Committing Last Known Good Time to storage: 2023-10-14T01:16:48
    [1747303654.684013][29067:29070] CHIP:CTL: Joined the fabric at index 1. Fabric ID is 0x0000000000000001 (Compressed Fabric ID: DCA3061115C193DE)
    [1747303654.685111][29067:29070] CHIP:TOO: Sending command to group 0x4141
    [1747303654.685116][29067:29070] CHIP:TOO: Sending cluster (0x00000006) command (0x00000001) on Group 16705
    [1747303654.685343][29067:29067] CHIP:FP: Forgetting fabric 0x1
    [1747303654.685352][29067:29067] CHIP:TS: Pending Last Known Good Time: 2023-10-14T01:16:48
    [1747303654.685380][29067:29067] CHIP:TS: Previous Last Known Good Time: 2023-10-14T01:16:48
    [1747303654.685383][29067:29067] CHIP:TS: Reverted Last Known Good Time to previous value
    [1747303654.685448][29067:29067] CHIP:FP: Shutting down FabricTable
    [1747303654.685452][29067:29067] CHIP:TS: Pending Last Known Good Time: 2023-10-14T01:16:48
    [1747303654.685468][29067:29067] CHIP:TS: Previous Last Known Good Time: 2023-10-14T01:16:48
    [1747303654.685470][29067:29067] CHIP:TS: Reverted Last Known Good Time to previous value
    [1747303654.685524][29067:29067] CHIP:DL: writing settings to file (/tmp/chip_counters.ini-liUIvZ)
    [1747303654.685668][29067:29067] CHIP:DL: renamed tmp file to file (/tmp/chip_counters.ini)
    [1747303654.685691][29067:29067] CHIP:DL: NVS set: chip-counters/total-operational-hours = 0 (0x0)
    [1747303654.685694][29067:29067] CHIP:DL: Inet Layer shutdown
    [1747303654.685696][29067:29067] CHIP:DL: BLE shutdown
    [1747303654.685725][29067:29067] CHIP:DL: System Layer shutdown
    [1747303654.685778][29067:29067] CHIP:TOO: Run command failure: src/transport/SessionManager.cpp:238: CHIP Error 0x000000AC: Internal error
    

  • Hi,

    You get status 126 in the response to the add group command:

    Endpoint: 1 Cluster: 0x0000_0004 Command 0x0000_0000
      AddGroupResponse: {
        status: 126
        groupID: 16705
       }

    Status 126 is UNSUPPORTED_ACCESS. According to the specification, this is the status if the node requires security material to support the group ID, but the material does not exist. In other words, you need to add a group key to the devices. You will also need to add access control.

    I am using 0x01a1 as the group key set ID and 0x4141 as the group ID here.

    So, first, you must configure the key set for the group:

    ./chip-tool groupkeymanagement key-set-write '{"groupKeySetID": "0x01a1", "groupKeySecurityPolicy": 0, "epochKey0":"a0a1a2a3a4a5a6a7a8a9aaabacadaeaf", "epochStartTime0": 1110000, "epochKey1":"b0b1b2b3b4b5b6b7b8b9babbbcbdbebf", "epochStartTime1": 1110001, "epochKey2":"c0c1c2c3c4c5c6c7c8c9cacbcccdcecf", "epochStartTime2": 1110002 }' <light_bulb_node_id> 0

    The,n you must write to the GroupKeyMap attribute to associate the group key set ID with the group ID:

    ./groupkeymanagement write group-key-map '[{"fabricIndex": 0, "groupId": "0x4141", "groupKeySetID": "0x01a1"}]' <light_bulb_node_id> 0

    After you have done this, you can add the light bulbs to the group:

    ./chip-tool groups add-group 0x4141 Bulb <light_bulb_node_id> 1

    Since you have configured the security material, the status in the add group response should be 0, not 126.

    After this, you must configure the access control. This uses decimal value instead of hexadecimal, so the group ID is 16705 (0x4141):

    ./chip-tool accesscontrol write acl '[{"fabricIndex": 1, "privilege": 5, "authMode": 2, "subjects": null, "targets": null },{"fabricIndex": 1, "privilege": 3, "authMode": 3, "subjects": [16705], "targets": null }]' <light_bulb_node_id> 0

    After you have done this for both bulbs, you can control them using groupcast:

    ./chip-tool onoff on 0xffffffffffff4141 1

    Best regards,
    Marte

  •   

             Great, thanks for your prompt reply!

             I'll try your solution later.

    BR

    Chuan

Reply Children
No Data
Related