Knowledge Base

The help command can be used in the console to show help for whatever commands you can give in the console.

To use the help command, you type help (command name). You can also type help * to see the help description for every command available, in alphabetical order.

The PS command allows you to view all application running and a process number next to it. This is useful to view if applications are running on start up, or if you have to manual start them. You can also type ps -v to get more detailed information on the processes running.

The KILL Command allows you to terminate a program running from your list of processes. To kill a process on your JNIOR, you’ll type kill (process number) or kill(process name). This is useful to stop program from running on your JNIOR, without rebooting. The example below stops analog presets from running because its process number is 3.

The Extern Command is used to help you see and/or remove modules that you have setup to use with your JNIOR.

Typing Extern into the Console on the JNIOR Web Page will display all currently configured modules on your JNIOR, as shown below.

You can also use the extern -r command to remove whatever modules you currently have connected to your JNIOR, as shown below. The first line returned from the extern command is what you get when a module is plugged in. The second line from the extern command is what you see when its not plugged in, notice that the configuration has not been removed even though the module has been unplugged. The last line after the extern -r command removes the configuration that was still there, letting you replug the same module or a different one.

If you receive this error after establishing a serial connection, its because the operating system detected an error in the flash file system on boot. The flash was not mounted to protect the file system from any further damage.

To resolve this issue we need to reformat the flash. You can follow the steps below to reformat the flash and reload the unit. If you need to save any files out of flash we can temporarily mount it. If you don’t then you can skip to step 3.

1. jrflash -z

This will force the operating system to mount the flash temporarily so that you can recover any needed files. The macro and devices files should also be in RAM at the root of the filesystem.

2. FTP

You can use FTP to recover any files from the flash file system. Applications will be loaded using the update packages from the website. Files may or may not be available depending on where the corruption is in the filesystem structure.

3. jrflash -f

This will reformat the flash filesystem. Everything will be lost.

4. Run the 1.8 All In One

This will reload all of the files that are loaded when we ship the unit.

5. Run any additional update projects to get the applications running that you depend on.

6. FTP

Use FTP to restore any files that you saved in step 2.

The procedure above will get the unit running again. If you need any additional help or questions, just let us know!

Analog Presets is an application that lets control and automate expansion modules such as 4-20ma Module, the 10v Module, or the 3 channel LED module. To get started, you’ll want to download the analog presets application from the all downloads page on integpg.com. After updating your JNIOR with the application, you’ll want to go to the URL containing the IP of your JNIOR with /analogpresets after it to access the application on your JNIOR.

Here you can add levels containing different commands you want to create for your modules. You can name the command, what you want it to do, how long it should last, and if you want other commands to start once it starts or finishes. You can also use these as macros by defining a port number and termination string on the general tab.

To monitor the environment you will need 3 things. First, a sensor that provides the environmental condition you are looking to monitor. Second, an application that will read that sensor and log the values. Third, a way to view that data.

INTEG resells an environmental sensor from Embedded Data Systems. The sensor itself wont work directly with the JNIOR until it is wired. They have several different models that provide different environmental metrics. Temperature and humidity have been the consistent requests. INTEG also sells a rugged external sensor that tracks just temperature.

Set Up

To start, you’ll want to connect the Temp & Humidity Sensor to the JNIOR through the sensor port. After that, you’ll use the grapher application to monitor the sensor. You’ll also want the SNAP application. Here is a link to both:

You’ll want to do an update project one at a time, publishing these to the JNIOR you have the sensor connected to. After that, to get to the Grapher application, you’ll type (JNIOR’s IP)/Grapher into the URL and it will take you to the application. There you can create the graph to monitor your Temperature. 

Once on the Grapher application page, you’ll want to enter settings to create a graph. To start, you can go down to the Graphs section and add a graph.

Here at the top you can create the chart name, and then set the range of the chart and also the time range being charted. Below that you can create the lines that go into the graph that are tracked. You can add their names, what the units they are measured in are called, and the color of the line. After that you can add a file that will be monitored to create the graph.

Here you can define the directory path of the file you want monitored. The columns are the lines that you defined in the Graphs section. The Date format can be set to MM-DD-YY HH:mm:ss.SSS. The file count is specified to how many files you have added. Once this is all set you’ll now want to open the snap application by typing in the URL (JNIOR’s IP)/snap. This is to pull information for the graph you want to crate.

Like in the picture above, you’ll want to pull a block function into the block area, and name it. The one in the example is called temp_logs. Then the filename is defined as the one you named in the file section in Grapher. (The date.format part of the file name auto inputs the date when creating the file). The Text is defined as separate values that will act as the lines we created in the graph section of Grapher. So you will only have text values equal to the amount of different lines in the graph your creating.

The values need to be labeled as this in order from top to bottom from Grapher, {{env_[1].fahrenheit}}, {{env_[1].humidity}}. These text values represent one module getting humidity and Fahrenheit. How the text values work is, the double squiggly brackets and comma between each value are needed to separate each value. The env_ is what you have to preface each value with in the text. The “.fahrenheit” has to be replaced with “.celcius”, “.humidity”, or each words first letter like “.f”, “.c”, or “.h” depending on what type of value you are trying to monitor. The number surrounded by brackets represents which module is getting that value so if you only have on module you’d label every bracket with a 1.

