Command Line

Serial Control Plus is an application that comes pre-installed on all JNIORs. It allows you to connect either serially or through TCP to a JNIOR, and give it commands to activate the JNIOR’s I/O. This post will explain how to setup and use Serial Control Plus on your JNIOR.

As mentioned before Serial Control Plus is already pre-installed on all JNIORs. To activate it, you need to go to the JNIOR DCP. This can be accessed by either right clicking the JNIOR in the JNIOR Support Tool and going to Tools/Open Web Page, or by typing the JNIOR’s IP address into the URL of your computer’s web browser. Once on the DCP, you’ll go to the applications section on the configuration tab and click the checkbox next to Serial Control Plus and reboot your JNIOR. This will allow you to use Serial Control Plus on that JNIOR.

Once you have activated the Serial Control Plus application on your JNIOR, you can now send commands to the JNIOR through it. We are going to open the command line from the support tool to activate commands on this JNIOR for this example. To open the command line from the Support Tool, you’ll go to the Tools bar at the top of the Support Tool and select Command Line.

Once you have the command line open, you’ll need to configure the settings of the command line to send commands to the JNIOR. To have the right settings to communicate with the JNIOR, we need to select how we communicate to the JNIOR. Serial Control Plus can communicate with the JNIOR two ways. Either you can connect to the JNIOR with a serial connection or a TCP connection.

To connect serially with the JNIOR, you need to plug a serial cable into the Aux Port of the JNIOR. Once you do that we need to select the correct settings in the command line window. As in the picture below, next to the connect button for the connection type you’ll select COM, baud type is 9600, Data bits is 8, Stop bits is 1, Parity is none, and hardware/software is set to none. For the Option drop-down, select all the choices.

To connect through TCP, you just need the JNIOR to be on the network to connect. As in the picture below next to the connect button for the connection type you’ll select TCP/IP, you’ll set the JNIOR’s IP, and the Port to connect on is 9202. For the Option drop-down, select all the choices.

Once you’ve decided on your connection type and configured the command line accordingly, you should be able to send commands to the JNIOR. Here are commands for controlling and monitoring I/O.

Controlling I/O

The following commands can be used to close, open and pulse outputs.

cX: Close the output (relay is “on” closing the contact)
where x = 1 through 8 for the internal relay outputs on the JNIOR
and x = +1 through +8 for the external relay outputs on the 4 Relay Output Expansion Modules

oX: Open the output (relay is “off” opening the contact)
where x = 1 through 8 for the internal relay outputs on the JNIOR
and x = +1 through +8 for the external relay outputs on the 4 Relay Output Expansion Modules

p=yyy Pulse duration (milliseconds) and is used in conjunction with the ‘close’ or ‘open’ command

c2p=1000 close output 2 for 1 second and then open again
c+2p=1000 close output 10 for 1 second and then open again
o3p=10000 open output 3 for 10 seconds and then close again
c* Close all outputs at the same time (includes internal and external)
o* Open all outputs at the same time (includes internal and external)

These commands can be abbreviated and used in combination, such as:
c1 close relay output 1
c+1 close relay output 9 (first output on first expansion module)
c+5 close relay output 13 (first output on second expansion module)
c1+1+5 combination of the above all in one command
c1234 close relay outputs 1 through 4
c1368 close relay outputs 1, 3, 6, 8
o125 open relay outputs 1, 2, 5
c1+1p=1000 close relay outputs 1, 9 and pulse each for 1 second simultaneously

Monitoring I/O

Whenever an input (or output) changes status (low-to-high or high-to-low), the following is sent out by the JNIOR:

INx=1 Input x (1 – 8) has gone high (on)
OUTx=1 Output x (1 – 16) has gone high (on)
INx=0 Input x (1 – 8) has gone low (off)
OUTx=1 Output x (1 – 16) has gone low (off)

The default setting for the Registry Key AppData/Serial_Control/SendCounts is false. If you change this key to true and reboot, with each message stating the input status, a count value will also be included. Whenever an input changes status (low-to-high or high-to-low), the following is sent out by the JNIOR:

