03-22-2024 04:20 AM
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
03-24-2024 01:26 AM
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/
04-05-2024 01:08 AM
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();
04-05-2024 04:12 AM
@christian-sifrar
Thank you for sharing the solution!
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