As for commands, you can use the extern command to tell you what modules you have connected, and the extern -r command to remove a module on your device to switch to another.

After you define those text values, you’ll want to pull a loop block into the block area. You’ll change the name to the name of the function we just created, and then you can set every time it adds information to the chart. Then you’ll go back to the functions tab and add the function we created into the loop block. Once that is done you should be able to go back to the main Grapher page and see your graph updating with information. Keep in mind that if you ever want more then one graph to be able to display, when creating multiple files in the Grapher configuration page, make sure you also create the blocks for them in snap.

Sometimes an application wont run on a JNIOR Series 3 unit.  This issue may be due to “insufficient heap“.

This error message means that there was not enough contiguous space in “heap” or the SRAM memory for the application.  The application must find contiguous memory of at least the file size of the application.  Once the application finds that space it will stay in that same space until the application is updated.  The memory can become fragmented over time since the SRAM is used for application executables, application memory and the root file system.

Most likely this error condition will occur after updating to a new version of an application.  If the new application is larger than the old application it cannot occupy the same contiguous block in memory.  It must find a new contiguous block.  That space may not be available depending on the fragmentation of the memory. Even if there is a contiguous block of memory large enough when the file is updated, it still might give you an “insufficient heap” error. This might happen because until its run as an executable, the file doesn’t know it needs to be stored as contiguous space and fragment its memory anyways, which would then cause the error.

The fragmentation is caused by file blocks that have become scattered throughout memory over time.  To clear up the fragmentation we could delete a file at a time until a contiguous block has become available.  This would be a very slow approach.  You would not know which file gives you the best chance of finding a contiguous block.  Since the root of the file system contains mostly log files we can just clear the heap on a reboot.  In order to that we execute the reboot -a command.

What about my cinema devices and macros files?

The cinema files are automatically backed up to flash/cinema_backup.  This location is not affected by the reboot -a.  The cinema files will be restored next time cinema runs.

If you experience issues with your Dolby IMS2000 Cinema Server connecting to or executing commands on the JNIOR you may need to follow one of the procedures below. There are two issues that I have seen.

Dolby has resolved the issue for the IMS3000.

A Dolby may not even try to connect to a JNIOR when it should.

Make sure you have rebooted the Dolby IMS after adding the JNIOR as a device.

To determine if this is the issue:

  1. Go to the DCP for the JNIOR
  2. Click on the Console tab
  3. Click ‘Start Session’
  4. Log in when prompted
  5. enter the netstat command
  6. There should be a connection to 9200 with the Dolby Server IP Address for the Remote IP

The Dolby is connected but nothing happens on the JNIOR when the Dolby sends the command.

When Dolby tries to connect to the JNIOR it may not be able to log in to the JNIOR due to a bad password. The highlighted bytes below are corrupted.

The bytes should represent the password like this…

The previous images are screenshots for the WireShark application when analyzing a network capture. This capture is included in a JNIOR Support Tool Snapshot. I have been told by Dolby that this is likely due to the browser auto-fill.

To determine if this is the issue you should check the protocol.log on the JNIOR

To do that:

  1. Go to the DCP for the JNIOR
  2. Click on the Console tab
  3. Click ‘Start Session’
  4. Log in when prompted
  5. Enter the cat protocol.log command

If you see the failed login then do the following:

  1. Go to the JNIOR Device Configuration on the Dolby IMS
  2. Remove the JNIOR device
  3. Reboot the Dolby IMS
  4. Add the JNIOR as a device but DO NOT enter the password
  5. Reboot the Dolby IMS

You can now re-test the JNIOR connection to see if this is resolved.

If it is not resolved then make sure your browser is not using auto-fill for the site. The procedure differs per browser. Follow one of the links below for your browser.

If it is not resolved you can try to analyze the network capture or contact INTEG for additional support.

I hope this article helped you out. Please contact us to let us know!

The reboot command is used to restart the JNIOR. When a reboot is called on a JNIOR it kills all the applications its running, and then if any have a run key, those applications boot back up once its restarted. It will also disconnect and reconnect all connections on a JNIOR.

The reboot command has multiple options along with it. The first one is -A which cleans system and heap memory on reboot. -F will not prompt a confirmation and immediately do a reboot of the JNIOR. There is also a another command for a reboot that will not appear in the help command of reboot. If you type -eraseall with reboot, it will factory restart a JNIOR deleting any information that wasn’t already on them when they were first received.

A normal reboot usually fixes a lot of temporary problems the JNIOR is confronting. The -eraseall command should be used with lots of caution, as you lose everything you’ve done on the JNIOR since its been received.

The following information describes how to use the JNIOR to capture data on the Ethernet network and the JNIOR Serial ports. Capturing the data can be a great troubleshooting technique for communicating with various devices.

The Netstat command on the JNIOR Series 4 has multiple functions and some of them are very helpful when trying to troubleshoot a network connection via the Ethernet network.

