Tag Archive: Preshow Client

When setting up a connection from Cinema Server to a JNIOR, there are multiple ways to create that connection. This post will go through different options, and help you determine the connection that benefits you the most.

JNIOR Protocol

  • Advantage: It requires less time to setup, as the JNIOR protocol is listening by default, only needing the Cinema Server to be configured to connect to the JNIOR protocol.


  • Disadvantage: Commands are limited to whatever the Cinema Server’s built-in library provides. Available commands vary between Cinema Servers. Ex. Cinema Server has commands for I/O control but no commands for macro execution.

The JNIOR Protocol is an OS defined binary protocol the JNIOR listens on. A built-in library means that the device already has pre-built commands that you can use to send to a JNIOR versus having to create the commands yourself. This connection uses both of these and should make connecting to a JNIOR much easier.

You can check your JNIORs active connections by opening a telnet connection to it. This can be done via command line, or by using the JNIOR’s Web Pages (Java Applets for Series 3 JNIOR). Once you have this connection, you’ll enter the command ‘netstat’. This shows all the active connections on the JNIOR. If the JNIOR device is listening on a port that is defined in the list as the JNIOR protocol, then that is the port number for the JNIOR protocol.

netstat command

Devices that use built-in libraries will usually need to create a JNIOR device inside its interface. When creating the JNIOR device, it will typically auto-populate the device with a username and password (‘jnior’, ‘jnior’), and the port number (usually 9200 which is the default port number for the JNIOR protocol). The information missing that will need to be entered is the IP address of your JNIOR. With the IP address entered, the information required to successfully create a JNIOR device should be done. Commands can then be created using that JNIOR device to be sent to the JNIOR, such as a relay output pulse or macro execution. These commands will be already be created by the built in library and just need to be selected to be used.

If both the Cinema Server and the JNIOR are configured as stated above and the connection doesn’t appear established when trying to send the JNIOR commands, you may need to reboot both devices for your settings to take effect.

MODBUS Protocol

  • Advantage: It requires little time to setup, needing only the JNIOR to enable the MODBUS application and then the Cinema Server to be configured to connect to the MODBUS protocol.
  • Disadvantage: Commands are limited to whatever the Cinema Server’s built-in library provides. Available commands vary between Cinema Servers. Connection is only for devices that communicate using a modbus protocol. (GDC is the only Cinema Server that uses the modbus protocol)

MODBUS is another application on the JNIOR that allows a Cinema Server to connect with the JNIOR. If a Cinema Server doesn’t use the Modbus protocol, it shouldn’t use this type of connection. This application comes pre-installed on the JNIOR, and needs to be enabled to run on boot. To get MODBUS running on your JNIOR you’ll need to enable it by going to the Applications section of the Configuration Tab of the JNIOR Web Pages. You’ll go to the MODBUS application and check the checkbox next to it. Once you’ve done that, you’ll need to reboot the JNIOR to get the application to start running. 

You can check if the application is running after the reboot by going to the Console Tab of the JNIOR Web Pages and entering the command ‘ps’. This will show you all the processes running on the JNIOR, and if you enabled MODBUS is should be listed as one of the those processes. With MODBUS running, you can also check if MODBUS is listening on the correct port by running the ‘netstat’ command. The MODBUS connection should display when the ‘netstat’ command is entered in the command line.

ps command
netstat command

With MODBUS running, you’ll then need to create a device in the Cinema Server interface to connect to the JNIOR. Communicating with MODBUS will use the Cinema Server’s built-in library. Devices that use built-in libraries will usually need to create a JNIOR device inside its interface. When creating the JNIOR device, it will typically auto-populate the device with a username and password (‘jnior’, ‘jnior’), and the port number (usually 9200 which is the default port number for the JNIOR protocol). The port number will need to be changed to 502 for the modbus protocol. Then the information missing that will still need to be entered is the IP address of your JNIOR. With the IP address entered, the information required to successfully create a JNIOR device should be done. Commands can then be created using that JNIOR device to be sent to the JNIOR, such as a relay output pulse or macro execution. These commands will be already be created by the built in library and just need to be selected to be used.

If both the Cinema Server and the JNIOR are configured as stated above and the connection doesn’t appear established when trying to send the JNIOR commands, you may need to reboot both devices for your settings to take effect.

