Device Cloud Agent

The agent on the device supports an SDK to build IoT applications and provides a device manager application.

The Python and C agents include the following:
  • an SDK with APIs to support IoT applications

  • configuration tools

  • helper applications, including a device manager

  • sample applications

The agent provides APIs to do the following:

  • create properties to transmit numeric data from the client application to Device Cloud

  • create attributes to transmit string data from the client application to Device Cloud

  • create methods to provide a set of custom device management actions to execute on the device through cloud triggers, from the thing details page on the Management Portal, or from cloud applications

  • create alarms and events to send to Device Cloud

  • define custom attributes

  • send and receive files

The following diagram shows the device components and their relationship to components in Device Cloud:

Device Cloud Device Architecture 2.Next

Application Configuration

Each client application requires a configuration file to specify the information to connect to Device Cloud. The configuration file must specify the application token of the application created in Device Cloud and the Device Cloud endpoint, which is available on the Developer page of the Management Portal. If the application connects to Device Cloud through a proxy server, the configuration file must also specify proxy configuration information.

The agent provides a script to generate the configuration file. At initialization time, client applications specify the file name to use and optionally, the file location. If the application does not specify the file location, the agent searches for the file in a predetermined location.

For more information about generating the configuration file, see Device Cloud Device Programmer's Guide: Application Connection Configuration Files.

Thing Key

Each application on the device requires a unique thing key. When an application that uses the agent APIs starts (including the device manager), the agent generates a unique thing key based on an automatically generated alphanumeric string (the device identifier) and the application identifier (the application name) specified when the application calls the initialization API. The agent saves the device identifier in a file and stores the file in the configuration directory.

If applications on the device specify the same configuration file directory, all applications have the same device identifier, which you can use to search for applications on the same device on the Management Portal. For example, if you run the device manager and your own application on a device, you could have the following thing keys, where 85356677-f8c9-5489-9578-277904aff540 is the device identifier in the file:

  • 85356677-f8c9-5489-9578-277904aff540-device_manager_py
  • 85356677-f8c9-5489-9578-277904aff540-app_1

For more information about how the agent generates the thing key, see Device Cloud Device Programmer's Guide: Device Cloud Client Applications.