The standard Netstat command will list all the TCP ports that are listening on the JNIOR and indicate any connections made.

Typing help netstat will show all the different options you can use with netstat.

The -C, -R, and -F options are great for getting, resetting, and filtering a file of the packets being sent on the TCP ports. This file can opened in wireshark so you can better view the information being sent back and forth on each port.

There is a chance you will see the following PHP error. For this to be seen you must have a Series 4 JNIOR that had JANOS version 1.6 or older and you just updated to a new JANOS version

Why did this happen?

The older JNIORs had a different web page than we have now. The main web page used to be served out of the flash/www folder. Now the DCP, the newer web page, is served out of the flash/www.zip file. If the flash/www/index.php file is still found then the web server will process it and serve it instead of the index.php in the www.zip file.

How do we fix it?

To fix this we need to remove the old flash/www/index.php file. This will allow JANOS to look in the flash/www.zip file. This should be a step in the All-In-One update project. You can do it manually with a Telnet connection like this…

This post explains how to send and receive messages from a System Message Pump. There is a previous post showing how to create a System Message Pump that you can access here. Please look over that post first as this one uses code from and references that post. 

After creating a Message Pump program from the previous System Message Pump sample, the next step is to create and receive messages between two different programs. To start, we can create a new program that will interact with the previous System Message Pump program. We’ll call this program our PostMessage program. This sample program only has two messages it can send, but could be edited to add more. These messages will also only pulse output relays but can be edited to do a lot of other actions as well.

import com.integpg.system.JANOS;
import com.integpg.system.SystemMsg;
import com.integpg.system.MessagePump;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Json;

public class CommunicationPost2 {

    //This funciton decides from the user input it gets whether or not the program should post another message or close the program.
    //The only message you can create is message 1300
    public static int getresponse(MessagePump closesPump) throws IOException {

        String type = "";
        BufferedReader reading = new BufferedReader(new InputStreamReader(System.in));
        int testtype = 0;
        boolean running = true;
        boolean typecheck = false;

        while (running == true) {

            System.out.println("\nPlease enter a System Pump command. Type 'create' to make a command. Type 'finished' when done.\n");
            String choice = reading.readLine();
            System.out.println("|" + choice + "|");

            switch (choice) {

                case "finished":
                    System.out.println("Finishing program...\n");
                    System.out.println();
                    closesPump.close();
                    System.out.println();
                    System.exit(0);

                case "create":
                    System.out.println();
                    System.out.println("\nPlease enter the type number\n");
                    System.out.println();
                    while (typecheck == false) {
                            type = reading.readLine();
                            try{
                            testtype = Integer.parseInt(type);
                            typecheck = true;
                            }
                            catch (NumberFormatException e) {
                                System.out.println("\nIncorrect input. Try again\n");
                            }
                    }
                    return testtype;

                default:
                    System.out.println("\nBad input. Try again.\n");
            }
        }
        return testtype;
    }

    //adds a value to the Json object that we be sent as part of the message to the other program
    public static Json addToJson(Json gettingJson, String value, Object jsonvalue) {

        gettingJson.put(value, jsonvalue);
        return gettingJson;

    }

    //creates the message that will be sent to the other program to complete
    public static SystemMsg createMessage(int messagetype, byte[] messageinfo) {

        SystemMsg newMsg = new SystemMsg();
        newMsg.type = messagetype;
        newMsg.msg = messageinfo;
        System.out.println(newMsg);
        return newMsg;

    }

