Getting Started

This guide provides a quick summary of the steps to get your first device connected. It contains:

  1. A quick overview of the main components required to connect and to create a digital twin of a product.
  2. A list of the steps required to connect a product along with some optional steps during the process.
  3. Instructions on how to connect a device as a Production Thing.

Overview

CloudPlugs enables connectivity of two types of devices:

  1. Things Production Things, which are provisioned by their Production Templates.
  2. Controllers Controllers, which are applications to control Production Things.

We recommend that you become familiar with the basic concepts of the platform and with all the guides related to Production Templates and Production Things to accelerate your learning curve. They contain detailed explanations of the connectivity and device, data and application lifecycle management process. Details of the platform’s architecture can be found in the Architecture Guide.

Steps to Connect a Device

Here are the general steps to connect and manage your first device. Additional instructions on connecting a device as a Production Thing are included in the respective section of this guide.

1
2
3
4
Required Create and Configure a
Production Template
Connect Device/Thing Manage Update
  1. Create a Production Template
  2. Enter your device's serial number, enroll and control passwords.
  3. Save Template.
  4. Provision Things.
  1. Download the SmartPlug™ agent or a connectivity library.
  2. Configure enroll credentials.
  3. If using a library, code your device application.
  4. Start device and connect to internet.
  5. Download and configure Edge One™, or code and deploy a SmartPlug™ application.
  1. Verify device enrollment and connection under Things.
  2. View the device's data in the Thing's console Data tab.
Optional
  1. Publish Data.
  2. Program Triggers.
  3. Set Properties.
  4. Program SmartPlug Apps.
  5. Provision Apps.
  6. Upload application containers.
  7. Provision Containers
  1. Write more apps and build a SmartPlug Apps Store.
  2. Write a Controller App with Control Designer.
  1. Provision & deploy Edge One™ containers
  2. Provision & deploy SmartPlug Apps.
  3. Program Triggers.
  4. Set Properties.
  1. Provision & deploy Edge One™ containers
  2. Provision & deploy new or updated firmware or SmartPlug Apps.
  3. Program Triggers.
  4. Set Properties.

Back to Top

Connecting a device as a Production Thing

Every device connects to the CloudPlugs IoT platform using a Plug-ID (AUTH_PLUGID) and a connectivity/activation password (AUTH_PASS).

A Production Thing needs to enroll successfully to CloudPlugs in order for the platform to issue its Plug-ID and connectivity/activation password.

These connection credentials need to be retrieved programmatically or manually as explained in the Credentials guide.

When connecting many devices to CloudPlugs IoT, it is recommended that the connection credentials are retrieved programmatically as soon as the enroll process has been completed. There are two connectivity options that allow programmatic retrieval of the connection credentials:

  1. Using a Connectivity Library. Code must be written to retrieve the credentials, and the respective section below points to examples of how to write the code.
  2. Using a SmartPlug™. The SmartPlug™ retrieves the credentials as soon as it enrolls into the platform and automatically connects to the platform without the need of writing any code.

If you plan to use Edge One™, you must first install and configure a SmartPlug™ agent, which is used to orchestrate the deployment and management of Edge One™ containers.

In summary, to connect a device as a Production Thing you must:

  1. Create its enrollment credentials
  2. Connect the device using a connectivity library, or a SmartPlug™.

The sections below describe how to perform each process.

Creating the Enrollment Credentials

A device needs the following credentials to enroll in the CloudPlugs IoT platform:

  1. It’s Production Template Plug-ID which starts with the word mod-xxxxxxxxxx.
  2. An serial number or hardware ID (HWID).
  3. An enroll password.

To create the Production Thing’s enroll credentials, follow these steps:

  1. Create a Production Template by opening the Production Templates console () and clicking on the New Template button ().
  2. In the Production Template, open the serial number panel (Serial Number).
  3. Add a new Serial Number (also called Hardware ID, HWID), Enroll password and an optional Control password for your device. The Control password is required if you want to grant access to control applications such as dashboards to your device.
  4. Return to the General->Profile panel (Device Profile), and Save (Save) or Save and Close (Save & Close) the Production Template.
  5. Provision your serial number(s) with the (Provision) button.
  6. Take note of the Production Template’s Plug-ID since it also needs to be input as part of the enrollment credentials.
  7. Connect the device either with a connectivity library, or with a SmartPlug™ as described in the subsections below.

Back to Top

Connecting a Production Thing with a Connectivity library

  1. Download the MQTT or REST library required to connect your device.
  2. Retrieve the device’s Plug-ID (AUTH_PLUGID) and connection/activation password (AUTH_PASS) either using the REST API or by using ‘curl’ from the command line as follows:

$ curl -H "Content-Type: application/json" -X POST -d '{"model":"mod-xxxxxxxxxxxxxxxx", "hwid”:"serial-number","pass":"enroll-password"}’ 
	

You simply replace the "mod-xxx" by the Production Template Plug-ID, "serial-number" by the serial number used, and "enroll-password" by the password used for the serial number. The command will print the Plug-ID and AUTH_PASS for your device.

  1. Enter the connectivity credentials in the library, or use one of the examples provided.
  2. Write the code or use one of the examples or tutorials available to publish data in your required message topics, also referred to as channels.
  3. Start your device.
  4. To watch the data published in the channels you can:
    1. Open the Things tile (Data) in the web desktop.
    2. Select the serial number of your thing.
    3. Open the Thing, and then
    4. Open the Data (Data) panel.

Back to Top

Connecting a Production Thing with a SmartPlug™

  1. Download the SmartPlug™.
  2. Enter the credentials required under Thing enrollment in the smartplug.conf file.
  3. Either:

a) Write the application that the SmartPlug™ will use to collect data from other devices, sensors or applications, and to publish data or execute actions on the platform, or

b) Install and configure Edge One™ and its desired modules.

  1. To associate the application or Edge One™ containers to the device running the SmartPlug™:
    1. Open the Production Template.
    2. Open the SmartPlug™ panel (SmartPlug)
    3. To Add a SmartPlug™ application:
      1. Open the SmartPlug App tab (SmartPlug Apps).
      2. Drag and drop the desired application from the App Store panel to the Associated apps panel.
    4. To Add Edge One™ and its modules:
      1. Open the Containers tab (Containers).
      2. Drag and drop the required and desired containers from the Store panel to the Associated containers panel.
    5. Save the Production Template.
  2. Run the SmartPlug™ or restart your device.
    1. The SmartPlug™ will automatically enroll into the platform.
    2. Your device will be visible under the Things Management Console accessible through the web desktop.
  3. As soon as the SmartPlug™ is online, it should start publishing data, executing the actions programmed in your application, or downloading the Edge One™ containers.
  4. To watch the data published in the channels you can:
    1. Open the Things tile (Data) in the web desktop.
    2. Select the serial number of your thing.
    3. Open the Thing, and then
    4. Open the Data (Data) panel.

Back to Top

Build a Control Application

Now that the Production Thing is connected, you can write a Controller application for your device using your tools and the CloudPlugs REST API’s, or using the CloudPlugs Control Designer.

Back to Top

Still need help? Get in touch!
Last updated on 6th May 2021