Skip to content

USB commands

You can run diagnostic and maintenance USB commands on your MindConnect IoT2050.

The following lists various USB commands and the respective JSON format:

Prerequisites

  • A MindConnect device e.g. MindConnect IoT2050
  • A fat32 formatted USB stick

Procedure

To use a USB command, proceed as follows:

  1. Make sure your USB stick is fat32 formatted.
  2. Create a file named “ConBox_Commands.json” directly on the USB stick.
  3. Open the “ConBox_Commands.json” file in a text editor.
  4. Enter one of the "JSON Code" commands that you want to execute.
  5. Save the changes to the "ConBox_Commands.json".
  6. Plug the USB STick into the MindConnect device.

The following list shows various USB commands:

Copy extended logs to USB stick

The following command will collect all agent logs & system files, put them into ConBox_<UID>_Logs.tar.gz and ConBox_<UID>_SystemFiles.tar.gz files and copy them to the USB stick.

JSON Code:

    {
      "Commands": [
      {
        "Cmd":"CopySystemFilesToUsbStick",
    "TypeOfFiles": "AllSystemFiles"
      },
    {
    "Cmd":"CopyAgentLogsToUsbStick"
    }
      ]
    }

Note

For the MindConnect IoT2050 it can take up to 15 minutes to collect all files.

Copy archived logs to USB stick

Some Logs arrive every day at approx. 0 UTC. The extended logs therefore only contain the data of the current day. To get those logs for past days you need to run this command.

The following command will copy all archived log files to a sub directory on the USB stick and delete the copied log files from the archive folder optionally. The USB stick should be larger than 200 MB. Sub directories on the USB stick will have following structure: ConBox_<BOX ID>/<CurrentTime>Sample:ConBox_J47110815/20180318T191647

JSON Code:

    {
      "Commands": [
      {
        "Cmd":"CopyArchivedLogsToUsbStick",
        "DeleteAfterCopy":"false"
      }
      ]
    }

Note

To store the file locally, disable the log file upload.

Change system time

For the case that the system time should have been changed so that agent runtime is no longer able to connect to Insights Hub, you can retrieve the backend time to correct the system time. The following command provides the possibility to change the system time manually via ConBox_Commands.json file on the USB stick.

JSON Code:

    {
    "Commands": [
      {
        "Cmd": "SetSystemTime",
        "NewTime": "2017-09-19T12:34:56"
      }
    ]
    }

Note

You have to set to the current UTC (Coordinated Universal Time) time.

Change log file upload configuration

You can activate or deactivate the upload of log files via the ConBox_Commands.json file with the ChangeLogFileUploadConfiguration command on a USB stick. This reduces the amount of data that is stored for a environment on the backend side and reduces the mobile data costs for uploading data to Industrial IoT.

If log file upload is disabled, the log files are saved locally. This local space is limited (200 MB). The files are written and after reaching this limit the oldest files are overwritten.

After the log file upload has been reactivated, previously saved MERS log files are uploaded to Industrial IoT (max. 200 MB).

JSON Code:

    {
      "Commands": [
        {
          "Cmd": "ChangeLogFileUploadConfiguration",
          "EnableUpload": "true"
        }
      ]
    }

You can set the following command parameters:

Parameter Description
EnableUpload true: enable log file upload
false: disable log file upload

Note

Changing log upload by USB command will not be synchronized with the asset’s device configuration on Industrial IoT side.

Perform factory reset

For factory reset a ConBox_Commands.json file can be provided by using the USB stick.

The network and BoxMgr settings will be reset to their initial state on MindConnect IoT2050. All BoxMgr and MERS logging files and temporary files will be then deleted. At the end the MindConnect device will be restarted automatically.

Note

Offboard the asset and device before factory reset execution and perform the factory reset. After the execution, the asset and device should be onboarded again.

The factory reset command will be available on MindConnect IoT2050 version 03.01.00.00 b00x or later.

JSON Code:

    {
      "Commands": [
      {
        "Cmd": "DoFactoryReset",
        "DeviceID": "_MindConnect_ID_"
      }
      ]
    }

Note

The Unique ID has to be replaced with the serial number of the device

You can find more information on how to set a MindConnect IoT2050 to factory settings in chapter and Manual firmware update of MindConnect IoT2050

Restricted device configuration

The RestrictDeviceConfiguration command allows you to enable or disable online device configuration changes via Insights Hub user interface after the MindConnect device has been successfully onboarded.

If you need to adapt the configuration, you have to create a new onboarding file with new e.g. network parameter and insert this data again via USB.

Note

Make sure that all parameters are valid before exporting the configuration file to prevent unwanted changes that can lead to invalid network settings, for example.

