Overview

The device side firmware implementation is platform and flow specific. Bellow details of a suggested architecture implementation for an Xyte enabled device.

The flow contains four main parts:

  1. Initialization
  2. Registration loop
  3. Telemetry loop
  4. Handling code (commands / config / etc)

Initialization

When the agent first starts it should check if "Auth data" is present (should be persisted to local storage).

If no "Auth data" is present, the device should move to the "Registration loop" until registration is successful.

A check should be made if there is a pending command that might caused the device to reset (e.g. reboot, firmware update, etc). If so, the device should get and process the command, and update the service once the command finished.

The devices moves to the "Telemetry loop" stage.

Registration loop

When the device comes online and gains network access, it should immediately start trying to register with the server. It is suggested to wait 10-30 minutes between registration attempts, but to continue trying until successful.

Telemetry loop

Every 5-30 seconds or when a significant event happens (e.g. some operation finished), the device should update the server on its current status using the Send Telemetry mechanism.

A suggested implementation is for the device to collect data from the system and use Send Telemetryto update the server.

Depending on the response three flows might happen:

  1. 401 Authorization error - The device was deleted, it should clear "Auth data" and move to the "Registration loop".
  2. 200 Success - No pending commands/etc, continue the flow.
  3. 200 Success - Pending commands / licenses / etc move to "Handling code".

Handling code

When the Send Telemetry response contains notifications on pending commands, configuration updates, licenses, etc. The device should parse the data and make the appropriate calls to the server to get the updates, apply them and continue with the "Telemetry loop".

Sample sequence

Example of full flow: register, send telemetry and handle a pending command.