The watcher subscribes to file changes to the thin-edge.io tedge.toml file (under /etc/tedge/tedge.toml
) and on any changes it reads the files, and publishes each of the configuration sections as individual MQTT messages on the config/<section_name>
topic. This enables users to access any thin-edge.io configuration values directly via MQTT.
When ever there is a file change on the /etc/tedge/tedge.toml there will be send out retained messages on the topic 'config/{{SECTION}}'. Below shows an example of how to subscribe to the configuration via MQTT:
tedge mqtt sub 'config/#'
[config/config] {"version": "2"}
[config/c8y] {"url": "test-ci-runner01.latest.stage.c8y.io", "proxy": {"bind": {"address": "0.0.0.0"}, "client": {"host": "tedge"}}}
[config/mqtt] {"bind": {"address": "0.0.0.0", "port": 1883}, "client": {"host": "tedge"}}
[config/http] {"bind": {"address": "0.0.0.0"}, "client": {"host": "tedge"}}
[config/apt] {"name": "(tedge|c8y|python|wget|vim|curl|apt|mosquitto|ssh|sudo).*"}
[config/enable] {"sudo": true}
Technical summary
The following details the technical aspects of the plugin to get an idea what systems it supports.
Languages | python3 |
CPU Architectures | all/noarch . Not CPU specific |
Supported init systems | systemd |
Required Dependencies | python3 |
Optional Dependencies (feature specific) | - |
The following linux package formats are provided on the releases page and also in the tedge-community repository:
Operating System | Repository link |
---|---|
Debian/Ubuntu | |
RHEL/CentOS/Fedora/openSUSE | |
Alpine Linux |
- The following systemd services are installed:
- `tedge-config2mqtt-watcher``
The following packages are required to use the plugin:
- python3
The following tools are requires for local development. Please install them before following the instructions:
- nfpm - Tool to build linux packages
- go-c8y-cli - A Cumulocity IoT CLI app
- c8y-tedge extension - go-c8y-cli extension for thin-edge.io to help with bootstrapping
-
Build the package
just build
-
Start the demo
just up
-
Activate your Cumulocity IoT session in go-c8y-cli where you want to bootstrap the device to
set-session
set-session
is part of go-c8y-cli, check out the documentation for instructions on how to install and create your session if you don't already have one. -
Bootstrap the device
just bootstrap
The bootstrap command used the c8y-tedge extension.
just down