Agents Overview
What is an Agent?
Connecting a device to the IoTHub needs the installation of an Agent at the IoTHub server edge or a remote edge in the same network. An Agent is a standalone application which is able to control multiple devices by implementing one or more communication protocols, where each of these devices is represented by a thing. Agents communicate with the IoTHub via its gateway, which has a dedicated port number. For the identification of the Agents, each time that you create a new Agent, the IoTHub will automatically generate new unique identifiers (id and token) for it. Then, you can use these identifiers for executing a particular Agent as described in Install IoTHub Agents.
Custom Agents
If you need a customized agent for your businesses, ELCO Industrie Automation GmbH provides libraries for an easy agent development. Please, contact the ELCO Industrial Automation at www.elco-holding.eu for more details.
Running an Agent
In order to work with your Agents, check out the following links.
Info
Installing and starting an Agent is a simple task! Please take a look at the guidelines at Install IoTHub Agents.
Agent States
The Agent state indicates the current status of an Agent. Additional information such as the origin or the beginning of the state is provided by the Reason.
The following table gives an overview of the possible Agent states that can occur and their meaning.
State | Description |
---|---|
Unassigned | The Agent has no controller assigned. |
Assigned | A controller is assigned to the Agent. |
Connected | The Agent is connected to the IoTHub Gateway and communicates with it. |
Disconnected | The Agent is disconnected from the IoTHub Gateway and the communication with it stopped. |
Installing | The Agent is being installed on the system hosting the controller. |
Downloading | The Agent's binary is being downloaded. |
Decompressing | The Agent's binary is being decompressed. |
Installed | The Agent was successfully installed. |
Starting | The Agent is being started. |
Started | The Agent was successfully started. |
Stopping | The Agent is being stopped. |
Stopped | The Agent was successfully stopped. |
Install Failed | The installation process failed e.g. because of a wrong URL or invalid credentials. |
Startup Failed | The Agent's process cannot be started e.g. because the Agent configuration is wrong or system permissions are missing. |
Process Exited | The Agent's process was terminated for unexpected reasons (e.g. connection to the IoTHub Gateway failed). |
Info
After applying changes the new Agent state gets displayed by clicking .
Agent Controller
An Agent controller acts as a layer between the IoTHub and an Agent. It allows for an even easier controlling of Agents.
To make use of an Agent controller, the controller first needs to be started. In the UI, click on the menu item button and then Add Controller.
Copy the token seen in the dialog, you will need it to start the agent.Info
How to setup a controller is explained in the Installing a controller section.
After properly starting the controller, it needs to be assigned to an Agent. After the controller has been assigned, the Agent can be installed via the controller. Manually downlading binaries for the Agent is not required since the controller takes over this task.
With the Agent installed, the controller can now be used to start and stop the Agent, as well as to reset it. Resetting an Agent restores its initial state with the controller still assigned. Restarting the Agent now requires installing it again. To detach the controller the Agent needs to be stopped. If the Agent is currently running this can be done by either stopping the Agent or resetting it.