Repository navigation
Closed
Description
After modifying the code to make clusterId and attribute Id optional by returning zero when either of the fields are not present), commissioning with Home Assistant progresses further and from node-matter it seems like the device paired - but somehow HA add-on gives up after receiving response from last read... Here is how it looks from the node-matter side:
node build/Main.js
Matter server listening
Pase: Received pairing request from udp://192.168.1.57:60161
Pase: Paired succesfully with udp://192.168.1.57:60161
Received read request from udp://192.168.1.57:60161 on session secure/20610: */49/65532, 0/48/0, 0/48/1, 0/48/2, 0/48/3, 0/40/2, 0/40/4, */49/3
Received invoke request from udp://192.168.1.57:60161 on session secure/20610: 0/48/0
Received invoke request from udp://192.168.1.57:60161 on session secure/20610: 0/48/2
Received invoke request from udp://192.168.1.57:60161 on session secure/20610: 0/62/2
Received invoke request from udp://192.168.1.57:60161 on session secure/20610: 0/62/2
Received invoke request from udp://192.168.1.57:60161 on session secure/20610: 0/62/0
Received invoke request from udp://192.168.1.57:60161 on session secure/20610: 0/62/4
Received invoke request from udp://192.168.1.57:60161 on session secure/20610: 0/62/11
Received invoke request from udp://192.168.1.57:60161 on session secure/20610: 0/62/6
Case: Received pairing request from udp://192.168.1.57:60161
Case: Paired succesfully with udp://192.168.1.57:60161
Received invoke request from udp://192.168.1.57:60161 on session secure/20611: 0/48/4
Received read request from udp://192.168.1.57:60161 on session secure/20611: */undefined/undefined
No further communication from HA to node-matter after this read request. However, HA doesn't complete the full commissioning process. Not sure what is going on, but here are some HA logs...
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Sending encrypted msg 0x7fc7dc0197a8 with MessageCounter:167328143 to 0xFFFFFFFB00000000 (0) at monotonic time: 00000000209E1A50 msec
2022-07-13 17:44:01 77f1785d-matter-server chip.CTL[122] INFO Sent operational certificate to the device
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Prepared secure message 0x7fc7f0c23da8 to 0xFFFFFFFB00000000 (0) of type 0x10 and protocolId (0, 0) on exchange 15703i with MessageCounter:167328144.
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Sending encrypted msg 0x7fc7f0c23da8 with MessageCounter:167328144 to 0xFFFFFFFB00000000 (0) at monotonic time: 00000000209E1A51 msec
2022-07-13 17:44:01 77f1785d-matter-server chip.EM[122] INFO Received message of type 0x9 with protocolId (0, 1) and MessageCounter:4064267261 on exchange 15704i
2022-07-13 17:44:01 77f1785d-matter-server chip.DMG[122] INFO Received Command Response Data, Endpoint=0 Cluster=0x0000_003E Command=0x0000_0008
2022-07-13 17:44:01 77f1785d-matter-server chip.CTL[122] INFO Device returned status 0 on receiving the NOC
2022-07-13 17:44:01 77f1785d-matter-server chip.CTL[122] INFO Operational credentials provisioned on device 0x7fc7dc02c520
2022-07-13 17:44:01 77f1785d-matter-server chip.CTL[122] INFO Successfully finished commissioning step 'SendNOC'
2022-07-13 17:44:01 77f1785d-matter-server chip.CTL[122] INFO Commissioning stage next step: 'SendNOC' -> 'FindOperational'
2022-07-13 17:44:01 77f1785d-matter-server chip.CTL[122] INFO Performing next commissioning step 'FindOperational'
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Operational node lookup already in progress. Will NOT start a new one.
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Prepared secure message 0x7fc7f0c23da8 to 0xFFFFFFFB00000000 (0) of type 0x10 and protocolId (0, 0) on exchange 15704i with MessageCounter:167328145.
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Sending encrypted msg 0x7fc7f0c23da8 with MessageCounter:167328145 to 0xFFFFFFFB00000000 (0) at monotonic time: 00000000209E1A6B msec
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO UDP:192.168.1.28%enp0s18:5540: new best score: 2
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Checking node lookup status after 8 ms
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Keeping DNSSD lookup active
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO UDP:192.168.1.28%enp0s18:5540: score has not improved: 2
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Checking node lookup status after 9 ms
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Keeping DNSSD lookup active
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO UDP:192.168.1.28%enp0s18:5540: score has not improved: 2
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Checking node lookup status after 10 ms
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Keeping DNSSD lookup active
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO UDP:192.168.1.28%hassio:5540: score has not improved: 2
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Checking node lookup status after 11 ms
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Keeping DNSSD lookup active
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO UDP:192.168.1.28%hassio:5540: score has not improved: 2
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Checking node lookup status after 11 ms
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Keeping DNSSD lookup active
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO UDP:192.168.1.28%hassio:5540: score has not improved: 2
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Checking node lookup status after 12 ms
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Keeping DNSSD lookup active
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO UDP:192.168.1.28%enp0s18:5540: score has not improved: 2
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Checking node lookup status after 18 ms
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Keeping DNSSD lookup active
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO UDP:192.168.1.28%enp0s18:5540: score has not improved: 2
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Checking node lookup status after 19 ms
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Keeping DNSSD lookup active
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO UDP:192.168.1.28%enp0s18:5540: score has not improved: 2
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Checking node lookup status after 21 ms
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Keeping DNSSD lookup active
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO UDP:192.168.1.28%hassio:5540: score has not improved: 2
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Checking node lookup status after 22 ms
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Keeping DNSSD lookup active
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO UDP:192.168.1.28%hassio:5540: score has not improved: 2
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Checking node lookup status after 23 ms
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Keeping DNSSD lookup active
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO UDP:192.168.1.28%hassio:5540: score has not improved: 2
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Checking node lookup status after 24 ms
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Keeping DNSSD lookup active
2022-07-13 17:44:01 77f1785d-matter-server chip.DIS[122] INFO Checking node lookup status after 200 ms
2022-07-13 17:44:01 77f1785d-matter-server chip.SC[122] INFO Initiating session on local FabricIndex 1 from 0x0000000000000001 -> 0x00000000000010EF
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Prepared unauthenticated message 0x7fc7dc027818 to 0x0000000000000000 (0) of type 0x30 and protocolId (0, 0) on exchange 15705i with MessageCounter:12213759.
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Sending unauthenticated msg 0x7fc7dc027818 with MessageCounter:12213759 to 0x0000000000000000 at monotonic time: 00000000209E1B2E msec
2022-07-13 17:44:01 77f1785d-matter-server chip.SC[122] INFO Sent Sigma1 msg
2022-07-13 17:44:01 77f1785d-matter-server chip.EM[122] INFO Received message of type 0x31 with protocolId (0, 0) and MessageCounter:4064267262 on exchange 15705i
2022-07-13 17:44:01 77f1785d-matter-server chip.SC[122] INFO Received Sigma2 msg
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Prepared unauthenticated message 0x7fc7dc02f6b8 to 0x0000000000000000 (0) of type 0x32 and protocolId (0, 0) on exchange 15705i with MessageCounter:12213760.
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Sending unauthenticated msg 0x7fc7dc02f6b8 with MessageCounter:12213760 to 0x0000000000000000 at monotonic time: 00000000209E1B3F msec
2022-07-13 17:44:01 77f1785d-matter-server chip.SC[122] INFO Sent Sigma3 msg
2022-07-13 17:44:01 77f1785d-matter-server chip.EM[122] INFO Received message of type 0x40 with protocolId (0, 0) and MessageCounter:4064267263 on exchange 15705i
2022-07-13 17:44:01 77f1785d-matter-server chip.SC[122] INFO Success status report received. Session was established
2022-07-13 17:44:01 77f1785d-matter-server root[122] INFO SetSdkKey: f/1/s/00000000000010EF = b'\x150\x03\x10\xbf\x05\x9d\x12W\x97N\xd1}m\xfd\x97\x08\x9c\x87/0\x04 "/\xe0F\xfc\xf8\x9b\xfbEW\xe4\x87\xad)X\xce\x91\xda\x81\x8b\x81<}\xc3\xe2\x13\xe5\xa3\xc7DX\xb90\x05\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x18'
2022-07-13 17:44:01 77f1785d-matter-server root[122] INFO SetSdkKey: g/s/vwWdEleXTtF9bf2XCJyHLw== = b'\x15$\x01\x01%\x02\xef\x10\x18'
2022-07-13 17:44:01 77f1785d-matter-server root[122] INFO SetSdkKey: g/sri = b'\x16\x15$\x01\x01%\x02\xef\x10\x18\x18'
2022-07-13 17:44:01 77f1785d-matter-server chip.SC[122] INFO SecureSession[0x7fc7dc0279a0]: Moving from state 'kEstablishing' --> 'kActive'
2022-07-13 17:44:01 77f1785d-matter-server chip.CTL[122] INFO Successfully finished commissioning step 'FindOperational'
2022-07-13 17:44:01 77f1785d-matter-server chip.CTL[122] INFO Commissioning stage next step: 'FindOperational' -> 'SendComplete'
2022-07-13 17:44:01 77f1785d-matter-server chip.CTL[122] INFO Performing next commissioning step 'SendComplete'
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Prepared secure message 0x7fc7dc02f6b8 to 0x00000000000010EF (1) of type 0x8 and protocolId (0, 1) on exchange 15706i with MessageCounter:157404875.
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Sending encrypted msg 0x7fc7dc02f6b8 with MessageCounter:157404875 to 0x00000000000010EF (1) at monotonic time: 00000000209E1B4B msec
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Prepared unauthenticated message 0x7fc7f0c23de8 to 0x0000000000000000 (0) of type 0x10 and protocolId (0, 0) on exchange 15705i with MessageCounter:12213761.
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Sending unauthenticated msg 0x7fc7f0c23de8 with MessageCounter:12213761 to 0x0000000000000000 at monotonic time: 00000000209E1B4C msec
2022-07-13 17:44:01 77f1785d-matter-server chip.EM[122] INFO Received message of type 0x9 with protocolId (0, 1) and MessageCounter:4064267264 on exchange 15706i
2022-07-13 17:44:01 77f1785d-matter-server chip.DMG[122] INFO Received Command Response Data, Endpoint=0 Cluster=0x0000_0030 Command=0x0000_0005
2022-07-13 17:44:01 77f1785d-matter-server chip.CTL[122] INFO Received CommissioningComplete response, errorCode=0
2022-07-13 17:44:01 77f1785d-matter-server chip.CTL[122] INFO Successfully finished commissioning step 'SendComplete'
2022-07-13 17:44:01 77f1785d-matter-server chip.CTL[122] INFO Commissioning stage next step: 'SendComplete' -> 'Cleanup'
2022-07-13 17:44:01 77f1785d-matter-server chip.CTL[122] INFO Performing next commissioning step 'Cleanup'
2022-07-13 17:44:01 77f1785d-matter-server chip.CTL[122] INFO Successfully finished commissioning step 'Cleanup'
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Prepared secure message 0x7fc7f0c23da8 to 0x00000000000010EF (1) of type 0x10 and protocolId (0, 0) on exchange 15706i with MessageCounter:157404876.
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Sending encrypted msg 0x7fc7f0c23da8 with MessageCounter:157404876 to 0x00000000000010EF (1) at monotonic time: 00000000209E1B52 msec
2022-07-13 17:44:01 77f1785d-matter-server matter_server.server.server[122] INFO [140496488854960] Deserialized message: CommandMessage(messageId='355dd24ba3044913b6318af120e34980', command='device_controller.ResolveNode', args={'nodeid': 4335})
2022-07-13 17:44:01 77f1785d-matter-server matter_server.server.server[122] INFO [140496488854960] Deserialized message: CommandMessage(messageId='8296edfecec6419499c9ae4db7ced4c7', command='device_controller.Read', args={'nodeid': 4335, 'attributes': '*', 'dataVersionFilters': None, 'events': '*', 'returnClusterObject': True, 'reportInterval': None, 'fabricFiltered': True, 'keepSubscriptions': False})
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Prepared secure message 0x7fc7dc02f6b8 to 0x00000000000010EF (1) of type 0x2 and protocolId (0, 1) on exchange 15707i with MessageCounter:157404877.
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Sending encrypted msg 0x7fc7dc02f6b8 with MessageCounter:157404877 to 0x00000000000010EF (1) at monotonic time: 00000000209E1B63 msec
2022-07-13 17:44:01 77f1785d-matter-server chip.EM[122] INFO Received message of type 0x5 with protocolId (0, 1) and MessageCounter:4064267265 on exchange 15707i
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Prepared secure message 0x7fc7f0c23da8 to 0x00000000000010EF (1) of type 0x10 and protocolId (0, 0) on exchange 15707i with MessageCounter:157404878.
2022-07-13 17:44:01 77f1785d-matter-server chip.IN[122] INFO Sending encrypted msg 0x7fc7f0c23da8 with MessageCounter:157404878 to 0x00000000000010EF (1) at monotonic time: 00000000209E1B67 msec
Without specs, it is hard for me to tell what is going on. But HA add-on is also WIP, so will wait till it stabilizes
Originally posted by @jdesai61 in #8 (comment)
Metadata
Metadata
Assignees
Labels
No labels
Activity
mfucci commentedon Aug 4, 2022
Pull request #13 should fix this issue since this is related to read attribute wildcards not handled.
jdesai61 commentedon Aug 4, 2022
Pull request #13 does not completely fix this issue. I see more messages in HA now after the 'Cleanup' line (compared to before)...
But I don't see the device in HA... here is what I see from node-matter (don't see any further read requests than before)
jdesai61 commentedon Aug 4, 2022
After enabling debug logs on HA, here is what I am seeing. Not sure what ResolveNode does...
mfucci commentedon Aug 4, 2022
0/48/4 has been invoked (CommissioningComplete) so the commissioning should have succeeded.
This might be a MDNS issue now: Operational discovery failed for 0x00000000000010F0
Can you capture the network packets to check what is going on?
mfucci commentedon Aug 9, 2022
Any chance to get a network capture to investigate this issue?
Or you can give me some pointers on how to install HA Matter plugin so I can reproduce the issue? (I don't have a HA instance, so I need to install everything from scratch...)
jdesai61 commentedon Aug 9, 2022
jdesai61 commentedon Aug 9, 2022
Here are two pcap files - both captured on home-assistant side. One is with succesful commissioning of ESPDev device that HA tutorial used. The other is almost successful (but not quite) capture with node-matter.
node-matter-esp-ha.zip
The HA logs with node-matter are already posted above. But I am attaching HA logs showing succesfull commissioning with
esp-ha.log
ESP DevKit device
Hope Assistant IP: 192.168.1.57 (IPV6: fe80::a199:dcb4:dc7)
ESP DevKit IP: 192.168.1.165 (IPV6 fe80::86f7:3ff:fe60:ff8)
Node Matter VM IP: 192.168.1.28
tcpdump command used to capture (on HA machine):
Hope this helps.
mfucci commentedon Aug 10, 2022
Thanks!
Per the logs, it doesn't seem to be a MDNS issue. It more looks like HA Matter plugin doesn't like something that is returned by: read //* request.
The ESPDev device returns many more attributes.
I know that many mandatory clusters / attributes are not implemented in node-matter.
Many if we pinpoint the attributes that HA plugin expects, I can add just those one.
In matter_server/client/matter.py#L86 can you add a few logs to check if self.client.driver.device_controller.commission_with_code is returning?
I think the problem happens in "await self._interview_node(node_id)" but I am not sure.
Does "ERROR Operational discovery failed for" happens each time? Previous log says that it waited for 15s but that doesn't match with the other timestamps in the logs, since logs start less than a second ago.
jdesai61 commentedon Aug 11, 2022
Agree the MDNS was only related to discovering commissionable device. The logs and tcpdump capture don't agree on timing, because I failed to capture logs when I was using tcpdump, so they are from a different run.
I tried to edit the matter_server files to add log statements, but within HA this is not easily done because the matter server is a docker image that I can't easily manipulate. I am out of town for next two weeks so when I return, perhaps I will try to build my own docker container for matter server and insert the debug statements.
javierbarellano4v commentedon Aug 17, 2022
Does the zipped version of node-matter includes all fixes up until to this point?
Thanks.
mfucci commentedon Aug 17, 2022
Hi Javier,
If you download the sip of the main branch, it will contain all the latest fixes.
Alternatively, I just uploaded a new version to npm, so you install the latest version with: npm i node-matter
Let me know if you run into any issue!
Thanks,
javierbarellano4v commentedon Aug 17, 2022
Hey Marco,
It worked (via npm)
Is there another Cluster (command) I can try to hit the Matter Server so to speak?
Thanks so much! Greatly appreciate it!!
mfucci commentedon Aug 18, 2022
The last log means that the commissioning was successful.
The only cluster implemented right now is the On/Off cluster which can be used to turn on / off a light, an appliances, etc.
You can send command via the Android Matter test app or using Matter test command line tool.
To turn on/off one LED on a Raspberry Pi, here is the command:
matter -on "echo 255 > /sys/class/leds/led1/brightness" -off "echo 0 > /sys/class/leds/led1/brightness"
You can run your own scripts on "on" / "off" to do something more advanced.
Thanks!
javierbarellano4v commentedon Aug 18, 2022
As a matter of fact, I have Matter deployed on a Raspberry Pi 4. So I ran the chip-tool on it to pair with your Matter server.
Thanks again.
jdesai61 commentedon Aug 18, 2022
I have previously mentioned that chip-tool can successfully pair with node-matter after the following issue was fixed: #3 (comment). T
his particular issue is inability to complete pairing process with Home Assistant Matter Add-on.
140 remaining items
Apollon77 commentedon Feb 27, 2023
Ok the PR that fixes the read response of unknown attributes is in. Please try again and provide a new log. Thank you
jdesai61 commentedon Feb 27, 2023
Yes!!!! With this change I am able to commission the node-matter device and control it with HA. We can close the issue now.
Apollon77 commentedon Feb 28, 2023
Can you please (for completeness) post a node-mater log from such a pairing process? Then I close
jdesai61 commentedon Feb 28, 2023
For future reference, attached is log from node-matter and corresponding logs from HA Matter server of a successful commissioning and turning the switch on/off from HA a couple of times
ha-matter-server.log
nodematter-success-home-assistant.txt
Hopefully closing this issue for good now.
Apollon77 commentedon Feb 28, 2023
Let's see ... I have one PR that I will merge soon that could get interesting so I would poke again here after merging for a last test if ok for you.
But interesting ... Hass even registers 3 Fabrics on the devcie which is 1 more then Apple/Google ... no idea why they do that. Seems like the "Google way" plus then one of their own.
jdesai61 commentedon Feb 28, 2023
sure
jdesai61 commentedon Mar 7, 2023
With latest release of Home Assistant and Matter Add-on, I can no longer commission with node-matter. However, this is not an issue with node-matter. It is an issue with HA because it is now refusing to commit devices with test vendor id (0xfff1). I am still looking for a workaround similar to how you have to add test vendor/product Id to the Google backend for pairing with Google Home.
Apollon77 commentedon Mar 8, 2023
With the infos from above and the "HA companion App" which uses Google in the background please check the readme about the instructions on how to use the Google Developer Console to whitelist this vendor/product id ... I would expect that this helps then?!
jdesai61 commentedon Mar 8, 2023
Apollon77 commentedon Mar 8, 2023
DId you opened an issue on Homeassistent to get details?
Apollon77 commentedon Mar 8, 2023
Can you please post logs from both parties (node-matter and also HA).
Are you sure that only HA was updated or did you also updated node-matter? because we now generate correct certificates and not use the "full testing default chain". But chiptool and all othersd are ok with it, so would be interesting to see the logs
jdesai61 commentedon Mar 8, 2023
Apollon77 commentedon Mar 8, 2023
But sorry when e have not a singel connection request then it CAN NOT be certificates or such ... then it is more network or UDP data flow
jdesai61 commentedon Mar 8, 2023
Not sure what happened, but after another upgrade of HA, it started working again... Sorry for the noise.