DCP

Once a JNIOR is up and running in an application it rarely needs attention. In fact many users forget that it is even there. It is however good practice to check the system logs once and a while. Fortunately there are a number of ways that you can do that. If you open the DCP (Dynamic Configuration Pages) by accessing the unit with a browser there is a ‘Syslog’ tab. This displays the log with the most recent events right at the top. You can also go to the ‘Console’ tab or otherwise open the Command Line through a Telnet connection or the serial port where you can list the log content directly to the screen or window. In this case the latest entries are the last listed.

If you are developing a new application and testing it on the JNIOR you may wish to monitor the log more closely. Naturally you can leave the DCP open on the ‘Syslog’ tab and new events would just pop up when they are logged. That might not be as convenient as it sounds especially if you are building a network-facing application and are constantly testing and working with the JNIOR using various browsers. Perhaps you are rebooting the unit causing the DCP to reconnect far too often. More typically we periodically make a Command Line connection through Telnet and manually list the log. Here we make use of the CAT command.

mqtt-test /> help cat
CAT filespec

Options:
 -H             Dump file in hex
 -J             Formats JSON
 -P             Displays last page

Displays the contents of a file.
Aliases: CAT, TYPE

mqtt-test /> cat -p jniorsys.log

Now the jniorsys.log file is limited to about 64KB characters. That can represent a lot of lines. Do you really want to list those every time? Here we see that the CAT command also provides the -P option which will show only the last page (25 lines) of the file. Of course you do have to remember to include the option. One side note here is that with JANOS you can supply the options anywhere on the line. So if you at first forget to include the -P you can place it after the filename. No problem.

We can improve on this by making use of JANOS batch file capabilities. A batch file is a kind of script file that can contain commands to be executed one after another. Most operating systems, JANOS included, provide some facility for batch execution. But you might be wondering how do you create batch files or if you do that externally how do you get them onto the JNIOR? Well here’s a tip: You can create them on the fly. Of course, the simpler the file the easier that can be accomplished.

For example we will create a simple batch file called log.bat as as kind of short hand that we can use when we want to display the System Log. Here we simply ECHO the command routing the text to the file. Immediately we can use the short batch file name to execute the command.

mqtt-test /> echo cat -p jniorsys.log > log.bat

mqtt-test /> log
cat -p jniorsys.log
10/03/18 18:54:15.850, FTP/10.0.0.27:58531 uploaded /flash/MQTT.jar [325.8 kbps]
10/03/18 18:54:24.571, ... (etc.)

Here we see that we used the ‘>’ pipe character to route the output to the specified file. If you need to build a batch file with more than one command you can append to it using ‘>>’ as well. The power here comes in combining commands to achieve some goal. The advantage being that you can repeat the procedure easily using the batch file name as shorthand. While batch files in JANOS are not as fully featured as you will find in Linux or MS-DOS systems most of the basics are there.

Suppose instead we want to list only today’s events. Here we create our batch file in way that lists only those entries with today’s date. Check it out.

mqtt-test /> echo grep %DATE% jniorsys.log > log.bat

mqtt-test /> log
grep 10/04/18 jniorsys.log
10/04/18 12:10:48.657, Ending session Command/10.0.0.27:64514 (pid 132)
10/04/18 12:37:53.642, Command/10.0.0.27:64075 login 'jnior' (pid 405)
10/04/18 12:38:05.179, FTP/10.0.0.27:64118 login 'jnior'
10/04/18 12:38:05.711 ... (etc.)

And there you go. You now have a simple way to check recent System Log activity. Now I bet that you are thinking how you might alter this to be even more helpful. Well, if you find that you cannot achieve what you have in mind just let us know. An advantage that you have with INTEG is a direct link to the technical team and the advantage we have is the power to implement what you need.

DCP stands for “Dynamic Configuration Pages”. This is just a fancy name for the default website served by the Series 4 JNIOR out of the box. Once you have powered your JNIOR, connected it to the network, and assigned it an IP Address you can access the DCP using your favorite browser. This website is contained in, and served from, the /flash/www.zip file on the JNIOR.

You can use the DCP to monitor your JNIOR. Through the Input/Output tab you can see the status of each Digital Input and Output Relay. This tab offers two pages (listed down the left column). These are the Internal I/O and External I/O pages. If you log into an account with sufficient permissions you can control the relays. The appearance of this page can be configured through the Configuration tab. The labels can be redefined as might be appropriate for your application. You can remove unused inputs and outputs and even mask features such as usage metering if not of use.

