Facility Control

 View Only
  • 1.  Telnet Control

    Posted 06-21-2018 12:34
    Trying to control a Contigo 2 lighting console that really only accepts Telnet commands. I've seem some discussion here on controlling a BM Videohub using TelNet but I'm unfortunately a little lost. Unlike UDP/TCP my understanding is that Telnet has some negotiation that needs to be done to open a session, how could this be done? Here's an example API command that just sets a fixtures intensity to 100%

    API.SetLevel('2','100')

    Thanks in advance!


  • 2.  RE: Telnet Control

    Posted 06-21-2018 15:09
    I guess I can also do this through applescript with terminal, but how can you execute an applescript via dashboard?
    #DashBoard


  • 3.  RE: Telnet Control

    Posted 06-21-2018 15:28

    Frequently, a 'telnet command' interface is simply a raw socket connection and you can just fire the command with rosstalk.sendMessage(HOST, PORT, MESSAGE);

    If the device requires a username/password, you may be able to use rosstalk.sendMessage(HOST, PORT, 'USERNAME\r\nPASSWORD\r\nMESSAGE\r\n');

    If you did want to use AppleScript, you'd need to run the DashBoard panel on your Mac. Here is an example panel that we have shared in the past for people trying to achieve this:

    <abs contexttype="opengear" style="">
       <meta>
          <api>function runAppleScript(applescriptCommand)
    {
       var runtime = java.lang.Runtime.getRuntime();
       var args = ["osascript", "-e", applescriptCommand];
       var process = runtime.exec(args);
    }
    </api>
       </meta>
       <button buttontype="push" height="162" left="22" name="Run Apple Script (for iTunes)" top="21" width="304">
          <task tasktype="ogscript">var applescriptCommand =  "tell app \"iTunes\"\n" + 
                                "activate\n" +
                                "set sound volume to 80\n" + 
                                "set EQ enabled to true\n" +
                                "play\n" +
                              "end tell";
    
    runAppleScript(applescriptCommand);
    </task>
       </button>
    </abs>

    #DashBoard


  • 4.  RE: Telnet Control

    Posted 06-21-2018 15:41
    Thanks James, No username/password so we should be good there. I've tried the rosstalk with the host port message as follows

    rosstalk.sendMessage('10.45.13.181', 11123, 'API.SetLevel('2','100')');

    but I haven't gotten it to work, is there something glaringly obvious I'm missing here?
    #DashBoard


  • 5.  RE: Telnet Control

    Posted 06-21-2018 16:03
    Figured it out! have to change parenthesis to slashes....
    #DashBoard


  • 6.  RE: Telnet Control

    Posted 06-21-2018 21:39
    Your other option would be to use double quotes:
    rosstalk.sendMessage("10.45.13.181", 11123, "API.SetLevel('2','100')");
    #DashBoard