Provisioning
To provision the Kamea Linux Agent to connect to the Kamea platform, you need to create configuration files and run the agent with the appropriate parameters. The following steps demonstrate how to set up and run KLAS with a device provisioned using MQTT login-password mode.
Directory Structure
Here is an example of the directory structure required to run KLAS:
├── /usr
│ └── bin
│ └── KameaLinuxAgent
└── /var
└── KameaLinuxAgent
├── config
│ ├── config.json
│ ├── config-provisioning.json
│ └── trust-store
│ ├── broker_ca.crt
│ └── [other trusted certificates]
├── download
│ └── [downloaded firmwares]
└── cache_storage
└── cache_storage.json
KLAS can then be started with the following command:
KameaLinuxAgent -d /var/KameaLinuxAgent
The -d /var/KameaLinuxAgent argument specifies the data directory where KLAS will look for its configuration.
Configuration Files
Here is an example of the necessary configuration files:
For more information about the configuration parameters, refer to the Kamea Linux Agent Configuration Reference.
config/config.json:
{
"config-provisioning-path": "config/config-provisioning.json",
"log-level": "Debug",
"mqtt-connect-max-retry-interval-seconds": 3600,
"mqtt-connect-min-retry-interval-seconds": 1,
"upload-telemetries-interval-seconds": 10,
"tmp-download-dir-path": "/var/KameaLinuxAgent/download",
"http-trust-store": "/var/KameaLinuxAgent/config/trust-store",
"cache-storage-path": "/var/KameaLinuxAgent/cache_storage/cache_storage.json"
}
The following config-provisioning.json file contains the device-specific provisioning parameters.
This example uses login-password mode for MQTT authentication.
Other modes are available and are documented in the getting started page.
config/config-provisioning.json:
{
"deviceId": ["your-device-id"],
"hostname": ["your-kamea-hostname"],
"channel": "mqtt",
"mode": "login-password",
"key-store": "",
"passphrase": "",
"password": ["your-device-password"],
"port": ["your-mqtt-port"],
"trust-store": "config/trust-store/broker_ca.crt"
}