Import and export the MQTT Publisher configuration
- Last UpdatedAug 28, 2024
- 5 minute read
You can import and export an Edge Configuration or a Device Configuration or the whole Publisher configuration to a text file. You can edit the exported file offline. Use the notepad or an externally available JSON editor to view or edit the configuration. You can add, delete, or modify any PCS attributes and edit Edge Gateway or Device connection parameters.
The export/import feature allows you to:
-
Edit the configuration offline
-
Save the configuration outside
-
Create a similar configuration on another server
Export the MQTT publisher configuration
-
Right-click on the required Edge Gateway or a Device which you want to export.
-
Select Export to export a particular hierarchy or select Export Entire Configuration to export the whole publisher configuration.

-
In the File Download Window, provide the location where you want to save the exported file.
-
Select Save.
The configuration file will be saved with the file extension .oicfg. The different types of exported files are explained below in detail.
Edge Gateway configuration export file
For edge gateway, the file name of the exported file will be <edge gateway name>.edge.oicfg.
JSON file example for the edge gateway configuration:

For the description of different fields in the example, refer to the "Field Description" section.
Device configuration export file
For device, the file name of the exported file will be <device name>.dev.oicfg.
JSON file example for the device configuration:

For the description of different fields in the example, refer to the "Field Description" section.
Entire Publisher configuration export file
This will include both Edge Gateway and Device configuration information. For the entire configuration, the file name will be <selected node name>.all.oicfg.
JSON file example for entire publisher configuration:

For the description of different fields in the example, refer to the "Field Description" section.
Field Description
The following table describes different fields that you can see in a JSON file:
|
Field name |
Description |
|
attributepath |
Depicts the path or the hierarchy of the attribute in the data source. In this case, the data source is Galaxy. The format of the attribute path is <GalaxyName>:ObjectName.AttributeName. Refer to "Reference Strings" in the Application Server User Guide for more information. |
|
hierpath |
Depicts the hierarchical view of the attribute in the OI MQTT subscriber hierarchy. Its format is similar to the the Model View of the hierarchical path in the IDE in System Platform. For example, assume the galaxy name in the IDE is "newGalaxy" and the attribute name is "Attribute001." If the hierarchy of the model view is Enterprise > Site > Plant, then the hierarchy path is represented as newGalaxy:Enterprise.Site.Plant.Attribute001.
If this field is not specified, the value of attributepath will be used to depict the hierarchical representation of the OI MQTT subscriber hierarchy. |
|
datatype |
Specifies the data type. Refer to the Data Types section for more information. |
|
isarray |
Specifies whether the attribute is an array attribute or not. Set this field to false as array is not supported. |
|
readOnly |
Specifies whether the attribute is a read-only attribute or not. Set this field to true is the attribute is read-only. Otherwise, set it to false. |
Data Types
The following table describes the different values for the datatype fields in the JSON file, and the corresponding datatypes:
|
Value |
Data Type |
Description |
|
3 |
Boolean |
A simple type representing Boolean values of true or false. |
|
4 |
Char |
An integral type representing unsigned 16-bit integers with values between 0 and 65535. |
|
5 |
SByte |
An integral type representing signed 8-bit integers with values between -128 and 127. |
|
6 |
Byte |
An integral type representing unsigned 8-bit integers with values between 0 and 255. |
|
7 |
Int16 |
An integral type representing signed 16-bit integers with values between -32768 and 32767. |
|
8 |
UInt16 |
An integral type representing unsigned 16-bit integers with values between 0 and 65535. |
|
9 |
Int32 |
An integral type representing signed 32-bit integers with values between -2147483648 and 2147483647. |
|
10 |
UInt32 |
An integral type representing unsigned 32-bit integers with values between 0 and 4294967295. |
|
11 |
Int64 |
An integral type representing signed 64-bit integers with values between -9223372036854775808 and 9223372036854775807. |
|
12 |
UInt64 |
An integral type representing unsigned 64-bit integers with values between 0 and 18446744073709551615. |
|
13 |
Single |
A floating point type representing values ranging from approximately 1.5 x 10 -45 to 3.4 x 10 38 with a precision of 7 digits. |
|
14 |
Double |
A floating point type representing values ranging from approximately 5.0 x 10 -324 to 1.7 x 10 308 with a precision of 15-16 digits. |
|
16 |
DateTime |
A type representing a date and time value. The OI MQTT Publisher will publish the value in unit of number of milliseconds since January 1, 1970 UTC. The OI MQTT Subscriber will convert it to VT_DATE Windows data type so that System Platform applications can consume it as a Window data type. |
|
18 |
String |
Represents Unicode character strings. |
Import the MQTT Publisher configuration
You can edit the exported file and import it back to the MQTT Publisher. This feature helps you to:
-
Edit the configuration offline
-
Save the configuration outside
-
Import to create similar configuration on another server
The configuration parameters in an imported file and exported file are similar. Refer to the "Field Description" section above for more information on the parameters.
To import the MQTT Publisher configuration:
-
On the MQTT Publisher hierarchy, right-click on the required node where you want to import the configuration.
-
If you right-click on the Edge Gateway node, you can either import an Edge Gateway configuration file, or the entire publisher configuration file.
-
If you right-click on a Device node, you can import only a Device configuration file.
Note: You cannot import a device configuration file on an edge gateway node and vice versa. Else, an error message is displayed.
-
-
Select Import.

-
Select the file that you want to import.
-
To import the Edge Gateway configuration, the file name should be <edge gateway name>.edge.oicfg.
-
To import the Device configuration, the file name should be <device name>.dev.oicfg.
-
To import the entire publisher configuration, the file name should be <selected node name>.all.oicfg.
Note: If you import the configuration of an edge gateway or device that already exists, the configuration in the imported file will replace the existing configuration. If you import the entire publisher configuration, the newly imported configuration replaces the entire existing configuration.
-
