The configuration file is essential for the proper functioning of the controller, as it includes important settings related to its communication interfaces, such as MQTT, Telegram, and NATS. Specifically, the configuration file must include four required entries, which need to be configured for each controller. These entries are:
  • plcnext
  • mqtt
  • telegram
  • nats
Below, we will provide detailed information on each entry, including the required parameters and any optional ones. The configuration file can be found in the /etc folder of the ppl-base repository and is listed as config.json.

plcnext

Required Parameters

ipAddress
string
required
This is the IP address of the controller. It should always be configured to the controller’s current IP address, as it is used to create sockets.Example: 192.168.1.10

Optional Parameters

Though these parameters are not required for the controller to operate, it is good practice to include them in the configuration file to avoid losing track of login credentials.
username
string
The username for logging into the WBM of the controller or a shell session. This should be set to admin.Example: admin
password
string
The password for logging into the WBM of the controller or a shell session.Example: password

mqtt

Required Parameters

broker
object
required
This entry contains all relevant information for the MQTT broker.Example:
{
  "broker": {
    "ipAddress": "192.168.1.10"
  }
}

telegram

Telegram is preconfigured in the config file to enable notifications and alerts. These include livebit messages every 24 hours and alerts for critical device failures in the system. If the customer does not wish to receive updates via Telegram, they simply need to remove this entry from the config file.

Required Parameters

chatID
string
required
Represents the unique chat ID of the Telegram channel. Each Telegram channel has its own unique ID.Example: 123456789
botToken
string
required
A token consisting of letters and numbers, required for authorizing the bot and sending requests to the Bot API. The Bot API is already added to the Telegram channel.Example: 123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ

nats

Required Parameters

The required parameters are used to set up a local NATS server on the controller. This NATS server is used to integrate with custom applications developed by the customer.
local
object
required
The required parameters are used to set up a local NATS server on the controller. This NATS server is used to integrate with custom applications developed by the customer.Example:
{
  "local": {
    "username": "client",
    "password": "password"
  }
}

Optional Parameters

The optional parameters are used for setting up a NATS connection to the cloud, which hosts a database for storing data. By providing these parameters, the controller can periodically push data to the cloud.
cloud
object
The optional parameters are used for setting up a NATS connection to the cloud, which hosts a database for storing data. By providing these parameters, the controller can periodically push data to the cloud.Example:
{
  "cloud": {
    "username": "client",
    "password": "password",
    "ipAddress": "192.168.1.5",
    "bucket": "my-bucket"
  }
}