Skip to content

0.13.0 - New MQTT V1 API

Compare
Choose a tag to compare
@reubenmiller reubenmiller released this 02 Nov 23:00
· 1054 commits to main since this release
49146ba

What's Changed in 0.13.0 (Summary)

New Features

Support for any linux distribution

A lot of hard work has gone into supporting thin-edge.io on any linux distribution. A new revamped installation script will automatically detect your linux distribution whether it is Ubuntu/Debian, Rocky Linux, Alpine or Poky (yocto), we have you covered.

thin-edge.io now publishes packages on cloudsmith in the following formats:

  • deb (Debian/Ubuntu)
  • apk (Alpine Linux)
  • rpm (RHEL/Fedora/Rocky Linux/Alma Linux)
  • tarball (for any other linux distribution without one of the above package managers)

The documentation has been updated to included the new simplified instructions so that you can deploy thin-edge.io in a simple memorable one-liner on your preferred linux distribution.

Community support for additional service managers (e.g. for distributions without systemd)

The support for additional service managers has been extended (via the community) allowing thin-edge.io to run seamlessly on linux distributions that don't have systemd installed.

The following service managers are provided along with an easy to use install script which will auto detect the correct system manager for your system (if you don't really know or care about which service manager to use):

  • sysvinit
  • openrc
  • runit
  • s6-overlay
  • supervisord

Check out the documentation for more details.

New MQTT API te/ topics

The new thin-edge.io MQTT API has been implemented to provide a consistent interface across the entire topic.

This release marks the transition from the now deprecated tedge/# topics to the new te/# topics. The new te/# topics implement the same features as the legacy interface plus much more.

The new MQTT API documents the full interface and brings the following functionality:

  • Device/service registration via MQTT
  • Publishing telemetry data to any device, child device or service on running on either types
  • All metrics now support a custom type in the topic
  • Public interface to send commands on the local te/ topic
  • More reliable processing of commands by leveraging MQTT retained messages for state transitions
  • Support custom root prefixes (e.g. being able to replace te/ with a custom prefix)
  • Support for updating digital twin data such as custom fragments (twin)
  • thin-edge.io errors are published on the te/errors topic (replacing tedge/errors)

⚠️ Notes

Services are now registered in Cumulocity IoT under new external identities, which will result in duplicated services in the cloud. The renaming was done so that the external identities would be consistent across all entities (child devices, services etc.). If you don't want to see the older services, then you they can be deleted by using the Cumulocity API or using tools such as go-c8y-cli, for example:

c8y devices list --query "c8y_Agent.name eq 'thin-edge.io'" --includeAll \
| c8y devices services list --includeAll \
| c8y identity list --filter "externalId notlike '*:*'" \
| c8y inventory delete

If you are having trouble with removing the old services then please reach out to us and we can offer assistance!

Local Cumulocity IoT API proxy #2261, #2230

A local Cumulocity IoT API proxy is provided by default to simplify accessing the Cumulocity IoT REST api from 3rd party components which makes requesting a local JWT token a thing of the past!

Check out the documentation for more details.

Generic configuration and log plugins

The c8y-configuration-plugin and c8y-log-plugin plugins have been refactored to be cloud agnostic. The plugins now only rely on the thin-edge.io interface (both local MQTT and API).

The table below shows the package names which are deprecated and their replacements:

Deprecated Package New Package
c8y-configuration-plugin tedge-configuration-plugin
c8y-log-plugin tedge-log-plugin

Note: In the near future, the c8y-firmware-plugin will also be refactored, but it didn't make it into this release.

⚠️ Notes

Since the plugins are now cloud agnostic, the configuration files used by the plugins have been relocated to the following paths, but don't worry this happens automatically during initialization of each plugin.

  • /etc/tedge/c8y/c8y-configuration-plugin.toml ➡️ /etc/tedge/plugins/tedge-configuration-plugin.toml
  • /etc/tedge/c8y/c8y-log-plugin.toml ➡️ /etc/tedge/plugins/tedge-log-plugin.toml

Re-using thin-edge.io plugins on child device

With the changes to the thin-edge.io MQTT API and the rewriting of the generic plugins, it enabled us to be able to run the same plugins either on the main device (e.g. the current/default setup) or on a child device. This allows you to reduce the amount of could you have to write even further.

The following plugins can be run either in main or child device mode:

  • tedge-agent (software management)
  • tedge-log-plugin (log management)
  • tedge-configuration-plugin (configuration management)

Detailed documentation and examples are not yet available, however they will be updated in the next coming weeks. However below shows a brief example how to run the tedge-agent on a child device to provide software management on child devices:

tedge-agent --mqtt-device-topic-id "device/child1//"

~80% Reduction of installation size - #2295

thin-edge.io installation size has dramatically decreased from ~40MB down to 8MB by packaging the binaries as a single "multi-call" binary. This is a significant step forward to reducing the overall footprint to allow running thin-edge.io on even smaller devices.

Minor changes

  • cli: Allow log filtering with $RUST_LOG by @Bravo555 in #2130
  • cli: use tedge instead of mosquitto as owner of mosquitto files/folders by @reubenmiller in #2156
  • feat(azure): extend supported topics on Azure IoT Hub bridge by @reubenmiller in #2278
  • general: Disable lock file if directory does not exist or no permissions by @Ruadhri17 in #2190
  • general: Handle binary uploads/downloads without attempting conversion to UTF-8 by @jarhodes314 in #2319
  • general: tedge-agent creates /var/tedge/cache directory on start-up by @rina23q in #2293
  • monitoring(collectd): increase the default intervals to avoid spamming iot platforms by @reubenmiller in #2141
  • mqtt: allow non-root users to read mosquitto configuration files by @Ruadhri17 in #2269
  • mqtt: Implement a converter that bridges the old MEA (measurements, events and alarms) topics to the new ones by @PradeepKiruvale in #2125
  • troubleshooting: Add support for config-dir flag to c8y-remote-access-plugin by @Ruadhri17 in #2211
  • troubleshooting: Check if sudo is available when using tedge agent operations by @Ruadhri17 in #2224

Bug fixes

  • cli: Exit with code 0 if service manager not present by @Ruadhri17 in #2204
  • cli: Fix the wrong exit code after the cloud connection test failure by @Ruadhri17 in #2182
  • cli: tedge connect c8y --test must not use a persistent MQTT session by @didier-wenzek in #2209
  • configuration: Fix: plugins don't update their internal representation of config files on file change by @Ruadhri17 in #2262
  • installation: explicitly remove all packages to avoid problems when dependencies are changed by @reubenmiller in #2124
  • installation: remove sudo dependency from installation scripts
  • mapper(aws): tedge-mapper-aws health message uses two different timestamp formats for up and down messages by @PradeepKiruvale in #2320
  • mapper(aws): tedge-mapper-aws prints errors for known non-json mosquitto bridge health status messages by @PradeepKiruvale in #2247
  • mapper(azure): azure tedge mapper fails to translate health status messages by @PradeepKiruvale in #2273
  • mapper(c8y): Avoid subscribing to s/dcr and forwarding s/ucr by @jarhodes314 in #2173
  • mapper(c8y): Use MQTT clean session for the mosquitto c8y bridge connection by @jarhodes314 in #2171
  • mqtt: Adding missing tests for c8y-log-manager and fixing a bug that causes mqtt actor termination by @Ruadhri17 in #2161
  • mqtt: Don't log authentication configuration when connecting to MQTT broker by @Bravo555 in #2249
  • mqtt: Enable concurrent processing of incoming and outgoing MQTT messages by @jarhodes314 in #2327
  • mqtt: Fix tedge agent's mqtt actor termination when wrong payload was parsed by @Ruadhri17 in #2241
  • packaging: prevent tedge-agent service stoppage when upgrading from tedge_agent by @reubenmiller in #2360
  • packaging: remove symlink using rm -f instead of using conditional logic by @reubenmiller in #2116
  • software: Add test for sm plugin max packages (and fixes) by @gligorisaev in #2198
  • software: Fix config and help command issues for tedge apt plugin by @Ruadhri17 in #2117
  • tedge init: add missing group permissions on base config_dir by @reubenmiller in #2140
  • telemetry: Clearing an alarm causes an EOL error by @PradeepKiruvale in #2162
  • telemetry: Fix device_id lookup while sending large events over HTTP #2234 by @albinsuresh in #2239
  • troubleshooting: Run remote access plugin with correct executable path in child process by @Ruadhri17 in #2277
  • troubleshooting: Sync file on atomically_write_file by @didier-wenzek in #2152
  • troubleshooting: use auto versioning to align with other components by @reubenmiller in #2120

Docs

What's Changed in 0.13.0 (full list)

New Contributors

Full Changelog: 0.12.0...0.13.0