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

USB to RS232 AV control: works in command line, not working in a Macro

anass.khatib
Level 1
Level 1

Hi,

The ability to control other AV devices via USB to RS232 was added in roomOS.

https://roomos.cisco.com/doc/TechDocs/OutboundSerialControl

I'm using a FTDI chipset cable, on a Cisco Room Kit Plus in combination with a Samsung Screen QMR55 (RS232c).

I tested all of these RS232c commands in the command line, and they worked:

Command Code (HEX) Control System Representation

Power OnAA 11 FE 01 01 11\xAA\x11\xFE\x01\x01\x11
Power OffAA 11 FE 01 00 10\xAA\x11\xFE\x01\x00\x10
Volume UpAA 62 FE 01 00 61\xAA\x62\xFE\x01\x00\x61
Volume DownAA 62 FE 01 01 62\xAA\x62\xFE\x01\x01\x62
Mute OnAA 13 FE 01 01 13\xAA\x13\xFE\x01\x01\x13
Mute OffAA 13 FE 01 00 12\xAA\x13\xFE\x01\x00\x12
Select HDMI 1AA 14 FE 01 21 34\xAA\x14\xFE\x01\x21\x34
Select HDMI 2AA 14 FE 01 23 36\xAA\x14\xFE\x01\x23\x36
Select HDMI 3AA 14 FE 01 31 44\xAA\x14\xFE\x01\x31\x44

Example of command line: 

 

xcommand SerialPort PeripheralControl Send Text: \xAA\x14\xFE\x01\x23\x36

OK
*r PeripheralControlSendResult (status=OK): 
** end

 

 

 

Like I already said, the commands work, status returns OK, and the TV/Screen actually receives the command and changes HDMI source.

Now the idea is to create a screen control panel on the unit, but for now I just wanted to test it first in a Macro, I created a very simple macro that triggers on a UI extension Action Button.

 

 

import xapi from 'xapi';

xapi.event.on("UserInterface Extensions Panel Clicked", async (event) => {
    if (event.PanelId == "hdmi2") {
        xapi.Command.SerialPort.PeripheralControl.Send(
            { Text: "\xAA\x14\xFE\x01\x23\x36" });
        console.log("Switch Screen to HDMI 2");
    }
});

 

 

I see the console log trigger, but the command doesn't seem to get processed correctly by the TV/screen. When pressing my HDMI2 button on the Cisco navigator I do see the USB module Tx and Rx link blink. I'm assuming now the xapi is broken in some way where it does send a RS232 signal but incorrectly, since the same command works in commandline.

I wonder if anybody else has been testing with this, and got it working.

 

1 Accepted Solution

Accepted Solutions

anass.khatib
Level 1
Level 1

I found out what I was doing wrong after I tried sending the command via webexapis.com, the issue is with how the hexadecimal escape sequences are being represented within the JSON argument - Text.

I was using (which works in commandline): "\xAA\x14\xFE\x01\x23\x36"

Correct for xapi: "\\xAA\\x14\\xFE\\x01\\x23\\x36"

Issue resolved.

View solution in original post

1 Reply 1

anass.khatib
Level 1
Level 1

I found out what I was doing wrong after I tried sending the command via webexapis.com, the issue is with how the hexadecimal escape sequences are being represented within the JSON argument - Text.

I was using (which works in commandline): "\xAA\x14\xFE\x01\x23\x36"

Correct for xapi: "\\xAA\\x14\\xFE\\x01\\x23\\x36"

Issue resolved.