Support Tool

In JANOS 1.6.3 there are new security measures to harden the Beacon protocol. This has been an issue since its inception. Any action that commands or configures the JNIOR will require credentials to be supplied. Those credentials along with a valid NONCE will be evaluated by JANOS to determine if the action or configuration attempt will be allowed.

The NONCE will be supplied at the end of the ALL_INFO packet. To get a valid NONCE an ALL_INFO packet will need to be requested shortly before the NONCE will be used. In the Support Tool, for example, when someone wants to save the configuration we will request the ALL_INFO packet when displaying the new login dialog. Then when the user clicks OK with the new credentials we will have received the NONCE. The nonce is then used along with the credentials to provide the new authentication.

Here is code from the Support Tool that adds the code to extract the NONCE from the ALL_INFO packet if it exists.

        private void ParseAllInfo(ref JniorInfo jnrInfo, BinaryReader br)
        {
            jnrInfo.Gateway = ReadString(br);
            jnrInfo.PrimaryDns = ReadString(br);
            jnrInfo.SecondaryDns = ReadString(br);
            jnrInfo.DNSTimeout = IPAddress.NetworkToHostOrder(br.ReadInt32());
            jnrInfo.DHCPServer = ReadString(br);
            jnrInfo.DomainName = ReadString(br);
            if ("n/a".Equals(jnrInfo.DomainName))
                jnrInfo.DomainName = "";
 
            //stringLength = IPAddress.NetworkToHostOrder(br.ReadInt16());
            jnrInfo.Timezone = ReadString(br); // ASCIIEncoding.ASCII.GetString(br.ReadBytes(stringLength));
 
            jnrInfo.DHCPEnabled = (br.ReadByte() == 1);
 
            // if there is more information then the nonce is provided
            if (br.BaseStream.Position < br.BaseStream.Length)
            {
                jnrInfo.Nonce = ReadString(br);
            }
        }

Once the NONCE is known, the stored credentials can be used to send the security string to the SET_INFO command

        public static byte[] SetInfo(JniorInfo jnrInfo)
        {
            using (MemoryStream ms = new MemoryStream())
            using (BinaryWriter bw = new BinaryWriter(ms))
            {
                WriteString(bw, "SET_INFO");
                WriteString(bw, jnrInfo.IPAddress);
                WriteString(bw, jnrInfo.SubnetMask);
                WriteString(bw, jnrInfo.Gateway);
                WriteString(bw, jnrInfo.PrimaryDns);
                WriteString(bw, jnrInfo.SecondaryDns);
                bw.Write(BitConverter.GetBytes(IPAddress.HostToNetworkOrder((Int32)jnrInfo.DNSTimeout)));
                WriteString(bw, jnrInfo.DomainName);
                bw.Write((byte)(jnrInfo.AutoAnnounce ? 1 : 0));
                bw.Write((byte)(jnrInfo.IsNew ? 0 : 1));
                WriteString(bw, jnrInfo.Timezone);
 
                // use the NONCE and the stored jniorinfo.credentials to send the security string.
                SendSecurity(bw, jnrInfo);
 
                return ms.ToArray();
            }
        }

The Support Tool will prompt the user for the credentials every time they are needed.

                        /**
                         *  check to see if the NONCE was filled in via the ALL_INFO packet.  
                         *  This is new in 1.6.3.  if the NONCE was provided we will prompt 
                         *  for credentials.
                         */
                        var nonceAvailable = null != configureJnrInfo.Nonce;
                        if (nonceAvailable)
                        {
                            var loginDlg = new Common.LoginDialog(configureJnrInfo.IPAddress);
                            /**
                             * if the user cancelled providing the credentials then we cancel 
                             * the configuration update
                             */
                            if (DialogResult.Cancel == loginDlg.ShowDialog(this))
                                return;
 
                            /**
                             * update the saved credentials so they can be used when sending the beacon commands
                             */
                            configureJnrInfo.UserName = loginDlg.UserName;
                            configureJnrInfo.Password = loginDlg.Password;
                        }
 
                        BeaconService.Beacon.Broadcast(BeaconService.Beacon.SetInfo(configureJnrInfo), m_configSerial);