INx=1,yyy Input x (1 – 8) has gone high (on), counter value = yyy
INx=0,yyy Input x (1 – 8) has gone low (off), counter value = yyy

Note: These monitoring messages are sent out individually over the serial port or Ethernet. The JNIOR does not report the status of more than one input/counter in the same message.

With this, you should now be able to use Serial Control Plus to control and monitor a JNIOR’s I/O!

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.

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 reboot -eraseall is only for series 4 JNIORs.

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.

The IpConfig/Allow registry key can be powerful to help secure your JNIOR.  It can successfully thwart unauthorized access and prevent DOS attacks.

The danger comes in when the registry key is mis-configured. It can be a typo or not fully configured, something simple, but when this happens it can prevent legitimate attempts to access the unit.

If this happens a USB-to-Serial cable is needed to access the unit via the RS-232 port. Make sure to use the correct serial settings of 115200, 8 data bits, 1 stop bit and no parity. Once connected you can issue the reg command.

Above you can see that the IpConfig/Allow key is set for This states that the first 24 bits of the address must match for a network connection to be accepted. If, for some reason, this was mistyped then legitimate connections would not be allowed. This would basically render the network port useless. The user might not have noticed what the error was.

Using the Serial to USB cable is the only way to access the unit. The key can then either be fixed or removed to regain access over the network.

Sometimes you need to find out what the IP Address of the JNIOR is that is sitting on your network.  Sometimes someone else set it up and are no longer working with you or maybe you programmed it but years have passed and you haven’t needed to access the JNIOR because it is performing its job and no attention has been needed.

There are a couple of different ways to find out the IP Address.

By far the easiest way to find the JNIOR IP Address is the use the JNIOR Support Tool.  The JNIOR Support Tool only works on Windows systems. will have links to the latest, as well as previous, versions of the JNIOR Support Tool.  Once loaded and started you will be presented with the Beacon tab.  The Beacon tab will show all the JNIORs that are present on your LOCAL network that have reported.  When the Support Tool launches a broadcast is sent out asking for all the JNIORs to report their information.  Some network configurations can either help or hinder this operation.  In most cases it works as intended.  Here is a picture of the Beacon screen.  If you have more than one JNIOR shown you can use the Serial Number of the JNIOR to identify which row corresponds to your unit or you can use the identify feature to pulsate the amber LED next to the power indicator.  To perform that function you can right click on a row and select either Query | Identify or Configure | Identify from the menu.

The other way to determine the IP Address of a unit is to directly connect a serial cable to the RS-232 port.  Computers do not come with serial ports anymore so a USB to Serial adapter will be needed.  You can find them at Amazon.  Once the cable is connected, select your favorite terminal application or use the Command Line application included with the Support Tool.  The serial settings must be 115200, 8, 1, none for the baud rate, data bits, stop bits and parity respectively.  Now that the connection is set up you can press enter and the login prompt will be presented.  The default credentials are username: jnior and password : jnior.  You can now enter ipconfig to see the current network setup.









Lastly, for those who know Morse code, you can unplug the network cable and the status LED will flash Morse code representing the value of the last octet.  You must know the first 3 octets of your network.

    0 --- --- --- --- ---
    1 - --- --- --- ---
    2 - - --- --- ---
    3 - - - --- ---
    4 - - - - ---
    5 - - - - -
    6 --- - - - -
    7 --- --- - - -
    8 --- --- --- - -
    9 --- --- --- --- -

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

 -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/ 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/ (pid 132)
10/04/18 12:37:53.642, Command/ login 'jnior' (pid 405)
10/04/18 12:38:05.179, FTP/ 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.

ZIP is an alias for the JAR command. The JAR command gives you the ability to check and extract files from a file collection. JAR and ZIP files are of the same format. JANOS uses JAR files for Java programs which are collections of class files best handled as a group. This is the HELP for the command:

