Skip to content

Services Overview

ToloMEO µServices is a collection of microservices built on the Py ToloMEO framework. Py ToloMEO supplies the runtime — services, plugins, NATS messaging, and task management — while ToloMEO µServices supplies the device- and resource-specific plugins wired into that runtime. Each microservice pairs one framework service class with one concrete plugin.

This page introduces the two microservices currently shipped, Glances and SWUpdate.

Glances

The Glances microservice (console script tlm_glances) monitors local CPU usage through Glances, a system-monitoring tool that exposes its data over a small HTTP API. It pairs a SingleSensorService with a SensorPlugin, GlancesPlugin, registered under the plugin id glances_stats.

GlancesPlugin polls the Glances HTTP API (http://<hostname>:<port>/api/<api_version>/cpu) on a fixed interval and pushes each CPU reading as it is read. The hostname (default localhost) and port (default 61208) locate the server. The api_version (default 4) and interval_s (a positive float, default 5.0) complete the plugin's configuration options.

SingleSensorService drives exactly one plugin and publishes its resolved configuration on attach.

What gets published

Each reading is published to the events.data subject as a SenML record, with metric names following glances_stats:cpu:<field>. See Glances Metrics for the full list and the SenML Format reference for the envelope shape.

SWUpdate

The SWUpdate microservice (console script tlm_swupdate) installs firmware updates. It pairs an OTAService with an OTAPlugin, SWUpdatePlugin, registered under the plugin id swupdate. Installation is delegated to a systemd unit invoked over D-Bus, rather than being performed in-process — see SWUpdate Update Flow for the full sequence and its rationale.

OTAService drives one OTA plugin and reports progress by pushing status events as the update advances through its state machine, rather than by being polled.

Relationship to Py ToloMEO

Py ToloMEO owns everything that is the same across every microservice built on it: the service/plugin lifecycle, command dispatch, NATS transport, and task scheduling. ToloMEO µServices owns everything that differs from one deployment to the next: which hardware or local resource is involved, and how to talk to it.

  • Py ToloMEO defines SingleSensorService, OTAService, SensorPlugin, and OTAPlugin. See Architecture.
  • ToloMEO µServices supplies GlancesPlugin and SWUpdatePlugin, the concrete subclasses that reach Glances and SWUpdate. See Plugin System.

A ToloMEO microservice therefore contains very little logic of its own: a plugin implementing connect/disconnect and the domain-specific work, and a thin main.py that wires the plugin into the matching framework service and starts it.