Cinema Application

  • Advantage: Execution of macros grants more functionality then what might be available from other connections that can be created.

  • Disadvantage: Requires more setup compared to other connections that can be made between a Cinema Server and JNIOR.

Another way to connect between a Cinema Server and the JNIOR is the Cinema application. This connection can be done via TCP or Serially. To setup this type of connection we first need to update the JNIOR with the Cinema application. Once Cinema has been installed on your JNIOR, you’ll then need to configure it to connect on a selected port. To do this you need to access the registry of the JNIOR, which can be done via command line or through the JNIOR’s Web Page (Java Applets for Series 3 JNIOR). You’ll need to edit the registry of the Cinema application to properly handle a TCP or Serial connection, which you can read about here. Once the Cinema application’s TCP port/serial settings are entered, the macro and device files will need to be created using the support tool. Macro and device files tell the JNIOR what actions to perform when they receive a specified command sent to the Cinema application. How to create macros can be viewed in a post here.

After you have created macros and published them to your JNIOR, you will need to create a device on the Cinema Server’s interface. Make sure that if you are using a serial connection that you are creating a serial device, or if its an Ethernet connection that its a TCP device. You’ll then enter the same connection settings for that device that you have for the Cinema application on the JNIOR. (For example, if you set the Cinema application to listen on 9600, set the Ethernet device you are creating on the Cinema Server to 9600 as well.)

Example Commands

Finally when that is created, you can then create commands in the Cinema Server to send to the JNIOR. These commands should be made to activate macros on the JNIOR and will use ASCII instead of binary. You can also create Serial Control Commands inside of Cinema. Here are some example commands below:

Macro Commands

run Test\r\n - activates a macro uploaded to the JNIOR called 'Test'
run Macro\r\n - activates a macro uploaded to the JNIOR called 'Macro'

Serial Commands

::C1 - Close relay output 1
::O234 - Open relays 2, 3 and 4 
::C* - Close all relay outputs
::O+2 - Open relay 10
::C1p=1000 - Pulse relay 1 closed for 1 second

With this you should be able to send commands from the Cinema Server to the JNIOR using the Cinema Application.

Again, if both the Cinema Server and the JNIOR are configured as stated above and the connection doesn’t appear established when trying to send the JNIOR commands, you may need to reboot both devices for your settings to take effect.

Serial Control

  • Advantage: It is a lightweight application and won’t use as much processing power as other applications.

  • Disadvantage: Can only control the JNIORs I/O.

This connection can also be done via TCP or Serially. Every JNIOR comes with bundled software already installed on it, and Serial Control is one of those applications. However, its not set to run so the application doesn’t start when the JNIOR is booted up. To get Serial Control running on your JNIOR you’ll need to enabled it by going to the Applications section of the Configuration Tab of the JNIOR Web Pages. You’ll go to the Serial Control application check the checkbox next to it. Once you’ve done that, you’ll need to reboot the JNIOR to get the application to start running. Once the Serial Control application is running, you will then need to set the port number or serial settings its listening on

You can check if the application is running after the reboot by going to the Console Tab of the JNIOR Web Pages and entering the command ‘ps’. This will show you all the processes running on the JNIOR, and if you enabled Serial Control is should be listed as one of the those processes. With Serial Control running, you can also check if Serial Control is listening on the correct port by running the ‘netstat’ command. The Serial Control connection should display when the ‘netstat’ command is entered in the command line.

ps command
netstat command

Once Serial Control is running, now the Cinema Server needs a device created in its interface to connect to the JNIOR. You’ll create an Ethernet or Serial device in the Cinema Server interface, and you’ll set the IP to the IP of the JNIOR. For either a Ethernet connection or serial connection you configure them to match the settings in the Serial Control registry.

Example Commands

Once that device is made, you’ll make commands in the Cinema Server interface to send to the Serial Control application. Here are some examples:

Serial Commands

C1 - Close relay output 1
O234 - Open relays 2, 3 and 4 
C* - Close all relay outputs
O+2 - Open relay 10
C1p=1000 - Pulse relay 1 closed for 1 second

Here is also a post that goes over commands that Serial Control can receive after a connection to it is made from the Cinema Server. With these commands created you should be able to send commands from the Cinema Server to Serial Control on the JNIOR.

