Gateway Edge Agent

The Gateway Edge Agent (GEA) allows for running Edge Workflows on Edge Compute Devices. Doing so brings the power of Losant’s Visual Workflow Engine to a local environment within your IoT application, allowing for offline support, integrations with industrial equipment, and local hardware control.

The GEA is deployed as a Docker container into a computer or server on your local network. As a general rule, if the hardware is capable of running Linux, it is capable of running the GEA. However, the agent does have recommended system requirements.

Use Cases

There are a number of use cases that the Gateway Edge Agent exposes that would otherwise be difficult to implement in an IoT solution.

Integrations with Industrial Equipment

The GEA supports a variety of protocols for interfacing with various PLCs, registers, serial connections, and network devices. Building an integration with any one of these requires a significant amount of custom code; but each is exposed through the GEA as workflow nodes for different protocols and operations.

Since the Gateway Edge Agent runs as a Docker container, it is also possible to build your own interface with a protocol that Losant does not yet support and communicate between that integration and the GEA. This allows for extensibility of the agent where it is needed.

Offline Buffering

If the Gateway Edge Agent loses its internet connection, any generated state reports and custom MQTT topic messages are buffered on the device and replayed when the agent re-establishes a connection. This prevents loss of data in low connectivity environments and ensures that any cloud-side logic that should execute on receipt of those messages is maintained.

While it is possible to write your own message buffer similar to how the GEA works, there are a number of protections built into the agent, such as:

  • Messages are replayed at a speed to avoid the device being kicked off of Losant’s MQTT broker.
  • The queue has a maximum depth to prevent running out of memory on the device and causing a crash.

Local Control

Using the suite of logic nodes provided in Edge Workflows, it is possible to build a fully automated local control suite that can, for example, automatically adjust equipment operations or trigger emergency shutdowns without human intervention.

Also, through Device Commands and Virtual Buttons, those controls can be manually overridden whenever the agent has an internet connection. With a well-designed workflow, the thresholds at which the automated controls are triggered can also be adjusted through adjustments sent down from the cloud platform.

Getting Started with the GEA

To get started with the Gateway Edge Agent, you will have to follow these steps. More detailed information is available within the respective documentation for each section.

  1. In your application, create a new device and set its device type to “Edge Compute”. Only devices of this type can receive workflows to run locally from the Losant platform.
  2. Create an access key and secret for your new device. While we always recommend generating a new key/secret pair per device, this step may not be necessary if you already have a key and secret configured to work for all devices in your application, or to work for all devices with a tag that you applied to your device during creation.
  3. Deploy the Gateway Edge Agent (GEA) to your new device and configure it using the device ID, key, and secret from your previous steps. The GEA software package is necessary to receive Edge Workflows from Losant and to run them on the device.
  4. Create a new workflow of the “Edge Workflow” type. Make sure the Target Agent Version is less than or equal to the version of the Gateway Edge Agent you deployed to the device in the previous step.
  5. Set up your workflow using any of the nodes in the palette and save your work.
  6. When it is ready, deploy a version of your workflow to your Edge Compute device(s). If the device is connected to Losant’s MQTT broker – or when it connects next – the edge workflow version will deploy to the device and it will begin executing.

Installing or upgrading the GEA requires physical access to the device. After that, management of all edge compute functionality - device configuration, workflow setup and deployment schedules – takes place within the Losant platform and updates are pushed down to the devices over the internet.

Was this page helpful?

Still looking for help? You can also search the Losant Forums or submit your question there.