The credentials are needed when issuing a Reboot. In the support tool we ask for an updated ALL_INFO packet before displaying a reboot confirmation.

                /**
                 * request a new ALL_INFO packet is sent with a new NONCE
                 */
                BeaconService.Beacon.Broadcast(BeaconService.Beacon.RequestInfo(), jnrInfo.SerialNumber);
 
                /**
                 * confirm with the user the disire to reboot the selected jnior
                 */
                if (Interaction.MsgBox("Are you sure you want to REBOOT the selected JNIOR?", MsgBoxStyle.YesNo, "Reboot?") == MsgBoxResult.No)
                    return;
 
                /**
                 * check to see if the NONCE was filled in via the ALL_INFO packet.  
                 * This is new in 1.6.3.  if the NONCE was provided we will prompt 
                 * for credentials.
                 */
                var nonceAvailable = null != configureJnrInfo.Nonce;
                if (nonceAvailable)
                {
                    var loginDlg = new Common.LoginDialog(configureJnrInfo.IPAddress);
                    /**
                     * if the user cancelled providing the credentials then we cancel 
                     * the configuration update
                     */
                    if (DialogResult.Cancel == loginDlg.ShowDialog(this))
                        return;
 
                    /**
                     * update the saved credentials so they can be used when sending the beacon commands
                     */
                    configureJnrInfo.UserName = loginDlg.UserName;
                    configureJnrInfo.Password = loginDlg.Password;
                }
 
                /**
                 * send the reboot command
                 */
                BeaconService.Beacon.Broadcast(BeaconService.Beacon.Reboot(jnrInfo), jnrInfo.SerialNumber);

And here is the Beacon reboot code

        public static byte[] Reboot(JniorInfo jnrInfo)
        {
            using (MemoryStream ms = new MemoryStream())
            using (BinaryWriter bw = new BinaryWriter(ms))
            {
                WriteString(bw, "REBOOT");
 
                // use the NONCE and the stored jniorinfo.credentials to send the security string.
                SendSecurity(bw, jnrInfo);
 
                return ms.ToArray();
            }
        }
If it is not broke... Don't fix it!

I fully understand this mentality. Believe me. I am still using the Summer 9 version of Altium to layout PCBs here at INTEG. It’s like a half dozen years old. Meanwhile that company continues to generate updates and new versions. They are also painfully charging for them. How many times have you paid for an update and except for the version number you don’t see any difference or don’t need what happens to be new? Meanwhile Microsoft updates your PC overnight and the next day something isn’t working. And now you need to pay monthly for something that you had bought years before. I could rant on. But there is no reason to be phobic and rollback your JNIORs to older versions of JANOS just because you have not had the time to test.

But the Series 4 JNIOR updates are a different matter. In addition to the hardware, JANOS and its updates are my responsibility. Trust me there is a good reason we recommend that you update. Every new version of JANOS corrects a handful of critical bugs. There are often performance enhancements. New features augment what you already have. Everything that ran before will run now as legacy compatibility is paramount. And we DO NOT charge a dime for updates.

Just this morning I corrected a memory leak. A memory leak is when a piece of memory is allocated to store some information and once that information is no longer needed the memory is left to collect dust. Meanwhile the process repeats using up another block of memory. Eventually your JNIOR would run out of available memory and ultimately crash. In the short term everything tests out 100%. Your controller runs perfectly. But there is a ticking time bomb. Luckily, not everyone uses the function at fault in this latest leak. We discovered it in testing here. But if you believe that your JNIORs should be setting records for up time, you need to pick up these corrections. You need to update.

I wrote JANOS. I even coined the name. In fact there is no third party code in the entire OS. I did not even use the standard C Libraries supplied with the Renesas IDE. JANOS has its own C Libraries. There is a good reason for that. It puts us 100% in control. If there is a bug we absolutely can correct it. That’s a significant up side. The down side is that while I have decades of experience I can still create bugs as well as the next guy.

Fortunately as time passes the number of software issues decreases. Their complexity and obscurity increases. But eventually we exponentially approach a stable and reliable product. We are well along that curve now. Each JANOS update is critical in getting those improvements out to you.

As of this writing we have released JANOS v1.6.2 and v1.6.3 is in Beta test. Should you encounter an issue in v1.6.2 we can supply you with Beta or Release Candidate code. If the problem persists and we can replicate it then we will fix it immediately.

If you are concerned about running an update project because it may change all kinds of stuff and you don’t know what. I also understand that. But it is safe to manually update JANOS. Certainly you shouldn’t panic when you get new units with later versions of JANOS. They’ll work just as the older ones.

What Are Update Projects?

An Update Project is a procedure that can be executed using the Support Tool. The Support Tool is a Windows application that can be freely downloaded from the INTEG website Software Downloads Center (http://www.integpg.com/support/jnior/). The Support Tool lets you manage all of your JNIORs and allows you to update them singly or in groups. You would open the Update Project under the Update tab in the Support Tool.

The Update Project is actually a set of files including instructions for the update. These are contained in a ZIP library. While the update project has a ZIP file extension there is no need to extract files from the project or expand it anywhere. The Support Tool takes care of that for you.

Generally we use an Update Project when we are updating an application for you. Usually in that case we both need to update JANOS and perhaps its components like the DCP, and your application. So there are several steps involved. An Update Project is designed to handle all of that for you. You can open the Update Project and see the steps. That may help you to visualize what you are changing/updating.

It is possible to update JNIORs manually if you are not managing a large number of them and want to know what is going on. You can even disable parts of the Update Project and apply only the steps that you need.