Matter Binding

Hi,

Thank you for documentation regarding Matter light bulb and switch examples:
https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/matter/light_bulb/README.html

It works and I am able to make binding between two matter devices ( I am using nRF52840dk boards): light switch and light bulb.

Now I've also added temperature and humidity clusters using ZAP tool, update source code of lighting app example and I was able to read bme680 sensors values:

I: Update sensor data....
I: Temperature value: 23.210000
I: Humidity value: 43.523000
I: Pressure value: 101.882000
D: 3802285 [DMG]Endpoint 1, Cluster 0x0000_0402 update version to 85202d
D: 3802292 [DMG]Endpoint 1, Cluster 0x0000_0405 update version to f2d27d45
D: 3802299 [DMG]Endpoint 1, Cluster 0x0000_0403 update version to 13dbee96

Now the question: How I can bind those values to another matter device, so it will receive immediately when those values are read from sensor? Another matter device will be linux matter client which will display those values.

From lighting switch example I've implemented "BindingHandler" class and I can see that it contains those parameters like 'EndpoinID', 'ClusterID', 'Value' and 'CommandID' . 'Commands' exist in OnOff cluster, but NOT in 'Temperature Measurement' or 'Pressure Measurement' clusters. Is it 'CommandID' required for binding implementation?

Best Regards

Sigitas