    //completes the message 1301 if it was sent from the other program
    public static void completeMessage1301(String recievedJsonInfo) {

        Json holdinginfo = new Json(recievedJsonInfo);
        String[] arrayofkeys = holdinginfo.keyarray();
        int togglecheck = holdinginfo.getInt(arrayofkeys[0]);
        int channelscheck = holdinginfo.getInt(arrayofkeys[1]);
        int durationcheck = holdinginfo.getInt(arrayofkeys[2]);
        System.out.println(arrayofkeys[0] + ": " + togglecheck + ", " + arrayofkeys[1] + ": " + channelscheck + ", " + arrayofkeys[2] + ": " + durationcheck);
        try {
            JANOS.setOutputPulsed(togglecheck, channelscheck, durationcheck);
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }

    public static Json getInfoToJson() throws IOException {

        Json newJson = new Json();
        String tempduration = "";
        String tempchannels = "";
        String temp_O_or_C = "";
        boolean successcheck1 = false;
        boolean successcheck2 = false;
        boolean successcheck3 = false;
        BufferedReader reading = new BufferedReader(new InputStreamReader(System.in));
        System.out.println("\nThis is for toggling pulse outputs.\n");
        System.out.println("\nPlease enter if which channels you are pulsing: ' 1 - 255'\n");

        while (successcheck1 == false) {
            try {
                temp_O_or_C = reading.readLine();
                successcheck1 = true;
            } catch (IOException | NumberFormatException e) {
                System.out.println("\nIncorrect format, try again.\n");
            }
            if (successcheck1 == true) {
                int O_or_C = Integer.parseInt(temp_O_or_C);
                newJson = addToJson(newJson, "Pulse", O_or_C);
            }
        }

        System.out.println("\nPlease enter what channels: '1 - 255'\n");
        while (successcheck2 == false) {
            try {
                tempchannels = reading.readLine();
                successcheck2 = true;
            } catch (IOException | NumberFormatException e) {
                System.out.println("\nIncorrect format, try again.\n");

            }
            if (successcheck2 == true) {
                int channels = Integer.parseInt(tempchannels);
                newJson = addToJson(newJson, "Channels", channels);
            }
        }

        System.out.println("\nPlease enter duration in milliseconds:\n");
        while (successcheck3 == false) {
            try {
                tempduration = reading.readLine();
                successcheck3 = true;
            } catch (IOException | NumberFormatException e) {
                System.out.println("\nIncorrect format, try again.\n");
            }
            if (successcheck3 == true) {
                int duration = Integer.parseInt(tempduration);
                newJson = addToJson(newJson, "Duration", duration);
            }
        }

        return newJson;

    }

    public static void main(String[] args) throws IOException, InterruptedException {

        MessagePump MESSAGE_PUMP = new MessagePump();

        MESSAGE_PUMP.open();

        while (true) {

            boolean checkmsg = false;

            int fixedtype = getresponse(MESSAGE_PUMP);

            if (fixedtype == 1300) {

                Json firstJson = getInfoToJson();
                SystemMsg systemMsg = createMessage(fixedtype, firstJson.toString().getBytes());
                MESSAGE_PUMP.postMessage(systemMsg);
                System.out.println();
            }

            while (checkmsg == false) {

                SystemMsg msgRecieved = MESSAGE_PUMP.getMessage(1301);

                if (msgRecieved.type == 1301) {
                    System.out.println("Message 1301 recieved, pulsing output 1.");
                    String jsoninfo2 = new String(msgRecieved.msg);
                    completeMessage1301(jsoninfo2);
                    checkmsg = true;
                }

            }

        }

    }

}

This PostMessage program will create a message that, after getting inputs from the user, will be sent to the previously created System Message Pump program. The program starts by asking the user if they wish to create a message or close the program, then calling the “getresponse” function to initiate whichever the user chooses.

    public static int getresponse(MessagePump closesPump) throws IOException {

        String type = "";
        BufferedReader reading = new BufferedReader(new InputStreamReader(System.in));
        int testtype = 0;
        boolean running = true;
        boolean typecheck = false;

        while (running == true) {

            System.out.println("\nPlease enter a System Pump command. Type 'create' to make a command. Type 'finished' when done.\n");
            String choice = reading.readLine();
            System.out.println("|" + choice + "|");

            switch (choice) {

                case "finished":
                    System.out.println("Finishing program...\n");
                    System.out.println();
                    closesPump.close();
                    System.out.println();
                    System.exit(0);

                case "create":
                    System.out.println();
                    System.out.println("\nPlease enter the type number\n");
                    System.out.println();
                    while (typecheck == false) {
                            type = reading.readLine();
                            try{
                            testtype = Integer.parseInt(type);
                            typecheck = true;
                            }
                            catch (NumberFormatException e) {
                                System.out.println("\nIncorrect input. Try again\n");
                            }
                    }
                    return testtype;

                default:
                    System.out.println("\nBad input. Try again.\n");
            }
        }
        return testtype;
    }

If the user decides to create a message, it will call a function called “getInfoToJson”. This will gather information to form a Json object. The first two values are from 1 – 255 to represent the 8 outputs in bit values, and the last value is time in milliseconds. The “getInfoToJson” function will call the “addToJson” function to create the Json object “getInfoToJson” will return. 

public static Json getInfoToJson() throws IOException {

        Json newJson = new Json();
        String tempduration = "";
        String tempchannels = "";
        String temp_O_or_C = "";
        boolean successcheck1 = false;
        boolean successcheck2 = false;
        boolean successcheck3 = false;
        BufferedReader reading = new BufferedReader(new InputStreamReader(System.in));
        System.out.println("\nThis is for toggling pulse outputs.\n");
        System.out.println("\nPlease enter if which channels you are pulsing: ' 1 - 255'\n");

        while (successcheck1 == false) {
            try {
                temp_O_or_C = reading.readLine();
                successcheck1 = true;
            } catch (IOException | NumberFormatException e) {
                System.out.println("\nIncorrect format, try again.\n");
            }
            if (successcheck1 == true) {
                int O_or_C = Integer.parseInt(temp_O_or_C);
                newJson = addToJson(newJson, "Pulse", O_or_C);
            }
        }

        System.out.println("\nPlease enter what channels: '1 - 255'\n");
        while (successcheck2 == false) {
            try {
                tempchannels = reading.readLine();
                successcheck2 = true;
            } catch (IOException | NumberFormatException e) {
                System.out.println("\nIncorrect format, try again.\n");

            }
            if (successcheck2 == true) {
                int channels = Integer.parseInt(tempchannels);
                newJson = addToJson(newJson, "Channels", channels);
            }
        }

        System.out.println("\nPlease enter duration in milliseconds:\n");
        while (successcheck3 == false) {
            try {
                tempduration = reading.readLine();
                successcheck3 = true;
            } catch (IOException | NumberFormatException e) {
                System.out.println("\nIncorrect format, try again.\n");
            }
            if (successcheck3 == true) {
                int duration = Integer.parseInt(tempduration);
                newJson = addToJson(newJson, "Duration", duration);
            }
        }

        return newJson;

    }

Then it will call the “createMessage” function to get the ID and information of the message that we are going to send.

public static SystemMsg createMessage(int messagetype, byte[] messageinfo) {

        SystemMsg newMsg = new SystemMsg();
        newMsg.type = messagetype;
        newMsg.msg = messageinfo;
        System.out.println(newMsg);
        return newMsg;

    }

After this message is sent, it will be received from an edited version of the System Message Pump program and then send a certain message. The code for the edited Engine Pump file of the System Message Pump program is below.

import com.integpg.system.JANOS;
import com.integpg.system.MessagePump;
import com.integpg.system.SystemMsg;
import java.io.IOException;
import java.util.Json;
import java.util.Vector;

public class MessagePumpEngine implements Runnable {

