Facility Control

 View Only
Expand all | Collapse all

Carbonite though Rosstalk push a Button on Dashboard + Play a Mp3

  • 1.  Carbonite though Rosstalk push a Button on Dashboard + Play a Mp3

    Posted 02-19-2015 18:02
    Hey,

    i trying to push a button on the Dashboard though a GPI Trigger fired by the Carbonite.

    I`m using the 01v96 Sample to put Button on / off commands - the connection works an i can make my audio channel on or off.

    what i want is to trigger that though the Carbonite GPI command send to Dashboard.

    I put the dashboard in listener mode on the settings.

    what do i need to do that the Button 1 is pushed whenever i send GPI command 1 ? I set GPI to 1 on that button in the buttons settings but thats it :(

    Another Request : Is there a chance to push any command to VLC / Windows MEdia player etc to tell the software to play a mp3 on my request ?

    Thanks for help


  • 2.  RE: Carbonite though Rosstalk push a Button on Dashboard + Play a Mp3

    Posted 02-19-2015 18:31
    If you're sending the GPI command from Carbonite to DashBoard and you have the DashBoard's Global "Smart GPI Listener" enabled, and you have the GPI field on the button set to "1", then any tasks associated with the button should be run whenever the switcher fires the command.

    If this isn't working for you, then I would start by making sure there isn't something else on your system already using the default port (you can change which port DashBoard is listening on).

    As for pushing commands to VLC, it looks like VLC does support remote control over TCP:

    http://www.videolan.org/doc/play-howto/en/ch04.html

    (Scroll down to the "RC and RTCI" section)

    So, you should be able to send it commands via rosstalk.sendMessage(URL, PORT, COMMAND)

    #DashBoard


  • 3.  RE: Carbonite though Rosstalk push a Button on Dashboard + Play a Mp3

    Posted 02-19-2015 19:08
    yeah i thought that.

    i tooked a cut buttom from the other dashboards and set that one up to cut on my carbonite.

    i then set the gpi 1 command on the button properties. ips and ports are checked it doesnt take my gpi 1 command coming from the carbonite send though rosstalk :(

    if i push the button on dashboard it works

    #DashBoard


  • 4.  RE: Carbonite though Rosstalk push a Button on Dashboard + Play a Mp3

    Posted 02-19-2015 19:22

    If you trigger it locally, does it work?

    Try adding these buttons to your panel to see if they trigger "GPI 1"

    `

    ogscript.fireGPI('1', null, false);

    rosstalk.sendMessage('localhost', 7788, 'GPI 1');

    `

    #DashBoard


  • 5.  RE: Carbonite though Rosstalk push a Button on Dashboard + Play a Mp3

    Posted 02-19-2015 20:08
    i see the problem -

    if it take the sample for the 01v96 it works with the gpi command.

    the problem is that the command gpi sends always is the same command set by the sample buttom

    it sends : LEVELSET CHON channel=1, value=0 when the is also set to off - so it sends 0 to the 0 status

    param colspan="1" fill="both" left="133" oid="0x20" pheight="110" pwidth="35" rowspan="1" style="style:Toggle;" top="464" weightx="1.0" weighty="0.25">

    %const['Functions']['updateChannelOn']% updateChannelOn(1);

    #DashBoard


  • 6.  RE: Carbonite though Rosstalk push a Button on Dashboard + Play a Mp3

    Posted 02-19-2015 20:19

    The state is passed in the event object if the event was triggered by the GPI command. Here's how you can test for it and access it:

    `

    var on = true;

    if (event.getState && event.getState() != null)

    {

    on = event.getState() != '2';

    }

    `

    #DashBoard


  • 7.  RE: Carbonite though Rosstalk push a Button on Dashboard + Play a Mp3

    Posted 02-19-2015 20:41
    Nope its not working :( i have to admit i have almost zero skills in that :(

    #DashBoard


  • 8.  RE: Carbonite though Rosstalk push a Button on Dashboard + Play a Mp3

    Posted 02-19-2015 21:01

    Okay. I'm not sure what's going on in your updateChannelOn function but let's assume that your parameter 0x20 has 2 values were 0 = off, 1 = on.

    If you want to explicitly set it off or on through your GPI command, you would want to send either '0' or '1' as the state in the GPI message.

    Then, your easiest solution in your task is to get your parameter's value and, if it is a GPI-triggered command, get the GPI state value. If the values are different, set the parameter's value to the value contained in the GPI state. If the values are the same... you can decide whether or not you want to trigger the rest of your task.

    `

    var paramValue = params.getValue(0x20, 0);

    if (event.getState && event.getState() != null)

    {

    var gpiValue = parseInt(event.getState());

    if (gpiValue != paramValue)

    {

    params.setValue(0x20, 0, gpiValue);

    return;

    }

    else

    {

    //You could return here too if you don't want the command to run if the GPI value already matches the parameter value

    }

    }

    %const['Functions']['updateChannelOn']% updateChannelOn(paramValue);

    `

    #DashBoard


  • 9.  RE: Carbonite though Rosstalk push a Button on Dashboard + Play a Mp3

    Posted 02-19-2015 21:24
    hm its not working : 0x20 is channel 1 or 0 on the setup

    0x21 is another channel - its channel 2 then.

    on button press its LEVELSET CHON channel=0, value=0 and on another press its LEVELSET CHON channel=0, value=1

    #DashBoard


  • 10.  RE: Carbonite though Rosstalk push a Button on Dashboard + Play a Mp3

    Posted 02-19-2015 21:46
    I'm sorry. I'm afraid I don't follow what exactly you need the code to do or where you say it isn't working.

    The code I posted earlier should show:

    • How to get the value out of a parameter (params.getValue)
    • How to get the state out of a GPI even (event.getState)
    • How to convert the GPI state to a number (parseInt)



    Are you now able to trigger the task at all via a GPI command?

    `ogscript.debug('task fired');`

    Are you able to get the state out of it?

    `ogscript.debug(event.getState());`

    Are you just looking to toggle the button with the GPI command?

    Perhaps you could send me your panel so I could better understand what's going on (the forum isn't the easiest place to post code but you could upload it to

    https://gist.github.com/ and post a link)?

    #DashBoard


  • 11.  RE: Carbonite though Rosstalk push a Button on Dashboard + Play a Mp3

    Posted 02-20-2015 14:30
    https://gist.github.com/anonymous/87adad9e984d09188d82#file-stereo

    there we go - its button 1 on the stereoscore test file.

    just set to gpi 1 and your code is inserted. not shure if i did that correct.

    #DashBoard


  • 12.  RE: Carbonite though Rosstalk push a Button on Dashboard + Play a Mp3

    Posted 02-20-2015 15:28
    Okay. I have downloaded your snippet. I have also downloaded the Yamaha example panel so I can see what exactly is going on in updateChannelOn.

    In order to fix this, I need to know exactly what you're trying to do.

    Are you trying to attach a GPI Trigger to each of the channel buttons?

    So

    GPI 1:0 would turn channel 1 off

    GPI 1:1 would turn channel 1 on

    GPI 2:0 would turn channel 2 off

    GPI 2:1 would turn channel 2 on

    ...

    OR

    Are you trying to simply toggle any button's state

    So

    GPI 1:1 would turn channel 1 OFF if it is already ON or ON if it is already off

    GPI 1:2 would turn channel 2 OFF if it is already ON or ON if it is already off

    GPI 1:3 would turn channel 3 OFF if it is already ON or ON if it is already off

    ...

    Once you clarify this, I believe I can get your panel sorted out.

    #DashBoard


  • 13.  RE: Carbonite though Rosstalk push a Button on Dashboard + Play a Mp3

    Posted 02-20-2015 16:35
    the way i do it is i set up a a device to like button 13 on the panel and everytime i push it i get the device details in the lcd . i push next next to get the gpi trigger windows - once i click gpi 1 then it should do something - i want to save that then to the macro.

    if you have a better way to trigger that go ahead.

    thank you for your efford

    #DashBoard


  • 14.  RE: Carbonite though Rosstalk push a Button on Dashboard + Play a Mp3

    Posted 02-20-2015 16:52
    Hi Dirk. I have been talking with James about this and we are a bit confused about your response. What is button 13? Is it something that you created and added to the panel or is it on the switcher? What is the LCD (and where is it located... what is it interfacing with?). What are you expecting GPI 1 to do when it is clicked?

    If you can help provide a bit more detail we can continue to try to get your panel working as expected.

    #DashBoard


  • 15.  RE: Carbonite though Rosstalk push a Button on Dashboard + Play a Mp3

    Posted 02-20-2015 16:57
    Hey Greg,

    its on the Switcher - could be any other input button. The LCD ist the one on the top with the 3 push buttons under it.

    my only wish is to put an on / off command in my macro to change the mic state on the mixer.

    #DashBoard


  • 16.  RE: Carbonite though Rosstalk push a Button on Dashboard + Play a Mp3

    Posted 02-20-2015 17:13

    I think we can do this by adding a new function to the Yamaha panel's lookup table (``):

    `/**

    Create one hidden button for each GPI trigger you would like to add.

    Firing GPI 1:0 will turn channel 1 off

    Firing GPI 1:1 will turn channel 1 on

    Firing GPI 2:0 will turn channel 2 off

    Firing GPI 2:1 will turn channel 2 on

    */

    function updateFromGPI(event)

    {

    var channelNumber = parseInt(event.getTrigger()) - 1;

    var gpiState = parseInt(event.getState());

    //0x20 is the OID of channel 1. 0x21 is channel 2, 0x22 is channel 3, etc.

    if (channelNumber > 0x20)

    {

    var oid = 0x20 + channelNumber;

    var paramState = params.getValue(oid, 0);

    if (paramState == gpiState)

    {

    return;

    }

    else

    {

    params.setValue(oid, 0, gpiState);

    }

    }

    }

    `

    Then, at the bottom of your panel, you can add one of these for each of the channels you would like to control through GPI:

    `

    %const['Functions']['updateFromGPI']% updateFromGPI(event);

    `

    The example I just gave will turn channel 1 OFF if you send DashBoard "GPI 1:0" and turn channel 1 ON if you send DashBoard "GPI 1:1".

    To add the same feature to channel 2, you can use:

    `

    %const['Functions']['updateFromGPI']% updateFromGPI(event);

    `

    #DashBoard


  • 17.  RE: Carbonite though Rosstalk push a Button on Dashboard + Play a Mp3

    Posted 02-20-2015 17:16

    Note: You'll want to remove the modifications you made to your param tag yesterday

    `
    %const['Functions']['updateChannelOn']% updateChannelOn(1);

    `

    #DashBoard