JAR filespec [pattern]

 -C             Check integrity
 -T             Lists library contents
 -X             Extracts library contents
 -V             Verbose

List/Extract files from a ZIP/JAR library.
Aliases: JAR, ZIP

Even though JAR collections store content generally in a compressed format the files can be quite large. If you ever question the integrity of a JAR/ZIP file you can use this command to verify it. Remember that you can also use the MANIFEST command to verify a file’s checksum.

bruce_dev /> jar -c flash/jAccess.jar                  
 4 entries found
 content verifies!
bruce_dev /> 

bruce_dev /> jar -cv flash/jAccess.jar
  verifying: META-INF/
  verifying: jaccess/
  verifying: jaccess/JAccess.class
 4 entries found
 content verifies!
bruce_dev />

You can see that the -V verbose option enumerates the entries as they are verified.

The -T option displays the table of entries in the collection. Recently with JANOS v1.6.3 we have enhanced this listing. Here is an example with and without the verbose option.

bruce_dev /> jar -t flash/jAccess.jar

bruce_dev /> jar -tv flash/jAccess.jar
     Size   Packed          CRC32        Modified
      227      227    0%  6180ffe5  Jan 30 2017 14:40  META-INF/MANIFEST.MF
     4143     4143    0%  639ebba5  Jan 30 2017 14:40  jaccess/JAccess.class

bruce_dev />

Recently I have been interested in implementing DEFLATE compression. The existing JAR/ZIP command in JANOS has been able to decompress DEFLATE (inflate?) for years. We just haven’t had a strong need for creating or modifying an archive on the JNIOR. Beginning with JANOS v1.6.4 which is now in Beta there will be some new capabilities involving DEFLATE.

New to v1.6.4 is a greatly improved JAR/ZIP command that not only can list or test an archive but that can create, update and even freshen them. This would be useful for those who need to retain log files for extended periods of time. The jniorsys.log file compresses some 80% for example. The available command options are as follows:

ZIP libraryfile [filespec]...

 -V             Verify archive
 -T             List contents
 -X             Extracts contents
 -C             Create new archive
 -U             Update archive
 -F             Freshen archive
 -S,-R          Recurse folders
 -L             Verbose format

List/Add/Extract files from a ZIP/JAR library.
Aliases: JAR, ZIP

Some options have been reassigned. For instance the -V option now implies (V)erify as opposed to (V)erbose as it has been previously. Hopefully those changes will not cause difficulties. It was our opinion that the JAR/ZIP command in the past was relatively obscure and unused.

With this new implementation one or more file specifications inclusive of wildcards may be specified when appropriate. Recursion through the directory/folder structure is now not assumed. You must use the -S (or -R alias) option for that. Relative paths in the archive are maintained and created as you might expect. I will provide some examples.

The root on my JNIOR contains a few typical files.

bruce_dev /> dir -l
total 10
drwxrwxrwx   1 root      root           8 Jan 25 14:21 .
drwxrwxrwx   1 root      root           8 Jan 25 14:21 ..
dr-xr-xr-x   1 root      root           1 Dec 31 1999  etc
drwxr-xr-x   1 root      root          59 Jan 25 14:21 flash
drwxrwxrwx   1 root      root           0 Jan 25 13:26 temp
-rw-r--r--   1 root      root       37994 Jan 25 14:21 jniorsys.log
-rw-r--r--   1 jnior     root       22280 Jan 25 14:21 manifest.json
-rw-r--r--   1 root      root         953 Jan 25 14:12 jniorboot.log
-rw-r--r--   1 root      root        1002 Jan 25 13:37 jniorboot.log.bak
-rw-r--r--   1 root      root       35938 Jan 25 09:16 web.log
  1853.9 KB available

bruce_dev />

I can now create an archive of these files using the ZIP command. I can use JAR as it is the very same command. It is just an alias. I tend to use the command name appropriate to the archive I am working with. If I am creating a ZIP I use the ZIP command but there is no particular requirement to do so.