    private static final MessagePumpEngine THIS = new MessagePumpEngine();
    private static final MessagePump MESSAGE_PUMP = new MessagePump();
    private static final Vector LISTENERS = new Vector<>();

    private static Thread _thread;

    /**
     * Singleton constructor
     */
    private MessagePumpEngine() {
    }

    /**
     * adds a listener that will be alerted of all received messages. The
     * listener will be responsible for determining if the message has meaning
     * to them
     *
     * @param listener
     */
    public static void addListener(MessagePumpListener listener) {
        synchronized (LISTENERS) {
            LISTENERS.addElement(listener);
        }
    }

    /**
     * starts our message pump engine.
     */
    static void start() {
        if (null == _thread) {
            _thread = new Thread(THIS);
            _thread.setName("message-pump-engine");
            _thread.setDaemon(true);
            _thread.start();
        }
    }
    
    //completes the message 1300 after being sent from the other application
    
    public static void completeMessage1300 (String recievedJsonInfo) {
        
        Json holdinginfo = new Json(recievedJsonInfo);
        String[] arrayofkeys = holdinginfo.keyarray();
        int togglecheck = holdinginfo.getInt(arrayofkeys[0]);
        int channelscheck = holdinginfo.getInt(arrayofkeys[1]);
        int durationcheck = holdinginfo.getInt(arrayofkeys[2]);
        System.out.println(arrayofkeys[0] + ": " + togglecheck + ", " + arrayofkeys[1] + ": " + channelscheck + ", " + arrayofkeys[2] + ": " + durationcheck);
        try {
            JANOS.setOutputPulsed(togglecheck, channelscheck, durationcheck);
        } 
        catch (IOException ex) {
            ex.printStackTrace();
        }
    }
    
    //creates the message that will be sent to the other program to complete
    
    public static SystemMsg createMessage (int messageType, byte [] messageInfo) {
        
        SystemMsg returnMsg = new SystemMsg();
        returnMsg.type = messageType;
        returnMsg.msg = messageInfo;
        
        System.out.println(returnMsg);
        return returnMsg;
        
    }
    
    //adds a value to the Json object that we be sent as part of the message to the other program
    
    public static Json addToJson(Json Jsonadd, String valuename, Object jsonvalue) {
    
        Jsonadd.put(valuename, jsonvalue);
        return Jsonadd;
        
    }
    
    @Override
    public void run() {
        System.out.println("open the message pump and start monitoring.\r\n");
        MESSAGE_PUMP.open();

        for (;;) {
            // read all messages from the message pump
            SystemMsg systemMsg = MESSAGE_PUMP.getMessage();

            // we must repost as fast as we can
            MESSAGE_PUMP.postMessage(systemMsg);

            // notify all of our listeners

            if (systemMsg.type == 1300) {

                System.out.println();
                System.out.println("Recieved command 1300, pulsing output. Sending another command.\n");
                String jsoninfo = new String(systemMsg.msg);
                completeMessage1300(jsoninfo);
                Json thirdjson = new Json();
                addToJson(thirdjson, "setclose", 1); 
                addToJson(thirdjson, "settingchannel", 1);
                addToJson(thirdjson, "timeset", 5000);
                SystemMsg returnMsg = createMessage(1301, thirdjson.toString().getBytes());
                MESSAGE_PUMP.postMessage(returnMsg);                

            }

        }

    }