Effects on online device configuration

There is no indication in the asset configuration user interface that the device configuration has been restricted on MindConnect IoT2050 device. If you try to change restricted device settings online, a message is logged in the diagnostic file on the MindConnect IoT2050 device that this setting could not be applied.

JSON Code:

{
    "Commands": [
        { "Cmd":"RestrictDeviceConfiguration",
            "networkInterfaces": [
                {
                    "name": "WebInterface",
                    "DHCP": "true",
                    "IPv4": "true",
                    "SubnetMask": "true",
                    "Gateway": "true",
                    "DNS": "true"
                },
                {
                    "name": "ProductionInterface",
                    "DHCP": "true",
                    "IPv4": "true",
                    "SubnetMask": "true",
                    "Gateway": "true",
                    "DNS": "true"
                }
            ],
            "general": {
                "RemoteServices": "true"
            }
        }
    ]
}

To prevent changes of network interface settings, the following parameters can be specified in the JSON command:

Parameter Description
name Name of the network interface.
Possible values:
- WebInterface
- ProductionInterface
DHCP - false: DHCP setting can be changed (default)
- false: DHCP setting can be changed (default)
IPv4 - true: IP address can not be changed
- false: IP address can be changed (default)
SubnetMask - true: Subnet mask can not be changed
- false: Subnet mask can be changed (default)
Gateway - true: Gateway address can not be changed
- false: Gateway address can be changed (default)
DNS - true: DNS address can not be changed
- false: DNS address can be changed (default)
RemoteServices1) - true: Remote services can not be used
- false: Remote services can be used(default)

1) Supported since MindConnect IoT2050 V03.07.01.00 b003.

Note

  • If you only provide some of the above mentioned parameters, then the omitted parameters will be ignored. This means that either the last restricted device configuration of these parameters will be used, or they will be treated as not set.
  • To enable device configuration changes of specific parameters again, a JSON command containing those parameters with value "false" can be provided via USB stick.
  • To turn it off a new JSON command file needs to be provided with "false" for all parameters.

Command samples

Enable Remote Services

To enable Remote Services on MindConnect IoT2050 again, following restricted device configuration can be applied via USB stick JSON command:

{
  "Commands":[
    {
      "Cmd":"RestrictDeviceConfiguration",
      "general": {
        "RemoteServices": "false"
      }
    }
  ]
}

On enabling device MindConnect IoT2050 LED USER2 will switch to green light, if no other system state with higher priority should be active.

Disable Remote Services

To disable Remote Services on MindConnect IoT2050, following restricted device configuration can be applied via USB stick JSON command:

{
  "Commands":[
    {
      "Cmd":"RestrictDeviceConfiguration",
      "general": {
        "RemoteServices": "true"
      }
    }
  ]
}

On disabling device MindConnect IoT2050 LEDs will switch to current system state.

Check network

Command description To find out, if the MindConnect device is successfully connected to Insights Hubusing the current onboarding configuration, a ConBox_Commands.json file containing "CheckNetwork" command on an USB stick can be used. After the network analysis is performed, the analysis results are written to the USB stick.

Depending on the current network situation, it might be possible that the execution of all internally executed tests will take some minutes.

Note

This command is available from the version MindConnect IoT2050 firmware V03.04.02.10 b003.

CheckNetwork command

Using following JSON command in a ConBox_Commands.json file, a network analysis is performed and the results are written to the USB stick:

    {
      "Commands": [
        {
          "Cmd": "CheckNetwork",
          "NetworkChecks": [
            {
              "CheckCloudConnection": "true"
            }
          ]
        }
      ]
    }
Parameter Description
CheckCloudConnection - true: Cloud connection check will be executed - false: Cloud connection check will not be executed.
NetworkChecks - List of checks that have to be executed.
- Currently CheckCloudConnection check is available only.

Result of CheckCloudConnection file

After the CheckCloudConnection network check has been executed, a result file is copied to the USB stick.

The name of the result file has the following format:

  • ConBox_<serial number>_<time stamp>_CloudConnectionCheck.log

The result file contains following sections:

  • Test output

    • Contains detailed information about the executed test steps according to the current network configuration of the MindConnect device.
  • Test summary

    • Contains following information.
    • Start and end time of the test.
    • Current IP addresses of web and production interfaces.
    • Result of trying to connect to Insights Hub directly without proxy.
    • Result of trying to connect to Insights Hub via proxy server, if a proxy server had been configured.
    • Information about the current proxy configuration.

Last update: April 9, 2024

Except where otherwise noted, content on this site is licensed under the Development License Agreement.