The External I/O refers to external modules that you may optionally use with your JNIOR. INTEG can supply a Power Relay module, analog modules for 10V or 4-20ma, and even temperature sensors. One or more of these may be daisy-chained on the Sensor Port. If you have any of those they can be monitored and controlled in the External section of the Input/Output tab.

The Configuration tab is available only to Administrator accounts. This provides a dozen and a half pages covering most every aspect of your JNIOR.

The Display page configures settings that affect the appearance of the Input/Output Internal page. Here you may disable any channel which simply removes the channel from view on the Input/Output tab. This does not disable the function of the input or output. It merely allows you to hide unused or background channels. Similarly you can hide Counters, Usage Meters, Alarm indications and Controls. For relay outputs you can select the Pulse control instead of Toggle if appropriate. You may even alter the coloring used in showing the input or output state.

Note that each item of configuration is associated with a Registry Key. If you hold the mouse over a setting the related key is displayed in a Tooltip. Configuration settings that differ from default will appear in the Registry which can be viewed and edited directly using the Registry tab. More on that in a bit. While the mouse is hovering you may hit F1 to view the built-in Registry documentation.

The Labels page provides the ability to configure the text displayed on the Input/Output Internal page. In addition to Descriptions and I/O State labels you can change the units for the Counter.

This page is shown for the Model 410 which has 8 inputs and 8 outputs. The DCP will display different arrangements for the Model 412 and 414. The former having 12 relay outputs and only 4 inputs. The latter with 12 inputs and only 4 outputs.

The Inputs page affects the function of each input. Here you can configure inversion, debounce and a number of other characteristics for each of the available inputs.

A Block Diagram is available through the provided link to help in visualizing input configuration. We can cover the details under another topic.

The Counters page sets counter configuration for each input. The JNIOR counts each activation of an input. Here you can configure how that is to happen and how it is displayed. You can scale a counter if each activation represented a number of items or a fractional amount of something. Here you can see the value of changing the displayed counter units which are configured on the Labels page.

Here you can also configure two different Alarm levels. Alarms are displayed on the Input/Output Internal page. They are also Events that can issue email notifications.

On this page you can also mouse over an input and click the displayed “X” to easily reset a counter to 0.

The Outputs page provides state configuration for Usage Metering. The JNIOR tallies time for each activated input or output. This would potentially be useful for Preventative Maintenance. Here you can also set the default Pulse duration that would be used if you elected to configure a Pulse control (button) for the output on the Input/Output Internal page.

The Metering page displays the accumulated time for each Usage Meter. Like the Counters page you can mouse over a Channel and click the displayed “X” to reset the usage. Here you can also set the active usage state and configure alarms. This alarm can be set to send an email notification on the Events page.

The JNIOR has two serial ports. The Serial I/O page can be used to set communications parameters for each port. The defaults are shown.

Generally an Application Program is used to perform communications over a serial port. The program itself may configure communications parameters. There are times where you may wish to set the parameters outside of an application. The IOLOG command provides access to a Transmission Log for the AUX port. You can set the Baud Rate and then check the IOLOG to see if data has been received properly.

The Applications page lists Registered Applications. Applications are automatically Registered during boot provided that a JAR file exists in the /flash folder containing a properly formatted appinfo.ini file. The content of the Applications page then may vary significantly from one JNIOR to another.

An application may be set to run at boot. When you check the box associated with the application the appropriate Registry Run Key is created. On reboot the application will automatically start. If available a link is displayed that can lead to additional configuration pages specific to the application.

Note that the checkbox only affects the status of the application after boot. The starting and stopping of applications at any other time is performed at the Command Line which can be accessed through the Console tab.

Each JNIOR has the ability to send email notifications. Applications can be written to generate emails and potentially received them. Outgoing email requires a valid client account. The Mail-Account page is used to configure the outgoing email capability.

Here the Mail Server is something like smtp.comcast.net and the From Address would be the email address for a Comcast account. When you enter the SMTP Username you will be asked for a valid Password. The password is securely stored in the Registry. The remaining settings define the SMTP port, security and other characteristics for the communication. These are the credentials use in submitting outgoing emails.

Email notifications can be generated for a number of Events if enabled. JANOS has default structures for those notifications. You can optionally define any number of custom email messages as Profiles using the Mail-Profiles page. When the default content is insufficient these profiles can be referenced by name to define custom email recipients and content.

There is a small set of built-in events. The Events page is used to configure the actions associated with those events. For the most part this involves enabling an email notification and defining an optional email profile.

Beyond those listed here an unlimited number of events and actions can be accommodated through application programming or direct configuration of the Registry.

Note that the automatic starting of application programs can be disabled here without need for removing the Run keys.

