project-chip / connectedhomeip

Matter (formerly Project CHIP) creates more connections between more objects, simplifying development for manufacturers and increasing compatibility for consumers, guided by the Connectivity Standards Alliance.
https://buildwithmatter.com
Apache License 2.0
7.22k stars 1.92k forks source link

[Documentation] How can I get response data with chip-tool command? #26865

Closed lancersky2017 closed 1 year ago

lancersky2017 commented 1 year ago

Documentation issues

Hi, Is there a guidance document on how to use chip-tool command or API to get response data in a readable format?

Platform

No response

Anything else?

No response

bzbarsky-apple commented 1 year ago

It depends on what you mean by "readable".

If you just want the command payloads, see the https://github.com/project-chip/connectedhomeip/blob/master/docs/guides/chip_tool_guide.md#using-message-tracing

If you want to see something else... chances are chip-tool is not set up for it. It will log things like command responses and attribute read/subscribe results, for cases when it knows the schema to parse as, and it can log incoming TLV, but that's it.

So what exactly are you trying to do?

lancersky2017 commented 1 year ago

Hi @bzbarsky-apple , I want to parser the chip-tool response data to JSON and send it to the Cloud. If the data is in the log, it is useless for our actual application. Is there any other way?

bzbarsky-apple commented 1 year ago

@lancersky2017 I believe chip-tool interactive server lets you start a chip-tool that you can then connect to via websocket to send it JSON commands and get JSON responses. I don't know that this is documented particularly well, though. @vivien-apple would know for sure.

lancersky2017 commented 1 year ago

Need to update to the latest version.

nmtoan91 commented 7 months ago

@vivien-apple @bzbarsky-apple My Websocket client doesn't receive messages for subscribe command. Is it true that the subscription messages are sent viva WebSocket?

bzbarsky-apple commented 7 months ago

@nmtoan91 I dont know.