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 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 Prototype.
  4. Instructions on how to connect a device as a Production Thing.

Overview

CloudPlugs enables connectivity for three types of devices:

  1. Prototypes Prototypes, which are used to quickly test things and to generate a TemplateProduction Template.
  2. Things Production Things, which are provisioned by their Production Templates.
  3. 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 Prototypes, 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.

To learn the platform, you can start by connecting a device as a Prototype and then as a Production Thing. Connecting a device as a Prototype is a simple process. Please note that Prototypes do not support Controllers. To test a full application including Controllers, you need to connect your device as a Production Thing.

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 Prototype and as a Production Thing are included in the respective sections of this guide.

1
2
3
4
5
Required Create Prototype Configure
Production Template
Connect Device/Thing Manage Update
  1. Create new prototype.
  2. Create Production Template from the Prototype's console.
  1. Open the new Production Template if not already open.
  2. Enter device serial number, enroll and control password.
  3. Save Template.
  4. Provision Things.
  1. Download SmartPlug™ or connectivity library.
  2. Set enroll credentials.
  3. Code application.
  4. Start device and connect to internet.
  1. Verify device enrollment and connection under Things.
  2. View device's data under Published Data.
Optional
  1. Publish Data.
  2. Program Triggers.
  3. Set Properties.
  4. Program SmartPlug Apps.
  5. Provision Apps
  6. Connect Device as Prototype with SmartPlug™ or library.
  1. Program Triggers.
  2. Set Properties.
  3. Provision Apps.
  1. Write more apps and build a SmartPlug Apps Store.
  2. Write a Controller App with Control Designer.
  1. Provision & deploy SmartPlug Apps.
  2. Program Triggers.
  3. Set Properties.
  1. Provision & deploy new or updated firmware or SmartPlug Apps.
  2. Program Triggers.
  3. Set Properties.

Back to Top

Connecting a device as a Prototype

  1. Create a Prototype using the Prototypes tile in the CloudPlugs platform web desktop.
  2. Download a connectivity library or a SmartPlug™ to connect your physical device.
  3. Enter the Prototype’s connectivity credentials AUTH_PLUGID and AUTH_PASS in the selected library or in the smartplug.conf file, or use one of the examples provided.
  4. Write the code or use one of the examples or tutorials available to publish data in your required channels.
  5. Start your device.
  6. Watch the data published in the channels either though the Prototype -> Publish data panel or the Published Data window accessible through the Published data tile in the CloudPlugs platform web desktop.

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 they 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.

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 Prototype. All you need is to have a Prototype, no other work on the Prototype is required.
  2. Create a Production Template by clicking on the Prototype’s Create Template button ().
  3. In the Production Template, open the serial number panel (Serial Number).
  4. Add a new serial number, Enroll password and an optional Control password (required to grant access to control applications) for your device.
  5. Return to the General->Profile panel (Device Profile), and Save (Save) or Save and Close (Save & Close) the Production Template.
  6. Provision your serial number(s) with the (Provision) button.
  7. Take note of the Production Template’s Plug-ID since it also needs to be input as part of the connection credentials.
  8. 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 library that best suites your needs.
  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 channels.
  3. Start your device.
  4. To watch the data published in the channels you can:
    1. Open the Things tile in the web desktop, select the serial number of your thing, open the Thing and then Open the Publish Data panel, or
    2. Open the Published Data tile in the web desktop and select the channel in which data is being published by the device.

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. 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…
  4. To associate the application to the device running the SmartPlug™:
    1. Open the Production Template.
    2. Add the application using the SmartPlug Apps panel.
    3. Save the Production Template.
  5. 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.
  6. As soon as the SmartPlug™ is online, it should start publishing data or executing the actons programmed in your application.
  7. To watch the data published in the channels you can:
    1. Open the Things tile in the web desktop, select the serial number of your thing, open the Thing and then Open the Publish Data panel, or
    2. Open the Published Data tile in the web desktop and select the channel in which data is being published by the device.

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 15th Feb 2019