Parents
  • Hi Maria,

    Thank you for your time and attention.

    Yes, I am using 'chip-tool' for Linux.

    ```

    chip-tool binding write binding '[{"fabricIndex": 1, "node": 32, "endpoint": 1, "cluster": 6}, {"fabricIndex": 1, "node": 32, "endpoint": 1, "cluster": 1026}]' 52 1

    ```

    where Node `52` has temperaturemeasurement and onoff servers clusters in Endpoint-1. Node `52` runs on nRF5252840dk.

    As I understand <binding data> provides relationship between node `52` and `32` (which is Linux lighting matter application). Node 32 also contains temperaturemeasurement ( cluster Id: 1026) client cluster.  As I mentioned i works fine when I press `On/Off` button on nrf52840dk and I can see response on Linux application (with provided ACL or without), but I can not see any response on Linux application (Node 32) when temperature measurement on Node `52` is been updated.

    You have suggested to use binding cluster with subscribe command, but from chip-tool interface I can not see clearly who is subscriber and who is publisher?

    ```

    chip-tool binding subscribe attr-name min-interval max-interval destination-id endpoint-ids

    ```

    maybe `chip-tool` takes relationship from binding table from node 52?

    In that case <attr-name> should be `binding`, then

    chip-tool binding subscribe binding 3 12 52 1

    and chip-tool output log looks promising:

    [1666353619.706710][16009:16015] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_001E Attribute 0x0000_0000 DataVersion: 1949832449
    [1666353619.706845][16009:16015] CHIP:TOO:   Binding: 2 entries
    [1666353619.707005][16009:16015] CHIP:TOO:     [1]: {
    [1666353619.707068][16009:16015] CHIP:TOO:       Node: 32
    [1666353619.707129][16009:16015] CHIP:TOO:       Endpoint: 1
    [1666353619.707187][16009:16015] CHIP:TOO:       Cluster: 6
    [1666353619.707243][16009:16015] CHIP:TOO:       FabricIndex: 1
    [1666353619.707305][16009:16015] CHIP:TOO:      }
    [1666353619.707380][16009:16015] CHIP:TOO:     [2]: {
    [1666353619.707439][16009:16015] CHIP:TOO:       Node: 32
    [1666353619.707496][16009:16015] CHIP:TOO:       Endpoint: 1
    [1666353619.707553][16009:16015] CHIP:TOO:       Cluster: 1026
    [1666353619.707609][16009:16015] CHIP:TOO:       FabricIndex: 1
    [1666353619.707665][16009:16015] CHIP:TOO:      }
    [1666353619.707806][16009:16015] CHIP:DMG: MoveToState ReadClient[0xffffa000fe00]: Moving to [AwaitingSu]
    [1666353619.708030][16009:16015] CHIP:EM: <<< [E:53914i M:77118786 (Ack:76956936)] (S) Msg TX to 1:0000000000000034 [9287] --- Type 0001:01 (IM:StatusResponse)
    [1666353619.708124][16009:16015] CHIP:IN: (S) Sending msg 77118786 on secure session with LSID: 21468
    [1666353619.793005][16009:16015] CHIP:EM: >>> [E:53914i M:76956937 (Ack:77118786)] (S) Msg RX from 1:0000000000000034 [9287] --- Type 0001:04 (IM:SubscribeResponse)
    [1666353619.793097][16009:16015] CHIP:EM: Found matching exchange: 53914i, Delegate: 0xffffa000fe10
    [1666353619.793179][16009:16015] CHIP:EM: Rxd Ack; Removing MessageCounter:77118786 from Retrans Table on exchange 53914i
    [1666353619.793260][16009:16015] CHIP:DMG: SubscribeResponse is received
    [1666353619.793346][16009:16015] CHIP:DMG: SubscribeResponseMessage =
    [1666353619.793409][16009:16015] CHIP:DMG: {
    [1666353619.793468][16009:16015] CHIP:DMG:      SubscriptionId = 0x4d2bec4d,
    [1666353619.793539][16009:16015] CHIP:DMG:      MaxInterval = 0xc,
    [1666353619.793603][16009:16015] CHIP:DMG:      InteractionModelRevision = 1
    [1666353619.793662][16009:16015] CHIP:DMG: }
    [1666353619.793727][16009:16015] CHIP:DMG: Subscription established with SubscriptionID = 0x4d2bec4d MinInterval = 5s MaxInterval = 12s Peer = 01:0000000000000034
    [1666353619.793795][16009:16015] CHIP:DMG: MoveToState ReadClient[0xffffa000fe00]: Moving to [Subscripti]
    [1666353619.793933][16009:16015] CHIP:DMG: Refresh LivenessCheckTime for 37000 milliseconds with SubscriptionId = 0x4d2bec4d Peer = 01:0000000000000034

    but still I can not obseve any reaction on Linux app (Node 32) when temperature cluster on Node 52 is updated. What I am missing?

    Best Regards

    Sigitas

  • Hi  

    I think you don't have to subscribe to the binding cluster. You should use the temperaturemeasurement cluster and the use the subscribe command and choose your desired attribute.

    Try this:

    1.) ./chip-tool interactive start

    2.) temperaturemeasurement subscribe measured-value 3 12 52 1

    Now you have subscribed the chip-tool to the cluster attribute of your node 52.

    You should get messages in (interactive) chip-tool like these (I used another cluster and attribute for my subscribtion, so don't wonder):

    [1666959201283] [77299:3496056] CHIP: [EM] >>> [E:47581r M:201428260] (S) Msg RX from 1:0000000000000100 [67D1] --- Type 0001:05 (IM:ReportData)
    [1666959201283] [77299:3496056] CHIP: [EM] Handling via exchange: 47581r, Delegate: 0x100fab2d0
    [1666959201283] [77299:3496056] CHIP: [DMG] ReportDataMessage =
    [1666959201283] [77299:3496056] CHIP: [DMG] {
    [1666959201283] [77299:3496056] CHIP: [DMG] 	SubscriptionId = 0x775601e8,
    [1666959201283] [77299:3496056] CHIP: [DMG] 	AttributeReportIBs =
    [1666959201283] [77299:3496056] CHIP: [DMG] 	[
    [1666959201283] [77299:3496056] CHIP: [DMG] 		AttributeReportIB =
    [1666959201283] [77299:3496056] CHIP: [DMG] 		{
    [1666959201283] [77299:3496056] CHIP: [DMG] 			AttributeDataIB =
    [1666959201283] [77299:3496056] CHIP: [DMG] 			{
    [1666959201283] [77299:3496056] CHIP: [DMG] 				DataVersion = 0x6a03f217,
    [1666959201283] [77299:3496056] CHIP: [DMG] 				AttributePathIB =
    [1666959201283] [77299:3496056] CHIP: [DMG] 				{
    [1666959201283] [77299:3496056] CHIP: [DMG] 					Endpoint = 0x1,
    [1666959201283] [77299:3496056] CHIP: [DMG] 					Cluster = 0x201,
    [1666959201283] [77299:3496056] CHIP: [DMG] 					Attribute = 0x0000_0000,
    [1666959201283] [77299:3496056] CHIP: [DMG] 				}
    [1666959201283] [77299:3496056] CHIP: [DMG] 					
    [1666959201283] [77299:3496056] CHIP: [DMG] 				Data = 2070, 
    [1666959201284] [77299:3496056] CHIP: [DMG] 			},
    [1666959201284] [77299:3496056] CHIP: [DMG] 			
    [1666959201284] [77299:3496056] CHIP: [DMG] 		},
    [1666959201284] [77299:3496056] CHIP: [DMG] 		
    [1666959201284] [77299:3496056] CHIP: [DMG] 	],
    [1666959201284] [77299:3496056] CHIP: [DMG] 	
    [1666959201284] [77299:3496056] CHIP: [DMG] 	InteractionModelRevision = 1
    [1666959201284] [77299:3496056] CHIP: [DMG] }
    [1666959201284] [77299:3496056] CHIP: [TOO] Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_0000 DataVersion: 1778643479
    [1666959201284] [77299:3496056] CHIP: [TOO]   LocalTemperature: 2070

    I think you have to implement source code like it's done in the chip-tool to create a subscription by your linux device. It seems to be that the chip-tool cannot create a subscription for other devices (if you use the subscribe command of any cluster by the chip-tool it seems to be, that you subscribe the chip-tool to the destination-id = publisher). 

Reply
  • Hi  

    I think you don't have to subscribe to the binding cluster. You should use the temperaturemeasurement cluster and the use the subscribe command and choose your desired attribute.

    Try this:

    1.) ./chip-tool interactive start

    2.) temperaturemeasurement subscribe measured-value 3 12 52 1

    Now you have subscribed the chip-tool to the cluster attribute of your node 52.

    You should get messages in (interactive) chip-tool like these (I used another cluster and attribute for my subscribtion, so don't wonder):

    [1666959201283] [77299:3496056] CHIP: [EM] >>> [E:47581r M:201428260] (S) Msg RX from 1:0000000000000100 [67D1] --- Type 0001:05 (IM:ReportData)
    [1666959201283] [77299:3496056] CHIP: [EM] Handling via exchange: 47581r, Delegate: 0x100fab2d0
    [1666959201283] [77299:3496056] CHIP: [DMG] ReportDataMessage =
    [1666959201283] [77299:3496056] CHIP: [DMG] {
    [1666959201283] [77299:3496056] CHIP: [DMG] 	SubscriptionId = 0x775601e8,
    [1666959201283] [77299:3496056] CHIP: [DMG] 	AttributeReportIBs =
    [1666959201283] [77299:3496056] CHIP: [DMG] 	[
    [1666959201283] [77299:3496056] CHIP: [DMG] 		AttributeReportIB =
    [1666959201283] [77299:3496056] CHIP: [DMG] 		{
    [1666959201283] [77299:3496056] CHIP: [DMG] 			AttributeDataIB =
    [1666959201283] [77299:3496056] CHIP: [DMG] 			{
    [1666959201283] [77299:3496056] CHIP: [DMG] 				DataVersion = 0x6a03f217,
    [1666959201283] [77299:3496056] CHIP: [DMG] 				AttributePathIB =
    [1666959201283] [77299:3496056] CHIP: [DMG] 				{
    [1666959201283] [77299:3496056] CHIP: [DMG] 					Endpoint = 0x1,
    [1666959201283] [77299:3496056] CHIP: [DMG] 					Cluster = 0x201,
    [1666959201283] [77299:3496056] CHIP: [DMG] 					Attribute = 0x0000_0000,
    [1666959201283] [77299:3496056] CHIP: [DMG] 				}
    [1666959201283] [77299:3496056] CHIP: [DMG] 					
    [1666959201283] [77299:3496056] CHIP: [DMG] 				Data = 2070, 
    [1666959201284] [77299:3496056] CHIP: [DMG] 			},
    [1666959201284] [77299:3496056] CHIP: [DMG] 			
    [1666959201284] [77299:3496056] CHIP: [DMG] 		},
    [1666959201284] [77299:3496056] CHIP: [DMG] 		
    [1666959201284] [77299:3496056] CHIP: [DMG] 	],
    [1666959201284] [77299:3496056] CHIP: [DMG] 	
    [1666959201284] [77299:3496056] CHIP: [DMG] 	InteractionModelRevision = 1
    [1666959201284] [77299:3496056] CHIP: [DMG] }
    [1666959201284] [77299:3496056] CHIP: [TOO] Endpoint: 1 Cluster: 0x0000_0201 Attribute 0x0000_0000 DataVersion: 1778643479
    [1666959201284] [77299:3496056] CHIP: [TOO]   LocalTemperature: 2070

    I think you have to implement source code like it's done in the chip-tool to create a subscription by your linux device. It seems to be that the chip-tool cannot create a subscription for other devices (if you use the subscribe command of any cluster by the chip-tool it seems to be, that you subscribe the chip-tool to the destination-id = publisher). 

Children
Related