bruce_dev /> zip -c /
 5 files saved
bruce_dev /> 

bruce_dev /> zip
     Size   Packed          CRC32        Modified
    37994     7545   80%  bce2daff  Jan 25 2018 14:21  jniorsys.log
    35938     5797   84%  d393e4a3  Jan 25 2018 09:16  web.log
     1002      472   53%  afae59c3  Jan 25 2018 13:37  jniorboot.log.bak
      953      458   52%  b473efb0  Jan 25 2018 14:12  jniorboot.log
    22280    10086   55%  06c9451f  Jan 25 2018 14:21  manifest.json
 5 files listed
bruce_dev />

Here I specified the root folder. No wildcard was needed since that is a folder and it assumes in that case that I mean all of the contents. When the command is issued without option and verbose listing is assumed.

Note that the compression ratios are reasonable even though I have made some trade-offs in the interest of speed. The verbose output can provide interesting information. For example here is the same archive creation with the long/verbose output.

bruce_dev /> zip -cl /
  deflate: /jniorsys.log (37994 bytes)
   saving: jniorsys.log (compressed 80.1%) 0.758 secs
  deflate: /web.log (35938 bytes)
   saving: web.log (compressed 83.9%) 0.547 secs
  deflate: /jniorboot.log.bak (1002 bytes)
   saving: jniorboot.log.bak (compressed 52.9%) 0.044 secs
  deflate: /jniorboot.log (953 bytes)
   saving: jniorboot.log (compressed 51.9%) 0.044 secs
  deflate: /manifest.json (22280 bytes)
   saving: manifest.json (compressed 54.7%) 1.851 secs
 5 files saved
bruce_dev />

Keep in mind when you consider timing that the JNIOR runs on a 100 MHz 32-bit micro-controller and not a multi-core GHz processor.

The (U)date option (-U) allows you to add or replace files in the archive. For example:

bruce_dev /> zip -us *.ini *.bat
 4 files saved
bruce_dev /> 

bruce_dev /> zip
     Size   Packed          CRC32        Modified
    37994     7545   80%  bce2daff  Jan 25 2018 14:21  jniorsys.log
    35938     5797   84%  d393e4a3  Jan 25 2018 09:16  web.log
     1002      472   53%  afae59c3  Jan 25 2018 13:37  jniorboot.log.bak
      953      458   52%  b473efb0  Jan 25 2018 14:12  jniorboot.log
    22280    10086   55%  06c9451f  Jan 25 2018 14:21  manifest.json
     4311      913   79%  36a57579  Jun 08 2015 12:47  flash/task.ini
     5449     2014   63%  88996b53  Jan 23 2018 08:33  flash/jnior.ini
       56       56    0%  3b661614  Jul 10 2015 08:54  flash/clean.bat
       17       17    0%  6a11f77a  Jun 30 2015 15:17  flash/dirs.bat
 9 files listed
bruce_dev />

Here I have added any INI and BAT files present on the JNIOR.

Yes, the JNIOR can do BAT batch files. These are not scripting files like you may know from MSDOS but still useful. For example I do a lot of testing on my development JNIOR and that ends up creating error files and sometimes dump files. My clean.bat file creates a CLEAN command that removes any errors.log or dump.log file. It also resets the attention flag using the STATS command.

bruce_dev /> cat flash/clean.bat    
@rm errors.log
@rm dump.log
@stats -a
@echo Cleaned

bruce_dev />

If you are concerned that an archive may not have transferred to the JNIOR properly, you can use the (V)erify (-V) option. Here are both the normal and verbose versions of the command.

bruce_dev /> zip -v
 9 entries found - content verifies!
bruce_dev /> 

bruce_dev /> zip -vl
  verifying: jniorsys.log (compressed)
  verifying: web.log (compressed)
  verifying: jniorboot.log.bak (compressed)
  verifying: jniorboot.log (compressed)
  verifying: manifest.json (compressed)
  verifying: flash/task.ini (compressed)
  verifying: flash/jnior.ini (compressed)
  verifying: flash/clean.bat
  verifying: flash/dirs.bat
 9 entries found - content verifies!
