Connectivity

 View Only
  • 1.  NK router automation

    Posted 08-19-2020 15:38

    We recently purchased an NK-3G34 video router and it is connected to our network through an NK IPS.  The video router controls the inputs to our Internet streaming encoders, which run 24/7.

    We are able to change sources and destinations using the switchboard in Dashboard, but we also need to be able to do this automatically, that is with no human intervention.

    When our programming schedule contains content that cannot be streamed over the Internet due to licensing restrictions, the encoder input must be switched to a different input signal so that the licensed content is not streamed.  This may happen at any time during the day or night, and it is not possible to do this manually.

    I called Ross tech support and they told me that this might be possible to do within Dasboard using "custom panels".  I see that you can define commands in custom panels using something called ogScript, but I don't quite see how this could be called automatically.  Wouldn't a custom panel still need someone to run Dashboard and trigger the custom panel manually?

    Is it possible for an external application (a cron job, for instance) to send some kind of request to the NK IPS either through Dashboard or outside of it, so that the router would receive an instruction to change a given input?

    Thanks for any information you can give us.

     

    UPDATE:

    The NK-IPS documentation states:

    The NK-IPS provides an Ethernet port that connects to a LAN or directly to a computer. This port is used to communicate to a web browser or the DashBoard Control System to configure and control the NK Series Routing System.

    Can you tell me how to communicate with it using a web browser?  It doesn't seem to be listening on port 80.  If there is a way to control the NK-3G34 using a web browser via the NK-IPS, it would be possible to write a program to interact with it.

    Also, I see that one can connect to the NK-IPS using a terminal, and sending any text followed by a CR/LF results in the NK-IPS responding with the string "Welcome".  Is there a text-based protocol that could allow us to control the NK-3G34 in this way?  I see that various Ross products respond to something called "RossTalk" commands.  Is there a set of commands that the NK-IPS understands?

     



  • 2.  RE: NK router automation
    Best Answer

    Posted 08-26-2020 17:35

    There are several ways that a task could be triggered automatically in DashBoard at a specific time.

    1. If you have a button that you want to trigger with an external program, you can give it a trigger ID.  In panel builder mode, double click on the button, and then in the trigger ID field type a name:

    Once a button has a trigger ID, you can trigger it using TCP messages.

     

    In the DashBoard preferences, you can enable the RossTalk GPI listener, and give it a specific port:

     

    Now, you can trigger that button by sending a TCP message of "GPI <triggerid>" to the specified port.   For example: "GPI switchnk".

    You can also have different panels listening on different ports by specifying a GPI port in the top level abs of the panel (in panel builder mode, double click anywhere empty).

    If you can find a utility to send TCP messages, you can use a cron job to trigger that utility to send a TCP message to DashBoard to trigger your tasks at specific times.

     

    You can also use an ogscript method to run something at a later date.    Here is a grid file that shows how to run a task at a specific time:

     

    <abs contexttype="opengear" gridsize="20" id="_top" keepalive="false" style="">
    <meta>
    <params>
    <param access="1" maxlength="0" name="delay (seconds)" oid="delay" type="STRING" value="15:08:00" widget="time-picker"/>
    </params>
    </meta>
    <label height="60" left="40" name="Running Tasks at Specific Times" style="txt-align:west;size:Bigger;" top="40" width="620"/>
    <label height="20" left="40" name="You can code a task to run at a specific time. See the code in the button for an example." style="txt-align:west;" top="100" width="1100"/>
    <table height="40" left="40" oid="delay" top="160" width="200">
    <tr>
    <label anchor="east" fill="none" insets="0,0,0,5" name="Run task at time:" weightx="0.0"/>
    <param anchor="west" expand="true" fill="both" oid="delay" showlabel="false" weightx="1.0" weighty="1.0"/>
    </tr>
    </table>
    <button buttontype="push" height="40" left="40" name="Run Task" top="200" width="200">
    <task tasktype="ogscript">function runTask() {
    var date = new Date();
    ogscript.rename("message", "task triggered on " + date);
    }

    var date = new Date();
    var time = params.getValue("delay",0);
    var timeArray = time.split(":");
    date.setSeconds(timeArray[2]);
    date.setMinutes(timeArray[1]);
    date.setHours(timeArray[0]);

    var now = new Date();
    var delay = date.getTime()- now.getTime();
    if (delay &lt; 0) {
    ogscript.rename("message", date + " is in the past");
    } else {
    ogscript.rename("message", "running on " + date)
    ogscript.asyncExec(runTask, delay);
    }</task>
    </button>
    <label height="40" id="message" left="260" name="message" style="txt-align:west;bg#dark;" top="160" width="440"/>
    <label height="40" left="260" name="This panel only runs tasks that are later today. It could be enhanced to run tasks at a later date too." style="txt-align:west;" top="200" width="620"/>
    </abs>

     

    Just make a new custom panel, and overwrite its XML with what is pasted above.    If you look at the task in the button, you'll see that you can use ogscript.asyncExec to run a task after a specified delay.   You can calculate that delay based on when you want to run the task.   

     

     

    We also have timers, which can run a task periodically (e.g. every 60 seconds).    You could use one of these tasks to verify something at specific intervals, and trigger something when a certain condition is met.

     

    There are example DashBoard panels here:

    https://support.rossvideo.com/hc/en-us/community/posts/360065970252-Free-DashBoard-Example-Panels-for-Everyone

    There are some on timers, and on running tasks at specified times.

     


    #NK


  • 3.  RE: NK router automation

    Posted 08-26-2020 19:05

    Thank you very much for the careful and thorough response.

    The trigger approach is what we were looking for, as it seems to fit very well with what we already do, so we'll go that route first.  If that does not work as we expect, we'll come back to this and explore the timer option.

    Thanks again for your help.


    #NK