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:
bash
KameaLinuxAgent -d /var/KameaLinuxAgent
The -d /var/KameaLinuxAgent argument specifies the data directory where KLAS will look for its configuration.
Configuration Files
KLAS uses two configuration files, both located in the config/ subdirectory of the data directory:
config.json— general agent settings (log level, connection intervals, paths).config-provisioning.json— device-specific provisioning parameters (credentials, server address, certificates).
Warning
The filenames config.json and config-provisioning.json are fixed and cannot be changed. KLAS expects these exact names inside the config/ subdirectory.
If either file does not exist at startup, KLAS will create it with default values.
All path fields in both files are relative to the data directory specified with -d.
For a full description of every field, refer to the Kamea Linux Agent Configuration Reference.
config/config.json
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": "download",
"http-trust-store": "config/trust-store",
"cache-storage-path": "cache_storage/cache_storage.json"
}
config/config-provisioning.json
This 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.
json
{
"deviceId": "your-device-id",
"hostname": "your-kamea-hostname",
"channel": "mqtt",
"mode": "login-password",
"password": "your-device-password",
"port": 8883,
"trust-store": "config/trust-store/broker_ca.crt",
"key-store": "",
"passphrase": ""
}
key-storeandpassphraseare not used inlogin-passwordmode and can be left empty.