bruce_dev />

Note that beginning with v1.6.4 this verification not only check file integrity but decompresses the entries and verifies CRC32 checksums.

Here we see that JAR files can also be processed (regardless of command name).


bruce_dev /> zip -v flash/ModbusServer.jar
 42 entries found - content verifies!
bruce_dev /> 

bruce_dev /> jar -vl flash/ModbusServer.jar
  verifying: META-INF/
  verifying: META-INF/MANIFEST.MF (compressed)
  verifying: appinfo.ini (compressed)
  verifying: com/
  verifying: com/integpg/
  verifying: com/integpg/janoslib/
  verifying: com/integpg/janoslib/datastructures/
  verifying: com/integpg/janoslib/debug/
  verifying: com/integpg/janoslib/io/
  verifying: com/integpg/janoslib/system/
  verifying: com/integpg/janoslib/utils/

The (F)reshen command will update files in an archive ONLY if a newer version of the file is found. This does not add new files to the archive. If you do not provide a file specification the command will attempt to freshen all of the archive contents. For example, we haven’t changed anything and the freshen command does nothing.

bruce_dev /> zip -f
 nothing to do
bruce_dev />

But if we execute the MANIFEST command which adjusts the manifest.json database then we have a newer version. The archive can then be freshened.

bruce_dev /> manifest -ul
JNIOR Manifest      Thu Jan 25 14:52:55 EST 2018
  Size                  MD5                  File Specification
 37994    5627aaee400338b1b3479842cecabe29  [Updated] /jniorsys.log
 28304    2a8a593cc66fa62117497c28bf565d20  [Added] /
End of Manifest (2 files listed)

bruce_dev /> zip -f
 2 files saved
bruce_dev />

bruce_dev /> zip
     Size   Packed          CRC32        Modified
    35938     5797   84%  d393e4a3  Jan 25 2018 09:16  web.log
     1002      472   53%  afae59c3  Jan 25 2018 13:37  jniorboot.log.bak
      953      458   52%  b473efb0  Jan 25 2018 14:12  jniorboot.log
     4311      913   79%  36a57579  Jun 08 2015 12:47  flash/task.ini
     5449     2014   63%  88996b53  Jan 23 2018 08:33  flash/jnior.ini
       56       56    0%  3b661614  Jul 10 2015 08:54  flash/clean.bat
       17       17    0%  6a11f77a  Jun 30 2015 15:17  flash/dirs.bat
    38036     7559   80%  b2b18320  Jan 25 2018 14:53  jniorsys.log
    22434    10129   55%  059a09d9  Jan 25 2018 14:53  manifest.json
 9 files listed
bruce_dev />

The MANIFEST update both alters the database and posts to the system log file. So two files are updated.

To demonstrate the E(X)tract option I will move the ZIP file to the /temp folder so we don’t overwrite any existing files. Here I will extract the manifest database and take a look at its content.


bruce_dev /> mv /temp

bruce_dev /> cd /temp

bruce_dev /temp> dir -l
total 3
drwxrwxrwx   1 root      root           1 Jan 25 14:58 .
drwxrwxrwx   1 root      root           8 Jan 25 14:58 ..
-rw-r--r--   1 jnior     root       28361 Jan 25 14:53
  61.98 MB available (temporary)

bruce_dev /temp> zip -x *.json

bruce_dev /temp> dir -l
total 4
drwxrwxrwx   1 root      root           2 Jan 25 14:59 .
drwxrwxrwx   1 root      root           8 Jan 25 14:58 ..
-rw-r--r--   1 jnior     root       28361 Jan 25 14:53
-rw-r--r--   1 jnior     root       22434 Jan 25 14:53 manifest.json
  61.95 MB available (temporary)

bruce_dev /temp> cat manifest.json -j
  "date":"01/25/18 14:52:55",