The JNIOR is shipped configured with an IP Address of 10.0.0.201. This likely will not work for you.

To configure the network addressing you can run the Support Tool. The Support Tool is a Windows application that you can download for free from the INTEG website http://www.integpg.com/support/jnior/. You can also make a serial connection to the RS-232 (COM) port and use the IPCONFIG command at the command line.

Once you can access the DCP you can modify settings through the Network page.

The Security page offers a couple of settings.

The Series 4 JNIOR can perform secure communications using Public Key encryption and SSL/TLSv1.2. By default a 1024-bit RSA key pair is used in concert with automatic self-signed certificates. This means that you can access the DCP using a HTTPS connection. You can also perform secure FTP transfers and Telnet connections. The latter is best done with a client program available from us. Of course, you do not need either FTP or Telnet as the DCP offers most of that functionality.

While it doesn’t seem prudent you can disable the SSL capability here by deselecting SSL Enabled. Perhaps more appropriate is enabling SSL Required. In this case FTP and Telnet connections must perform STARTTLS and proceed securely. The standard HTTP port (Port 80) is closed. You can continue to make the secure connection using HTTPS (Port 443). Email will only be transmitted securely.

IP Address filtering is available. The Allowed IP Addresses field can be set with a comma delimited list of IP addresses that can make connection to the unit. This field can also contain a sophisticated filter string. It is recommended that the documentation (use F1) be viewed before setting this field. You can block yourself. In that case you will need to make the serial Command Line connection and remove the filter through the REGISTRY command.

The Telnet page simply lets you relocate the port. You may want to do that to hide it from casual connections. You can also disable the server entirely. You can do that since you can access the Command Line through the Console tab of the DCP.

The WebServer page is used to configure the Web Server. Here you can relocate either the HTTP or HTTPS ports or both. You can disable the Web Server entirely. That also prevents use of the DCP but your application might demand the limited access.

By default web access requires a login. You can disable the login requirement and to do so you must also define a user account for anonymous access. If your JNIOR is physically secure and the network is isolated from the larger network you might disable the login. If otherwise you have some pages that you wish to share publicly you can place them in the /flash/public root. Pages are served from that area without the need for authentication.

You can relocate or disable FTP using the FTP page. You can disable FTP and still manage the JNIOR’s file system through the Folders tab of the DCP.

Anonymous FTP access is not recommended. You can allow that by defining a user account to be used for that.

The JNIOR Protocol is deprecated and not recommended for new applications. The Series 4 offers a more modern Websockets interface which performs all of the same function and much more. It is also not binary. The JNIOR Protocol is still supported.

The Protocol page can be used to relocate the JNIOR Protocol port. The server can also be disabled.

We would recommend disabling the JNIOR Protocol unless you know that it is used. It is also highly recommended that the login requirement not be disabled. If you do so you must then define a user account for the anonymous access.

And finally for the Configuration tab is a page for the configuration of external modules. If you use an external module it will be listed here on the Modules page. If you have recently connected a module and don’t see that one you can select ‘rescan’ to update the list.

If the external module has configuration setting those can be seen by expanding the module. Click the triangle shape. For instance the 4ROUT labels can be altered for use on the Input/Output Externals page.

The Console tab provides access to the Command Line interface. This is similar to a Telnet connection but performed entirely through the web interface (Websockets). Note that an additional login is required here.

You can cut and paste here. That would be one advantage over a Telnet client. You can also drag a file to this window. That will place the file into the /temp folder convenient for further use from the command line. You might drag a UPD here and once it transfers use the JRUPDATE command to update the operating system as an example.

The Folders tab provides a file explorer formatted view into the file system.

You can navigate through folders by clicking on the left tree or double-clicking folders on the right as you might expect. Files can be selected and downloaded. You can also delete files and create folders. Drag and Drop is supported both into and out of the folder. Although in that case there is some variation in availability depending on the browser you are using. I use Chrome extensively. That seems to provide all of the needed capability.

If you need to move entire folders including subfolders then FTP is a better bet. Here I recommend FileZilla. https://filezilla-project.org/

The Registry tab provides an explorer view into the Registry. Here you can edit and remove keys as needed. Each setting found in the Configuration tab is associated with a Registry Key. You can make settings here if you know the proper key and format.

It is recommended that you become familiar with the Registry, There are some settings that are not accommodated by the DCP GUI. You will need to enter those here. The Registry can also be manipulated from the Command Line.

The DCP contains built-in and detailed Registry documentation.

The Syslog tab displays the System log detail in chronological order with the most recent event at the top. This is the content of the /jniorsys.log and /jniorsys.log.bak files concatenated. You can scroll then through all of the available log history in order from most recent to the oldest.

