cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
277
Views
0
Helpful
3
Replies

Macro for Beamer controll over RS232 an Romm Kit EQ

Hello,

I installed a Room Kit EQ and want to send a RS-232 Command to the Beamer when the Device will start up or go in Standby..

I also have installed the Beta Version of Room OS and the Line from The USB to the Beamer is working (Test it with HEX command and Hterm Software.

So i think i only have a Error in my Macro: I get following Error when VC gos in Standby or Turn ON: Unhandled promise rejection {"code":-32602,"message":"Bad usage: Missing or invalid parameter(s)."}

 

 

import xapi from 'xapi';

function BeamerON() {
    console.log("Turning on Beamer");
    xapi.Command.SerialPort.PeripheralControl.Send(
      {
      'Command':"02 00 00 00 00 02",
      //'ResponseTerminator' : "\n",
      'ResponseTimeout': 2000
      }
    )
}

function BeamerOFF() {
    console.log("Turning off Beamer");
    xapi.Command.SerialPort.PeripheralControl.Send(
      {
      'Command':"02 01 00 00 00 03",
      //;'ResponseTerminator' : "\n",
      'ResponseTimeout': 2000
      }
    )
}
  
function registerEventHandlers() {
    // Register for Standby/PowerOn  events
  xapi.status.on('Standby State', (state) => {
    if (state === 'Off') BeamerON();
    if (state === 'Standby') BeamerOFF();
    if (state === 'Halfwake') BeamerON();
  })

}


function init() {
    registerEventHandlers();
}

init();  

 

i also try it with following Commands:

 

import xapi from 'xapi';

function BeamerON() {
    console.log("Turning on Beamer");
    xapi.Command.SerialPort.PeripheralControl.Send(
      {
      'Command':"02h 00h 00h 00h 00h 02h",
      //'ResponseTerminator' : "\n",
      'ResponseTimeout': 2000
      }
    )
}

function BeamerOFF() {
    console.log("Turning off Beamer");
    xapi.Command.SerialPort.PeripheralControl.Send(
      {
      'Command':"02h 01h 00h 00h 00h 03h",
      //;'ResponseTerminator' : "\n",
      'ResponseTimeout': 2000
      }
    )
}
  
function registerEventHandlers() {
    // Register for Standby/PowerOn  events
  xapi.status.on('Standby State', (state) => {
    if (state === 'Off') BeamerON();
    if (state === 'Standby') BeamerOFF();
    if (state === 'Halfwake') BeamerON();
  })

}


function init() {
    registerEventHandlers();
}

init();  

 

 Someone have a idia waht i miss here? How the Cisco endpoint know how to Use what USB-Port of the Codec EX for Serial Port communication?? (i have tryed all 4 Ports with no effect)

 

Thanks,

Christian

3 Replies 3

mfr-6
Level 1
Level 1

hi @christian-sifrar 

Based on what I found in the docs, I see that arguments for 

xapi.Command.SerialPort.PeripheralControl.Send

are different in a docs: https://roomos.cisco.com/xapi/Command.SerialPort.PeripheralControl.Send/ from what you've provided

Could you provide us more details about your setup so we can look deeper at it?
BTW. docs for Send command are available here: https://roomos.cisco.com/xapi/Command.SerialPort.PeripheralControl.Send/

Mateusz Frak NetDevOps | DevNet | Automation
Please mark this post as helpful if it solves your issue, to make this visible for other users, thank you!

FYI

 

I Solved the issue, the macro was false, here the right one:

import xapi from 'xapi';


function BeamerON() {
    console.log("Turning on Beamer");
    xapi.Command.SerialPort.PeripheralControl.Send(
      {
        Text:"\x02\x00\x00\x00\x00\x02"
      }
    )
}


function BeamerOFF() {
    console.log("Turning off Beamer");
    xapi.Command.SerialPort.PeripheralControl.Send(
      {
        Text:"\x02\x01\x00\x00\x00\x03"
      }
    )
}
  
function registerEventHandlers() {
    // Register for Standby/PowerOn  events
  xapi.status.on('Standby State', (state) => {
    if (state === 'Off') BeamerON();
    if (state === 'Standby') BeamerOFF();
    if (state === 'Halfwake') BeamerON();
  })
}


function init() {
    registerEventHandlers();
}


init(); 

 

mfr-6
Level 1
Level 1

@christian-sifrar 
Thank you for sharing the solution!

Mateusz Frak NetDevOps | DevNet | Automation
Please mark this post as helpful if it solves your issue, to make this visible for other users, thank you!