bruce_dev /temp> 

We see here how the CAT command can format JSON for us.

Hmm… Perhaps before we release v1.6.4 JANOS I’ll have this command list the files it extracts. Seems like it should have at least indicated that it did what we wanted.

JANOS implements a file permission scheme modeled after Unix file permissions. Those familiar with the Linux recognize the permissions in JANOS file listings.

bruce_dev /> ls -v
total 12
drwxrwxrwx   1 root      root          10 Nov 28 10:23 .
drwxrwxrwx   1 root      root          10 Nov 28 10:23 ..
dr-xr-xr-x   1 root      root           1 Dec 31 1999  etc
drwxr-xr-x   1 root      root          49 Nov 28 10:16 flash
drwxrwxrwx   1 root      root           0 Dec 31 1999  temp
-rw-r--r--   1 root      root       39023 Nov 28 14:50 jniorsys.log
-rw-r--r--   1 root      root        1011 Nov 28 10:23 jniorboot.log
-rw-r--r--   1 root      root        1082 Nov 28 10:16 jniorboot.log.bak
-rw-r--r--   1 jnior     root       20585 Nov 22 11:52 manifest.json
-rw-r--r--   1 jnior     root        3332 Nov 21 13:31 jniorio.log
-rw-r--r--   1 jnior     root        1589 Nov 21 13:22 auxio.log
-rw-r--r--   1 root      root         177 Nov 07 14:10 access.log
  1891.7 KB available

bruce_dev />

There are 3 groups of ‘rwx’ permissions. The first is for the file owner. The second for the group associated with the file. And, the third is for everyone else. This implies some kind of User Groups. Note that on the Series 3 there are no User Groups and so file permissions were somewhat shortened.

JANOS allows you to define a User Group using the GROUPADD command. There is a root group by default to which noone belongs.

The GROUPS command lists the defined user groups and any users associated with each.

bruce_dev /> groups
 root        0    
 techadmin   2    
 techs       1    tech      

bruce_dev />

Back during JANOS development Kevin brought it to my attention how the TAB key was being used on the command line in other systems. Basically it served as an auto-complete function.

The TAB has been implemented in JANOS with some twists. Once you work with a Series 4 at the command line you just can’t handle a Series 3 where you have to type every character.

Where a file path or file name is expected the TAB will cycle through all of the valid names. For example In the following video I will type CAT and space and then hit TAB a few times slowly. When the desired file name appears I can hit ENTER. Let’s see jniorboot.log without typing jniorboot.log.

In the above post Bruce showed us how to use the TAB as an autocomplete for the commands that are available from the command line.

My favorite feature of the TAB autocomplete is filling out file names. In this quick video you will see that there are two files that names that begin with ‘jn’. You will see that i start typing the filename for ‘jniorsys.log’. I use the TAB key to cycle through the file names that start with “jn’.

Another great place that the TAB work is when working with the registry from the command line. “Who does that?” you ask. I do. Yes the registry tab in the DCP is wonderful but for some, yours truly, the command line is faster. Especially when the TAB is utilized!

In this video I want to change the hostname. Yes, there is a hostname command but I want to show how to use the registry from the command line.

You will see that i use ‘reg’ which is the alias for registry. I type ‘i’ then TAB to look through registry keys that start with ‘i’. I select the ‘IpConfig’ folder. Now I use TAB to cycle through the available registry keys. Once i find hostname I type ‘ =” and TAB again to see the value.

Use of the up arrow will enter the previous command and then I edit the key value using backspace and enter my change. Now the hostname is ‘kev-dev’

Take a look

In general the TAB performs context specific auto-complete.

By using TAB repeatedly each valid completion is displayed. If you find the a form of the entry that is appropriate you simply continue to build the command line and hit ENTER to execute. Generally TAB offers matching file and folder names from the current working folder or other folder if specified by preceding content on the command line.

