Adapters

Introduction

An Adapter is a custom software component that is deployed on IoT Gateway devices executing the ClearBlade Edge.

Each Adapter consists of a name, a small number of administrative commands, and a small number of files comprising the administrative and executable assets of an adapter. The files comprising an adapter will consist of executable code and supporting libraries as well as shell scripts used to administer adapters.

To learn how to create and configure an adapter, click here

Purpose

To serve as a proxy between the ClearBlade platform and IoT devices that cannot directly communicate with the ClearBlade Platform. ClearBlade provides various adapters out-of-the-box for different type of protocols like BLE, Modbus, Bacnet, Canbus, ZMQ, AMQP, xDot etc. Checkout ClearBlade’s Github

Commands

Once an adapter has been successfully deployed to an Edge, it can be started, stopped, or restarted using Edge Management portion of the adapter’s page, located within the ClearBlade Platform developers console. The status of the adapter on each edge is determined by the returned output of the status command from the adapter’s configuration, either “Running” or “Stopped”.If the adapter is not successfully deployed to an edge, the edge will be found in the Disconnected Edges table.

Shell commands or scripts need to be specified in the Configuration section within the adapter’s settings so that the adapter can be correctly administered. Commands are executed from the directory where the Edge was started. The currently supported commands are:

Deploy Command

A command or shell script that will be run after the files are installed on a ClearBlade Edge. This is an optional command.

Start Command

A command or shell script that will be executed to start the adapter on a ClearBlade Edge.If a start command is not specified , the adapter would need to be manually started by connecting to the gateway device (via ssh) and issuing an appropriate start.An adapter can be started on one or multiple edges from the Stopped tab of the Edge Management table.

Stop Command

A command or shell script that will be run to stop the adapter on a ClearBlade Edge.The stop command is an optional command.If the Stop Command is not specified, the adapter would need to be manually stopped by connecting to the gateway device (via ssh) and issuing an appropriate stop command.An adapter can be stopped or restarted on one or multiple edges from the Running tab of the Edge Management table.

Status Command

A command or shell script that will be run to determine the status of the adapter on a specific ClearBlade Edge. A shell script that echoes the status of an adapter should be supplied. The shell script should account for and echo the following values:
* Deployed * Running * Stopped

Undeploy Command

A command or shell script that will be run to uninstall the adapter from a ClearBlade Edge. The undeploy command is an optional command. If the Undeploy Command is not specified the default behavior of the ClearBlade platform is to remove the adapter files from the directory where Edge is running. The default undeploy behavior therefore would not delete any log files that were created or remove any files that were moved to adapter specific directories.

Logs Command

A command or shell script that will be used to retrieve any logs printed out by the adapter while it is running.The logs command is an optional command. If the Logs Command is not specified, any log files written by the adapter would need to be viewed manually (via ssh or sftp).You can view the adapter logs, determined by executing the Logs command in the adapter configuration by clicking the View button of the logs column in the Edge Management table.