Facility Control

 View Only
Expand all | Collapse all

Dashboard get status info of Blackmagic MultiView/Videohub via Telnet

  • 1.  Dashboard get status info of Blackmagic MultiView/Videohub via Telnet

    Posted 05-24-2022 13:11
    Hi,

    I am trying to build a custom panel to control some Blackmagic MultiView and Videohubs that we have. I seem to be able to send commands with no problems... what I am trying to do is to be able to read the current input/output labels and the current routes.... I know this involves setting up listeners, and I have found via these forums an example Dashboard panel that does so, but I can't make heads or tails of it or get it to work...

    Although I have found that this may be due to another issue. As I said, I can send commands just fine.

    For example:
    var IP = params.getValue('MV1_IP', 0);
    var port = params.getValue('MV1_Port', 0)
    var telnetScript = "CONFIGURATION:\r\n" + "Layout: 2x2\r\n";
    telnetScript = telnetScript + "\r\n";
    rosstalk.sendMessage(IP,port,telnetScript);​

    Changes the layout of the MultiView no problem.

    However, trying to send a message to it to get a status dump seems to not work:

    var IP = params.getValue('MV1_IP', 0);
    var port = params.getValue('MV1_Port', 0)
    var telnetScript = "INPUT LABELS:\r\n";
    telnetScript = telnetScript + "\r\n";
    rosstalk.sendMessage(IP,port,telnetScript);


    I have Putty open and connected, so I can see when I fire the command to change the layout I can see it fire in Putty. However for INPUT LABELS: command I don't see anything happen or fire.

    So I suppose I would need to get that working before I would be able to even attempt to figure out these listeners.

    Any help would be appreciated.



    ------------------------------
    Jake Lew
    Access Communications Co-Operative Limited
    ------------------------------


  • 2.  RE: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet

    Posted 05-24-2022 13:31
    Hi Jake
    If you are monitoring the incoming messages on the device you are trying to control, I agree that you should start with getting it to detect the request before trying to handle the details of processing the response back in DashBoard.
    One thing you could try that is a little lighter than listeners is rosstalk.sendMessageWithResponse - this is handy if you know the response terminator on the device side. For example, if your INPUT LABELS command returns a blank line after the last label, you could send something like this:

    function callback(success, sentData, resultString, exception)
    {
        if (success)
        {
          ogscript.debug("GOT BACK: " + resultString);
        }
        else
        {
          ogscript.debug("FAILED: " + exception);
        }
    }
    rosstalk.sendMessageWithResponse(IP, port, 'INPUT LABELS:\r\n\r\n', '\r\n\r\n', callback);
    
    ​


    Cheers
    James

    ------------------------------
    James Peltzer
    Ross Video
    ------------------------------



  • 3.  RE: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet

    Posted 05-24-2022 13:43
    Using that code I get "11:41:18:267: FAILED: java.net.SocketTimeoutException: Read timed out" in the debug

    ------------------------------
    Jake Lew
    Access Communications Co-Operative Limited
    ------------------------------



  • 4.  RE: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet

    Posted 05-24-2022 14:07
    That would mean that the device did not send the response or that my guess that the 'end of message' would be indicated by 2 CRLF sequences is not what the device is actually sending.

    ------------------------------
    James Peltzer
    Ross Video
    ------------------------------



  • 5.  RE: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet

    Posted 05-24-2022 14:36
    Yes, I still didn't see anything trigger in Putty. Super weird how it can send commands perfectly fine to change something, but then to just try to send the command to get the status on something it won't work.

    ------------------------------
    Jake Lew
    Access Communications Co-Operative Limited
    ------------------------------



  • 6.  RE: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet

    Posted 05-25-2022 09:26
    Hi Jake, I've controlled the videohub with Crestron before and when you connect with putty, you should see the initial data dump without having to do anything.  It will dump all the input and output names etc. 

    You don't see that when you connect to TCP port 9990 in putty or other terminal?

    ------------------------------
    Matt Rasmussen
    FinePoint Technology
    ------------------------------



  • 7.  RE: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet

    Posted 05-25-2022 10:56
    Yes, when I connect with Putty I see the initial data dump. The additional "INPUT LABELS:" command would just do another dump of only the data that I am looking for. Either way, the issue is to get the data into Dashboard for me to use and not just seeing it in Putty.

    ------------------------------
    Jake Lew
    Access Communications Co-Operative Limited
    ------------------------------



  • 8.  RE: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet

    Posted 05-25-2022 11:04
    Ah, I thought I read that you didn't see a thing in putty either.  I think what happens in dashboard is when you do a simple TCP with message you would only receive the first line, I think the connection drops as soon as the first delimiter is reached.  The listener video tutorial is helpful, it gives you a good example of how to begin parsing that data.

    ------------------------------
    Matt Rasmussen
    FinePoint Technology
    ------------------------------



  • 9.  RE: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet

    Posted 05-25-2022 11:31
    The not seeing anything in Putty refers to sending commands from Dashboard. When I send from Dashboard the "CONFIGURATION:\r\nLayout: 2x2\r\n\r\n" for example I can see that command show up in my Putty window. When I send from Dashboard just the message "INPUT LABELS:\r\n\r\n" I don't see anything trigger or happen in Putty.

    I looked for a video tutorial on listeners and couldn't find one. First thing I checked for before coming to the forums. Is it called something else?

    ------------------------------
    Jake Lew
    Access Communications Co-Operative Limited
    ------------------------------



  • 10.  RE: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet

    Posted 05-25-2022 11:57
    It's called controlling third party devices.  Has three examples and the last one is a listener.  The associated downloads also contain the script for it.#

    ------------------------------
    Matt Rasmussen
    FinePoint Technology
    ------------------------------



  • 11.  RE: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet

    Posted 05-25-2022 13:46
    Thanks, that video helped out. I have made progress and a discovery. I think what is happening that even if I don't see the command in Putty it is still sending, but it is putting the protocol preamble initial data dump each time.

    So I have managed to use the following code to extract just the Input labels:

    var IP = params.getValue('MV1_IP', 0);
    var port = params.getValue('MV1_Port', 0)
    rosstalk.sendMessageWithResponse(IP, port, '', 'END PRELUDE:', callback);
    var Inputs = params.getValueAsString('MV_Response', 0);
    Inputs = Inputs.split("\n\n")[2];​

    Sending a black message because it gives back the data dump first no matter what. Callback function is defined elsewhere and sets the resultString to a "MV_Response" parameter. Then I can use the split function [2] gets me the "Input Labels" section, [3] will get me the "Output Labels" section, etc

    So I have successfully got my data into Dashboard, next step is to try to split it all up into my actual string array parameter!



    ------------------------------
    Jake Lew
    Access Communications Co-Operative Limited
    ------------------------------



  • 12.  RE: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet

    Posted 05-25-2022 14:10
    Nice!  If you'd care to share the full solution I'd love to look at it.

    ------------------------------
    Matt Rasmussen
    FinePoint Technology
    ------------------------------



  • 13.  RE: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet

    Posted 05-25-2022 14:12
    Got it working how I want, so I'll share it here for anyone in the future who might be looking.

    First I have the callback function in the API:

    function callback (success, sentData, resultString, exception)
       {
       ogscript.debug('success: ' + success);
       ogscript.debug('sentData: ' + sentData);
       ogscript.debug('resultString: ' + resultString);
       params.setValue('MV_Response', 0, resultString);
       ogscript.debug('exception: ' + exception);
    }​

    Then a button to load the Input Label names into my array:

    var IP = params.getValue('MV1_IP', 0);
    var port = params.getValue('MV1_Port', 0)
    rosstalk.sendMessageWithResponse(IP, port, '', 'END PRELUDE:', callback);
    var Inputs = params.getValueAsString('MV_Response', 0);
    Inputs = Inputs.split("\n\n")[2];
    Inputs = Inputs.split("\n");
    var InputArray = new Array();
    var entry;
    
    for (var n=1;n<=16;n++)
    {
       entry = Inputs[n]
       entry = entry.split(/\s(.+)/)[1];
       InputArray.push(entry); 
             
          }
         
    params.setAllValues('MV1_Sources', InputArray);


    Maybe not the most elegant solution out there, but it works!



    ------------------------------
    Jake Lew
    Access Communications Co-Operative Limited
    ------------------------------



  • 14.  RE: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet

    Posted 05-25-2022 15:23
    Cool, could I ask a favor, to post what array looks like so I can see the split regex action?

    ------------------------------
    Matt Rasmussen
    FinePoint Technology
    ------------------------------



  • 15.  RE: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet

    Posted 05-25-2022 16:36
    I'm not sure what you are asking for there.

    Inputs = Inputs.split("\n\n")[2];​
    This line splits the return message to:

    INPUT LABELS:
    0 Source 1
    1 Source 2
    2 Source 3
    3 Source 4
    4 Source 5
    5 Source 6
    6 Source 7
    7 Source 8
    8 Source 9
    9 Source 10
    10 Source 11
    11 Source 12
    12 Source 13
    13 Source 14
    14 Source 15
    15 Source 16

    Inputs = Inputs.split("\n");​
    Further splits it by each line

    Then in the loop:
    entry = Inputs[n]
       entry = entry.split(/\s(.+)/)[1];​

    Strips away the leading number and adds it to the array, so the array would end up something like "Source 1,Source 2,Source 3..." etc



    ------------------------------
    Jake Lew
    Access Communications Co-Operative Limited
    ------------------------------