    /**
     * Exposes the postMesssage method of the System MessagePump
     *
     * @param msg the message the will be sent to the system message pump
     */
    public static void postMessage(SystemMsg msg) {
        MESSAGE_PUMP.postMessage(msg);
    }

}

When this file of code replaces the engine pump file in the System Message Pump program, there is a loop that will be listening for the message sent from our previous program with the message type of 1300. After it receives that message, it will create a string from all of the message’s info, and then call the “completeMessage1301” function to pulse the correct outputs. Once the program does that, it will then use the “createMessage” function to create another message for the PostMessage program to read. There is another loop for the listeners to read that message when its sent as well.

public void run() {
        System.out.println("open the message pump and start monitoring.\r\n");
        MESSAGE_PUMP.open();

        for (;;) {
            // read all messages from the message pump
            SystemMsg systemMsg = MESSAGE_PUMP.getMessage();

            // we must repost as fast as we can
            MESSAGE_PUMP.postMessage(systemMsg);
            

            if (systemMsg.type == 1300) {

                System.out.println();
                System.out.println("Recieved command 1300, pulsing output. Sending another command.\n");
                String jsoninfo = new String(systemMsg.msg);
                completeMessage1300(jsoninfo);
                Json thirdjson = new Json();
                addToJson(thirdjson, "setclose", 1); 
                addToJson(thirdjson, "settingchannel", 1);
                addToJson(thirdjson, "timeset", 5000);
                SystemMsg returnMsg = createMessage(1301, thirdjson.toString().getBytes());
                MESSAGE_PUMP.postMessage(returnMsg);

                    }
                }

            }

        }

    }

This will have us go back to the PostMessage program to receive the message the Engine Pump file sent back. The PostMessage program calls the completeMessage1301 function to grab the values from the message and pulse the correct outputs. After that, the program will loop back to the beginning and re-prompt the user if they want to create or finish the program, and repeat this process until the user decides to finish the program.

 while (checkmsg == false) {

                SystemMsg msgRecieved = MESSAGE_PUMP.getMessage(1301);

                if (msgRecieved.type == 1301) {
                    System.out.println("Message 1301 recieved, pulsing output 1.");
                    String jsoninfo2 = new String(msgRecieved.msg);
                    completeMessage1301(jsoninfo2);
                    checkmsg = true;
                }

            }

The JNIOR Support Tool will allow foreign characters in the filenames for macro and device files. Here is a quick video showing how to delete them.

1. Create a console session.
2. login
3. type rm mac
4. Then press tab

The JNIOR will fill in the name of the macro file.  In your case, press tab until you get the file with the offending name.

5. Then use the left arrow key to go back and insert a quote at the beginning of the file name

6. Press enter

You can then go back to the folders tab to see that the file is gone.

Repeat the same steps for the “macro file not found.log” file.

If the JNIOR series 4, models 410, 412 or 414, is not working with the GDC then check to make sure MODBUS is enabled. The built-in library for the JNIOR on the GDC server uses MODBUS.

The series 3 enabled the MODBUS server by default. The MODBUS server is an optional application that needs to be enabled on the series 4. You can look at the following links for more information

The iBoot device from dataprobe is a Web Enabled Power Switch. We can command the devices by issuing HTTP Requests. To do this we will add an iBoot device to the Devices file and add “Power On” and “Power Off” actions to the Macro file. We then associate the actions with macros. We might want separate macros for power on, power off and power cycle.

To create the iBoot device in the devices file go to the Devices tab in the JNIOR Support Tool. Then in the lower left click ‘Add’. Then fill out the information as follows. This device can be added to an existing devices file or a new one. We are going to use the HTTP Request device type.

Then click over to the Macro tab and click on Link Devices. This will link the devices file so that the configured devices are available to create macro actions.

Now click ‘Add’ below the Macro Action View. You can rename the action. Click in the Device column for the new Action and scroll to the bottom to select your linked device. Select the iBoot device. Now click on Action and select “GET”. In the data field enter the resource portion of the URL””. It should look like this… Remember to enter the username and password if needed.

You can now add the action to any macro by selecting both the macro you wish to add it to and the new iBoot action.s Then use the <- button between the two views like this…

He is an example that will make a HttpGet request and logging the response. The response text is printed to the screen and captured to a file. An human readable format of the bytes are also logged to a file

package httprequesttest;

import com.integpg.system.JANOS;
import java.io.FileOutputStream;
import java.io.IOException;

public class HttpRequestTest {

    public static void main(String[] args) {
        System.out.println("args.length: " + args.length);

        if (0 < args.length) {
            try {
                //
                // get the server hostname from the command line arguments
                String hostname = args[0];
                String serviceName = args[1];
                String paramsString = "";
                if (3 == args.length) paramsString = args[2];

                //
                // define our get job status request
                String urlString = String.format("http://%s/%s?%s", hostname, serviceName, paramsString);
                System.out.println("Testing call to " + urlString);

                //
                // define our http object and perform the request
                HttpURL url = new HttpURL(urlString);
                HttpRequest httpRequest = new HttpRequest(url);
                HttpResponse httpResponse = httpRequest.sendRequest();
                httpResponse.processResponse();
                String response = httpResponse.getData();

                //
                // print the response and toss the response in a file
                System.out.println("httpResponse: " + response);
                writeAllBytes("response.txt", response.getBytes());
                writeAllBytes("response.bin", hexDump(response.getBytes()).getBytes());
            } catch (IOException ex) {
                ex.printStackTrace();
            }

        } else {
            System.out.println("a url must be supplied");
        }
    }


/**
 * HELPER FUNCTIONS
 */
    public static void writeAllBytes(String filename, byte[] bytes) throws IOException {
        FileOutputStream fos = null;
        try {
            fos = new FileOutputStream(filename);
            fos.write(bytes);
            fos.flush();
        } catch (Exception ex) {
            JANOS.syslog("writeAllBytes to " + filename + " threw " + ex.getMessage(), JANOS.SYSLOG_ERROR);
        } finally {
            try {
                if (null != fos) fos.close();
            } catch (IOException ex1) {
                ex1.printStackTrace();
            }
        }
    }

