05-25-2021 09:03 AM
Hi all.
We need to control a Cisco Room Endpoint over 3rd Party Device (AMX or Crestron) and we will use JSON Format and not xCmds for this. The Communication via RS232 in JSON format is not working properly, over Ethernet it works fine.
The API Reference Guide suggests, it is possible to switch the communication to JSON Format by issuing the xCommand: xPreferences outputmode json
However the cisco-device will not answer JSON requests as expected.
For example:
{"jsonrpc":"2.0","id":101,"method":"xGet","params":{"Path":["Status","SystemUnit","Uptime"]}}
will not be answered!
(only if echo is on , we will get a mirroring back of the request sent).
But still, what can be observed:
the cisco-device itself is asynchronously returning previous registered feedback in json format:
for example, we will receive audio messages in the following format.
{ "Status": { "Audio": { "Volume": { "Value": "65" } } } }
Our desire is to have the possibility to control the cisco-device via RS232 in a full duplex fashion like we can do by websockets (we must control some systems in an insulated (ip- like) environment.
For example:
RS232 Send:
{"jsonrpc":"2.0","id":101,"method":"xGet","params":{"Path":["Status","SystemUnit","Uptime"]}}
RS232 Receive:
{"id":"getUpTime","jsonrpc":"2.0","result":6071}
Further it would be preferred to have the communication (json object) string as unformatted string-stream, terminated with CRLF (CarriageReturn, LineFeed) as seen above!
Assumed formatted (= line based, as below) output would not be desired:
{ "id": "getUpTime", "jsonrpc": "2.0", "result": 6390 }
05-27-2021 08:00 AM - edited 05-27-2021 08:01 AM
Hi Rolf,
The JSON format for sending commands to the device unfortunately only works over web socket connection or cloud xAPI, not RS-232. When you issue xPreferences outputmode json this will, as the command indicates, only turns the OUTPUTmode to JSON. Input is still the same command line format. This is also the same behavior with XML as outputmode.
I certainly understand your request for unformatted JSON output having CRLF (or possibly some other unique sequence) for end-of-message delimiter to know when read out from the serial buffer on the controller - unfortunately we don't have this.
xStatus Systemunit | resultId="CRLF"
The JSON output will then end in with this resultId in the output which you can then use the message delimiter in you control system serial symbols.
This, however, will not be a workaround for JSON feedback derived from output from xfeedback subscriptions.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide