USB commands¶
You can run diagnostic and maintenance USB commands on your MindConnect Nano.
The following lists various USB commands and the respective JSON format:
Prerequisites¶
- A MindConnect device e.g. MindConnect Nano
- A Single MBR partition fat32 formatted USB stick
- USB stick should at least have 500MB free space
- Json file encoding - ASCII or UTF-8
Procedure¶
To use a USB command, proceed as follows:
- Make sure your USB stick is fat32 formatted.
- Create a file named “ConBox_Commands.json” directly on the USB stick.
- Open the “ConBox_Commands.json” file in a text editor.
- Enter one of the "JSON Code" commands that you want to execute.
- Save the changes to the "ConBox_Commands.json".
- 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"
}
]
}
Waiting time
- Duration of waiting time to copy extended logs to USB stick for Nano is lesser than 5 minutes.
- Also the duration of the waiting time may vary due to factors such as the data size to be copied to the USB stick and the CPU load generated by concurrent tasks.
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 Industrial IoT, 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 Nano. 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 Nano 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 Element to factory settings in chapter Manual firmware update of MindConnect Nano and Manual firmware update of MindConnect IoT2040
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 Nano device. If you try to change restricted device settings online, a message is logged in the diagnostic file on the MindConnect Nano 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 Nano V03.04.06.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 Nano again, following restricted device configuration can be applied via USB stick JSON command:
{
"Commands":[
{
"Cmd":"RestrictDeviceConfiguration",
"general": {
"RemoteServices": "false"
}
}
]
}
Disable Remote Services
To disable Remote Services on MindConnect Nano, following restricted device configuration can be applied via USB stick JSON command:
{
"Commands":[
{
"Cmd":"RestrictDeviceConfiguration",
"general": {
"RemoteServices": "true"
}
}
]
}
Check network¶
Command description To find out, if the MindConnect device is successfully connected to Insights Hub using the current onboarding configuration, a ConBox_Commands.json file containing "CheckNetwork" command on an USB stick can be used. After the network analysis has been performed, the analysis result will be 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 Nano firmware V03.04.02.10 b003.
CheckNetwork command¶
Using following JSON command in a ConBox_Commands.json file, a network analysis will be performed and the result will be 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 will be 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.