    public static final char[] LowerHexArray = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };



    public static String hexDump(byte[] bytes) {
        return hexDump(bytes, 0, bytes.length);
    }



    public static String hexDump(byte[] bytes, int offset, int length) {
        StringBuilder sb = new StringBuilder((length / 16 + 1) * 83);

        char[] line = new char[81];
        line[0] = '0';
        line[1] = 'x';
        line[line.length - 2] = '\r';
        line[line.length - 1] = '\n';

        int endAddress = offset + length;
        for (int lineAddress = offset - (offset % 16); lineAddress < endAddress; lineAddress += 16) {
            int charPos = 2;
            line[charPos++] = LowerHexArray[(lineAddress >> 12 & 0x0F)];
            line[charPos++] = LowerHexArray[(lineAddress >> 8 & 0x0F)];
            line[charPos++] = LowerHexArray[(lineAddress >> 4 & 0x0F)];
            line[charPos++] = LowerHexArray[lineAddress & 0x0F];
            line[charPos++] = ' ';
            line[charPos++] = ' ';
            line[charPos++] = ' ';

            for (int linePos = 0; linePos < 16; linePos++) {
                int address = lineAddress + linePos;
                if (address < offset) {
                    line[charPos++] = ' ';
                    line[charPos++] = ' ';
                    line[charPos++] = ' ';
                } else if (address < endAddress) {
                    int c = bytes[address];
                    line[charPos++] = LowerHexArray[(c >> 4 & 0x0F)];
                    line[charPos++] = LowerHexArray[c & 0x0F];
                    line[charPos++] = ' ';
                } else {
                    line[charPos++] = ' ';
                    line[charPos++] = ' ';
                    line[charPos++] = ' ';
                }

                if (7 == linePos) {
                    // add 2 spaces between each group of 8 bytes
                    line[charPos++] = ' ';
                    line[charPos++] = ' ';
                }
            }
            // add 3 spaces between the second group of 8 bytes and the ASCII output
            line[charPos++] = ' ';
            line[charPos++] = ' ';
            line[charPos++] = ' ';

            for (int linePos = 0; linePos < 16; linePos++) {
                int address = lineAddress + linePos;

                if (address < offset) line[charPos++] = ' ';
                else if (address < endAddress) {
                    char c = (char) bytes[address];
                    if (0x20 > c || 0x80 <= c) line[charPos++] = '.';
                    else line[charPos++] = c;
                } else line[charPos++] = ' ';
                if (7 == linePos) line[charPos++] = ' ';
            }

            sb.append(line, 0, line.length);
        }

        return sb.toString();
    }
}

HttpRequest.java

package httprequesttest;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.InetAddress;
import java.net.Socket;
import java.net.SocketException;
import java.util.Enumeration;
import java.util.Hashtable;

public class HttpRequest {

    private final HttpURL _url;
    private Socket _socket;
    private String _type = "GET";
    private byte[] _data;
    private final Hashtable<String, String> _userHeaders = new Hashtable<String, String>();



    public HttpRequest(HttpURL url) {
        _url = url;
    }



    public String getRequestMethod() {
        return _type;
    }



    public void setRequestMethod(String type) {
        _type = type;
    }



    public void addHeader(String name, String value) {
        _userHeaders.put(name, value);
    }



    public void setData(byte[] data) {
        _data = data;
    }



    public HttpResponse sendRequest() throws IOException {
        InetAddress resolvedAddress = InetAddress.getByName(_url.getHost());
        _socket = new Socket(resolvedAddress.getHostAddress(), _url.getPort());
        _socket.setSoTimeout(15000);

        if (-1 != _url.toString().toLowerCase().indexOf("https")) {
            System.out.println("set secure");
            _socket.setSecure(true);
        }

//        System.out.print("Request:\r\n");
        sendHeaders();
        if (null != _data) {
            sendData();
        }

        return new HttpResponse(this);
    }



    private void sendHeaders() throws IOException {
        OutputStream out = getOutputStream();
        String headers
                = _type + " /" + _url.getFile() + _url.getQuery() + " HTTP/1.1\r\n"
                + "Host: " + _url.getHost() + "\r\n"
                + "Connection: close\r\n"
                + "Pragma: no-cache\r\n"
                + "Cache-Control: no-cache\r\n";

        if (null != _data) {
            headers += "Content-Length: " + _data.length + "\r\n";
        } else {
            headers += "Content-Length: 0\r\n";
        }

        if (0 < _userHeaders.size()) {
            Enumeration headerEnumeration = _userHeaders.keys();
            while (headerEnumeration.hasMoreElements()) {
                String name = (String) headerEnumeration.nextElement();
                String value = _userHeaders.get(name);
                headers += name + ": " + value + "\r\n";
            }
        }

        out.write((headers + "\r\n").getBytes());
        out.flush();
    }