Like previously, if both the Cinema Server and the JNIOR are configured as stated above and the connection doesn’t appear established when trying to send the JNIOR commands, you may need to reboot both devices for your settings to take effect.

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. 

Below are examples for the logic you can implement in Cinema using these registries.

OnIOChange

This logic expression will be checked whenever the JNIOR I/O changes. The I/O that can be monitored are the internal inputs and outputs on the JNIOR as well as any outputs on a 4 relay output expansion module.

OnIOChange, din1 and din2, run test

For the above example, each time either input 1 or 2 changes, the logic rule (din1 AND din2) will be evaluated and the macro (test) will execute if both inputs are ON.

OnPreshowClient()

This logic expression will be checked whenever the Preshow Client in Cinema.JAR receives a message. To specify the string/message that will cause the logic to be evaluated put it inside the parenthesis.

OnPreshowClient(start), din3 and din4, run preshow start

For the above example, each time the device connected to the JNIOR as the Preshow Client sends the string “start” to Cinema.JAR, the logic rule (din3 AND din4) will be evaluated and the macro (preshow start) will execute if both inputs are ON.

OnCinemaServer()

This logic expression will be checked whenever the Cinema Server Client in Cinema.JAR receives a message. To specify the string/message that will cause the logic to be evaluated put it inside the parenthesis.

OnCinemaServer(movie), din5 or din6, run movie start

For the above example, each time the device connected to the JNIOR as the Cinema Server Client sends the string “movie”, the logic (din5 OR din6) will be evaluated and the macro (movie start) will be run if either digital input is ON.

OnMacro()

This logic expression will be evaluated whenever the named macro has been requested to run. This logic expression can be used as a ‘lock’ to make sure certain macros can only execute when a certain I/O state exists or cannot be executed when a certain I/O state exists. To specify the macro that is bound by this logic place its name inside the parenthesis.

OnMacro(flat start), din7

For the above example, if the macro “flat start” is triggered to run via any method, the logic (din7) will be checked. If (din7) is ON, the macro will be allowed to run. If (din7) is OFF, the macro will not be allowed to run. 

Below is an example registry using some of the examples above.

When using the Cinema application, you’ll want it to be able to receive commands from other devices so its macros can be trigger. In the registry of the JNIOR, Cinema’s registry contains the CinemaServerClient and PreshowClient registries. These are what can be configured to listen for those connections to external devices.

While accessing the JNIOR WebUI when Cinema is installed, you can access the AppData/Cinema/CinemaServerClient or the AppData/Cinema/Client registry folders to configure the connections made using Cinema. The PreshowClient and CinemaServerClient are connections made to either a Preshow System or Cinema Server through TCP or Serially that allow control of outputs, I/O feedback, and the ability to interact with various devices using macros.

Inside both registry folders are multiple registry keys. The TcpPort key is where you can set the port number for an Ethernet connection to other devices. (Any valid TCP Port number will work, but we set it to -1 by default so it will not listen for TCP connections until its set). For serial connections, you need to set the Method key to serial and the SerialCommandsEnabled key to true. You’ll then need to go to the AppData/Cinema/CinemaServerClient/Serial for the CinemaServerClient or AppData/Cinema/Serial for the Preshow Client, and set the serial connection to whatever serial setting you want the JNIOR and your external Device to connect on.

NOTE: You can have both the Preshow Client AND the Cinema Server Client active at the same time. Each one can have a Serial Connection and a TCP connection active. You can have multiple devices connect to the same Cinema TCP port to control Cinema. Therefore, while you can have more then four devices connect to Cinema at the same time, it can listen for at most four different types of connections at the same time:

  • Preshow Client Serial Connection (1 connection)
  • Preshow Client TCP Connection (Multiple connections)
  • Cinema Server Client Serial Connection (1 connection)
  • Cinema Server Client TCP Connection (Multiple connections)

Just keep in mind that if both are using TCP then they can’t use the same Port Number, and if both are using a Serial Connection, they can’t use the same Serial Port.

Preshow Client

Preshow TCP Settings
Preshow Serial Settings

Cinema Server Client

Cinema Server Client TCP Settings
Cinema Server Client Serial Settings