You may begin to type an entry and then use TAB. Only those completions which incorporate the starting characters are shown. So if you wish to filter the possibilities you can enter the first or first couple of characters. Similarly you can enter a path to a folder and completions will be content from that folder.

A TAB used within the first word on a line will auto-complete valid commands and lines from those previously entered. Recently entered command lines are preserved in a history (See HISTORY command) which you can normally access using UP-ARROW and DN-ARROW. The TAB auto complete will include your history. So if you want to execute a MANIFEST command with the same options that you had previously run, you could hit ‘m’ followed by TAB and that complete command line will be one of the completions offered. Completions for the first word on a line will also include normal file entries which may be useful if you want to execute a program.

If the REGISTRY or REG command is being built, TAB instead offers completion options from the set of matching Registry Keys instead of folder content. In this case too the TAB can be used immediately after the ‘=’ to complete the balance of the REGISTRY command with the current content of the specified key.

With some experience you learn to use TAB efficiently and rarely need to enter an entire filename or Registry Key.

For example once you have copied a UPD file to the /temp folder you can generally execute the JRUPDATE command very quickly with the following keystrokes. This assumes that the UPD file is the sole occupant of that temporary folder.


Note that TAB presents you with optional auto-completion text alphabetically.

JANOS remembers the last 16 unique commands entered during a single session. This allows you to user the UP_ARROW and DOWN_ARROW keys to scroll through the recent commands. A command can easily be re-executed by scrolling back to it and hitting ENTER. A prior command can be first edited. That may be useful when wanting to add an option to its execution.

The HISTORY command displays the recorded commands. They are numbered but the HISTORY command does not give you the means to select from the list.

bruce_dev /> history
1: history
2: whoami
3: help passwd
4: passwd tech
5: passwd
6: users
7: useradd -cd tech
8: useradd
9: userdel
10: usermod
11: help usermod
12: help

bruce_dev />

Note that in addition to scrolling using the up and down keys you can use the TAB key to retrieve from the list.

TAB when used at the beginning of the command line offers valid commands in addition to file names. It includes those from the recent HISTORY. If you want to recall the ‘help usermod’ command given the above HISTORY you can simply type ‘h’ followed by TAB until you get the line that you are seeking. Note that TAB presents options alphabetically.

The WHOAMI command can be used to verify your login. While it seems trivial this command may be useful if you walk up to an existing login and need to confirm its permissions.

bruce_dev /> whoami
 jnior       1  Administrator
bruce_dev />

A password may be changed using the PASSWD command. The PASSWD command is available to all active accounts but only an Administrator can use it to alter the password of another account by specifying the account user name.

In addition, if you are not an Administrator changing the password on another account you will be asked to enter the current password before you can provide a new password. This is an added level of security.

bruce_dev /> help passwd
PASSWD [user]

Sets the password for the user. Defaults to the current user.

bruce_dev />

The USERDEL command removes 1 or more users from the system. This is not reversible. If you are uncertain about the deletion of a user you can add the Disabled tag to temporarily close the account using the USERMOD command. Multiple users can be removed by listing the users on the command line separated by spaces. The following would remove the ‘admin’, ‘user’ and ‘guest accounts.

userdel admin user guest

Note that there is no confirmation so use this command carefully. The command has no options and you must specify at least 1 user.

bruce_dev /> userdel
USERDEL user...

Removes one or more users from the system.
Multiple users can be specified separated by spaces.

bruce_dev />

You cannot remove yourself by the way. This command is also only available to an Administrator account.

The USERMOD command allows you to add or remove user account privileges or tags.

bruce_dev /> help usermod

 +A,-A          Add or remove Administrator rights
 +C,-C          Add or remove Control rights
 +D,-D          Disable or Enable the account

Modifies user privileges.

bruce_dev />

The Series 4 uses three different tags: Administrator, Control, and Disabled. These are described under the USERS command topic. Basically accounts tagged as Administrator can do everything. An account tagged for Control can only manipulate I/O status. And, a Disabled account is just that, disabled.

