Configuration
Summary
This section explains the configuration of the smartCORE by the user.
Structure of the configuration
The configuration of the smartCORE software essentially consists of two configuration files stored on the edge device,
- the static configuration
/sdi/config/smartcore.json, as well as - the dynamic configuration (or application-specific measurement configuration)
/sdi/config/smartcore_dynamic.json
Both configuration files contain JSON and are essentially structured as follows
{
"timeout": 10000,
"plugins":
[
"SomePluginFactory",
"AnotherPluginFactory",
...
],
"modules":
[
{
"module": "SomePluginInstance",
"factory": "SomePluginFactory",
"config":
{
"someKey": "someValue",
...
}
},
{
"module": "AnotherPluginInstance",
"factory": "AnotherPluginFactory",
"config":
{
"anotherKey": 42,
...
}
},
...
]
}
Here, timeout represents a period of time within which the module initialization is waited for. Otherwise, the initialization of individual modules is considered to have failed. The default setting of this parameter is 10,000 ms (10 s).
The factories (classes) of all modules used must be listed in the "plugins" list.
Within the "modules" list, all module instances used are then configured in the form of JSON objects. The following structure then always applies to a module configuration
{
"module": <name of the module instance>,
"factory": <factory or class of the module instance>,
"config" :
{
<parameter>: <JSON value of the parameter>,
...
}
}
The JSON value of a parameter can represent not only scalars of different data types, but also JSON objects (structures) or JSON arrays (lists).
The static configuration /sdi/config/smartcore.json also contains global parameters.
External configuration files (configFile)
In addition to the "config" object, a module instance can reference an external JSON file via the optional "configFile" parameter. The contents of that file are loaded and merged before the inline "config" — the inline "config" always takes precedence in case of conflicts.
{
"module": "motor1",
"factory": "modbus",
"configFile": "motor_base.json",
"config":
{
"address": 5
}
}
The file motor_base.json contains a plain JSON object using the same syntax as "config":
{
"baudrate": 19200,
"parity": "none",
"stopBits": 1
}
The result of the merge is equivalent to:
"config":
{
"baudrate": 19200,
"parity": "none",
"stopBits": 1,
"address": 5
}
Path resolution: The path is resolved relative to the configuration directory /sdi/config/. Subdirectory paths are supported ("subfolder/motor_base.json"); absolute paths are used as-is.
Use case: Shared base parameters (e.g. bus properties) can be placed in a single file and referenced by multiple module instances, avoiding duplication across smartcore_dynamic.json deployments.
Merge behaviour:
- Scalars and objects: the value from
"config"overwrites the value from the file. - Arrays: entries from the file and from
"config"are concatenated.
Error handling: If the file is missing or contains invalid JSON, a warning is written to the log and the file is skipped. This does not abort the smartCORE startup.