    private void sendData() throws IOException {
        if (null != _data) {
            OutputStream out = getOutputStream();
            out.write(_data);
            out.flush();
        }
    }



    public OutputStream getOutputStream() throws SocketException, IOException {
        if (_socket == null) throw new SocketException("Socket not yet connected");
        return _socket.getOutputStream();
    }



    public InputStream getInputStream() throws SocketException, IOException {
        if (_socket == null) throw new SocketException("Socket not yet connected");
        return _socket.getInputStream();
    }



    public void close() throws IOException {
        if (null != _socket) {
            System.out.println("close HTTPRequest");
            if (null != getInputStream()) getInputStream().close();
            if (null != getOutputStream()) getOutputStream().close();
            _socket.close();
        }
    }

}

We can command the Nagra myCinema player to start playing its content. To do this we will add a myCinema device to the Devices file and a “Play” action to the Macro file. We then associate the “Play” Action with a macro. It’s that easy!

To create the myCinema device in the devices file go to the Devices tab in the JNIOR Support Tool. Then in the lower left click ‘Add’. Then fill out the information as follows. This device can be added to an existing devices file or a new one. We are going to use a RAW ETHERNET device so that we can send any command we want. The command is a simple text string.

Then click over to the Macro tab and click on Link Devices. This will link the devices file so that the configured devices are available to create macro actions. Now click ‘Add’ below the Macro Action View. You can rename the action. Click in the Device column for the new Action and scroll to the bottom to select your linked device. Select the myCinema device. Now click on Action and select Send. In the data field enter “play”. It should look like this…

You can now add the action to any macro by selecting both the macro you wish to add it to and the new myCinema action. Then use the <- button between the two views like this…

The Cinema application for the JNIOR enhances the JNIOR capabilities. While the JNIOR can be used in its most basic form, the Cinema application provides the ability to execute macros, sequence of actions.

The Cinema application does not ship preinstalled. You MUST obtain the application from our website. There is a download on the website that will be opened in the JNIOR Support Tool and published to the JNIOR. This is called an Update Project.

Here are links to latest versions of the JNIOR Support Tool and the Cinema application.

Name Version Release Date Size MD5
JNIOR Support Tool v7.9 May 16 2019 13 MB 2c22f26f4e87d724e0f7c918095eb8c0
Cinema.jar - Update Project v3.6 Aug 14 2019 335 KB d96d4ae9b9adc4f0b8cdaf9bd87518f3

When you open the Cinema Update Project in the Support Tool you will see the following.

Click Publish and select the JNIOR you want to update. Once the update is complete the JNIOR will have rebooted and the application will be ready to configure. Configuration is largely dependent on what you are trying to do.

Within the Support Tool you can configure devices and macros. Devices are outbound connections from the Cinema application. For example, a projector, sound processor, or lighting system. Those devices can be serial or Ethernet. We have not implemented very many devices but the ones that are implemented satisfy a very large majority of the installations. If you need a device that is not implemented, you can use the “Raw Serial” or “Raw Ethernet” device. This will allow you to send commands that you define to those devices. Even if you pick a device that we have implemented, you may need to add a new command. You can use the Send action and define the bytes that need to be sent.

You can use the Cinema application to execute DMX scripts. Those scripts can be on the same JNIOR or on another JNIOR. Both situations require making a TCP or Raw Ethernet connection to port 10000.

To execute a script once you will send script(SCRIPTNAME)\r\n

To execute a script a certain number of times you will send the same command but with a repeat parameter. For example, to execute 3 times we would send script(SCRIPTNAME -r 3)\r\n

To execute a script and have it repeat forever, until you abort it or reboot the JNIOR, you will send the -f parameter. For example, script(SCRIPTNAME -f)\r\n

Create a DMX device to use in the Macro

Create a Macro to call a DMX script with the Device we just created

As of Cinema version 2.9 you can use the scheduling in Cinema.jar to schedule macros daily, weekly or monthly.

When Cinema.jar is installed and executed for the first time it will create 3 default keys. They will look like this in the registry.

The configuration is a multi-part registry key. There are three parts. The type, the time of day, and the macro to execute.

Here are examples of the different scheduling types

Daily

You can define a macro to execute at a specific time every day. To do this we use the daily type. An example of executing a macro daily at 3:30pm with the name test would be:

daily, 15:30, test

Weekly

You can define a macro to execute on certain days of the week. To do this we use the 2 character day abbreviations in place of the type field. The 2 character day abbreviations are Su, Mo, Tu, We, Th, Fr and Sa. An example of executing a macro every day of the week at 3:30pm with the name test would be:

sumotuwethfrsa, 15:30, test

Monthly

Macros can be defined to execute on a certain date of the month, every month. To do this we use the monthly type followed the day of the month inside the parenthesis. An example of executing a macro with the name test would be:

montly(15), 15:30, test

You can also select to only execute the macro on certain months. Do do this we use 3 character month abbreviations. Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov and Dec. Only one month can be selected at a time.

sep(15), 15:30, test

Here is a registry example