The USERMOD command actually violates the JANOS standard for command options. This command uses the plus sign ‘+’ as well as the dash ‘-‘ to designate an option. This is a legacy thing left over from the Series 3.

The following command disables the ‘user’ account by adding the Disabled tag:

usermod +d user

This would re-enable the account by removing the Disabled tag:

usermod -d user

Note that the USERMOD command can only modify a single user. So you cannot add a tag to a set of users. You must also specify a user.

If you are at all concerned about security the USERS command is important! The JNIOR ships with four (4) default user accounts each with an obvious password. Two (2) of those accounts are Administrators. Most customers are not aware of this. We have seen where a customer will change the password for the ‘jnior’ account and think they are good to go. In reality the ‘admin’ account remains active and accessible with the default password. The USERS command is the only way you can see what accounts are active.

The USERS command is part of JANOS and new to the Series 4. While the account situation, as far as having two (2) administrators, is the same with the Series 3 you can only see the active accounts on those older JNIORs by viewing the content of the /etc/passwd file. That file is not present on the Series 4.

Here is a default account status as shipped.

412dmx_r00 /> users
 admin       3  Administrator
 guest       0  Disabled
 jnior       1  Administrator
 user        2  Control, Disabled

412dmx_r00 />

In addition to the two (2) active administrator accounts there are two other account. Not that those are Disabled by default. JANOS allows you to disable an account without deleting it. It was not possible to do that with the Series 3. In that case the ‘user’ and ‘guest’ accounts are active.

The USERS command has no options. It lists each account and the tags associated. There are 3 possible tags:


An account tagged as Administrator has full access to the JNIOR. An administrator can access any file regardless of its permissions. An administrator can utilize every command available at the command line and can fully configure the JNIOR. An account with the Administrator tag has access to all of the capability afforded by the Control tag.


An account tagged as Control can manipulate I/O. This includes toggling relays and adjusting external module I/O settings. These users cannot configure the JNIOR and are subject to all file permissions.


You cannot log into a Disabled account. The account still exists and can be restored at any point. This tag can be used to temporarily make an account inaccessible.

The account tags can be added or removed using the USERMOD command. Users can be added or removed using the USERADD command or USERDEL command respectively.

The MODE command is rarely used and has one specific purpose. It controls whether or not the RS-232 (COM) port at the bottom of the JNIOR next to the LAN port is to be used for boot messages and command line interaction.

Issue the MODE command without parameters and it will display the current status of the “diagnostics port”. By default it is enabled. You would disable this if you were to use that serial port as part of your application to communicate with another device. In that case any spontaneous messages or command line interception would cause your protocol communications to fail, so you disable it.

To disable the diagnostics port issue the MODE -S command. You can think of the ‘S’ option as being “Silent”.

To enable the diagnostics port issue the MODE -V command. Okay in this case the option perhaps means “Verbose”. This is the default.

Now there is an Easter Egg here. JANOS has a few undocumented command options. There are very few and most of them provide some cryptic debug information more or less for my use. But here’s one for you.

The MODE -A command is undocumented. This enables the AUX port for command line interaction. Once you issue the MODE -A command any character received on the AUX port will start a command line process there. You cannot disable this mode. It is reset on reboot.

This “feature” was added to facilitate production program and test. The builder that initially programs the JNIOR and tests all of its I/O uses a command line connection through the AUX port to test the AUX port.

Here we see that a command line process is now active on the AUX port.

bruce_dev /> ps -v
      runtime       mem  hnd stk frm     id    desc
          36.667                          0: Idle Process
           1.395    2.6K   7   9          1: Network Service
           1.320    1.3K   7  17          2: System
           0.048   34.5K   7  12          4: Command/AUX
4 total          39.547 uptime

bruce_dev />

For this to work, you must not have an application running that uses the AUX port for communications. If you have used an application on that port you may need to prevent it from running on boot and to reboot the unit. The application may program timeouts and other port features that will interfere with the command line use. The port must also be set for 115,200 baud.