cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
535
Views
0
Helpful
1
Replies

Cisco Collaboration Endpoint Software Communication - JSON over RS232

Rolf Aegerter
Level 1
Level 1

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
}

 

1 Reply 1

David_Bruun-Lie
Cisco Employee
Cisco Employee

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. I guess few have tried using JSON output over serial to a control system. I will see what I can do about this for the future. For now I could only give you a partial work-around for this: When you issue commands/status requests etc you can add a param to include a result Id in the feedback, eg:

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.