How to change the configuration of a Site Controller
The configuration of a site controller can be deployed from the cloud. However, either for tests or troubleshooting purposes you can change and apply the configuration. Please read the complete section carefully before changing any configuration in the file.
This is not the official supported path to make configuration changes. It is just intended for trained personnel when doing specific tests or maintenance task on the systems.
The configuration file is located in $SiteControllerPath$/config/sensor_config.xml. Please do a backup of your current configuration before trying any of the procedures described in this section. You can open it an edit using any editor. You can use vi directly on the system or get the file to your system and edit it. In the latter case, we recommend to use the Notepad++ with the XML tools plugin, that will allow you to serialize the changes before publishing. This latter step is important, because some editors may add unnecessary tabs or carriage returns to the file that may render the configuration invalid.
You have several options for changing the configuration:
- Recommended procedure: you can publish a new configuration for the system from the cloud interface, use our simple templates and distribute the configuration to the different sites. This process is automated and is the recommended path in order to keep track of changes, updates and possible issues.
- Change the configuration file XML. After doing this, you will need to restart both the mosquitto broker and the Site Controller, with the following commands sequence:
- Alternatively, you can publish the new configuration through MQTT in the topic /config/complete_update using any mosquitto client available (like MQTTfx).
In both cases, after changing a configuration, you can check the outcome in the log of the module in charge of analyzing and providing the configuration to other modules: $SiteControllerPath$/log/ConfigProvider.log. Doing a #tail -f on the file will give you the latest running values during the configuration changes.
If the process of updating the configuration is successful. If not, the log will tell you which part of the configuration has failed, and revert to the last known valid configuration. Below there is the log that we expect after a proper configuration change. In case there is some error, there will be information regarding where the problem has ocurred.