Here I’ll show a segment of the HoneyPot Syslog since my development unit sees a lot of crazy use and its log is full of confusing stuff. In fact you can see in this log where JANOS was recently updated. The infected.json file that keeps getting updated is the database for the http://honeypot.integpg.com/map.php application running on that unit. The HoneyPot JNIOR is connected directly to the Internet.

The Peers tab provides quick link access to other JNIORs that you may have on the network. The Series 4 JNIOR is aware of nearby peer products. Here you can move to the DCP on these other units using the link provided. That can be convenient if you have many JNIORs. Okay, so here at INTEG the Peer list gets crazy.

For many this list will be short if there are any at all.

And FINALLY! We have the About tab. This actually contains some text and potentially useful information.

 

When you open your browser and point it to your JNIOR you should get the DCP by default. If you still get the old applets then you need to update your JNIOR. We highly recommend that you always run the latest version of JANOS and DCP.

But what if you are running a special application and you want your own web page to come up by default. How do you then get to the DCP or get it out of the way?

The DCP is stored within and served directly from the /flash/www.zip library. You can move that file into the /flash/www folder and rename it something like config.zip. So now you have the file /flash/www/config.zip.

Now since the default root for the WebServer is /flash/www if you point your browser to the JNIOR and add /config to the URL you should get the DCP. The URL will be something like the following:

http://[IP Address]/config

It works.

Did you know that the DCP includes documentation in the form of Help?

Many of you have seen the Registry Key Assignments document. Well we no longer maintain the PDF of that. The most current Registry documentation is distributed with every JNIOR as part of the DCP.

2017-10-24_14-41-07.png

Every configuration setting is associated with a Registry Key. Simply by placing your mouse over a setting a Tool Tip will display the associated Registry Key for you. You can make use of that if you want to access the Registry by some other means.

A link will also display at the bottom of the page as shown above. If you can remove your mouse from a setting without mousing over another you can then click the link to access the documentation. You can also use the F1 key while holding you mouse over a setting to access the documentation.

A form of context help is provided by opening the distributed Registry Key Assignments document and indexing to the referenced key.

Note that you might need to update your operating system (JANOS) to the latest to get access to all of these features. If you update manually (use JRUPDATE) then you will also need to update /flash/www.zip to install the latest DCP. And if you still get the old applets when you open your browser, then there is probably a /flash/www/index.php or similar index file in that folder that you will need to remove.

If you update using an update project in the Support Tool it is likely that the project takes care of these steps for you.

If you are working at the Command Line through a Telnet connection and want information on a particular Registry Key or setup, simply open your browser to the DCP and hit F1. If you are working in the Console Tab (DCP access to the command line interface) the F1 keystroke gets you to that document as well.

Or you can enter a URL to read it directly as follows:

http://[IP Address]/RegistryDoc.html

Okay, so you might search all through your JNIOR’s file system and not find any RegistryDoc.html file. That is because it is contained within the /flash/www.zip library and JANOS knows how to serve files directly out of a compressed library. It can locate the files using the path to the library, the name of the library and any path therein up to the filename. And since the default root for the Webserver is /flash/www it knows to look right in there.

The Series 4 has moved away from the use of Java applets for the configuration pages. These pages are reached through the web interface and used to control and configure the JNIOR. Java applets can no longer be simply executed by browsers. For the most part this is due to security concerns in executing client-side programs. It was also the result of improvements in JavaScript and the fact that most client-side operations can be easily accomplished using that alone.

In order to control the Series 3 the web site has to make a connection to the JNIOR Protocol port (default 9200). JavaScript cannot do this. It can be accomplished by a Java applet. Thus, we relied on that for some years and still need it for the Series 3.

The Series 4 supports a built-in Websockets interface. Websockets operates through the standard HTTP ports and is supported by all browsers. The JNIOR Websockets interface supports all of the same functionality of the JNIOR Protocol and much more. The JNIOR Protocol is a binary protocol and challenging to implement. Websockets is JSON based and much more straight forward.

If your Series 4 is still presenting you with the applet issue, you need to update. We recommend always that you run the latest JANOS release. The update project for that will replace the applets with the DCP.

You should be running at least JANOS v1.6.2. If you update JANOS manually using a UPD. The DCP is installed by copying the www.zip file into the /flash folder. You should also make sure that any index.html or index.php file is removed from the /flash/www folder.

This www.zip folder should not be expanded as JANOS serves files directly from the compressed library.

This is what the DCP looks like.

2017-10-19_16-13-46.png