What are Prototypes?

Prototype This guide contains the following content:

  1. Overview of what Prototypes are.
  2. Creating a Prototype.
  3. Connecting a Prototype.
  4. Provisioning SmartPlug Apps on a Prototype.
  5. Creating a Production Template from a Prototype.

Overview

Prototype Prototypes are virtual devices that allow you to model and test your Things before taking them to production. You must create a Prototype for your target Production Thing and a Production Template to connect your Production Thing.

Prototypes allow you to set advanced properties for your devices such as metadata, access permissions, triggers and location, which are then inherited by Production Templates and then by your Production Things.

You can test the Prototype publishing fake data and creating sophisticated, custom data views before connecting a device, because, once created, they exist as a virtual device.

A Prototype is considered a device in CloudPlugs IoT much like a Production Thing or a Controller. As such, a Prototype that is always connected and is publishing data will count against your connected device allowance and its traffic and storage also count against your licensed traffic and storage.

Prototypes are an easy way to connect and test a product; however, they do not support controller applications. They cannot be controlled by a web or mobile control application. Control applications can only be associated with a Production Thing.

Opening the Prototypes web desktop tile ( Prototype ) displays the Prototypes Management Console, which allows you to:

  1. Create () a new Prototype.
  2. Open and edit () an existing Prototype.
  3. Delete () an existing Prototype.
  4. Clone () your Prototypes.
  5. Create a Production Template (Create Template) button. Production Templates are the tool that creates and provisions Production Things into the platform.
  6. Open a Remote Terminal (), which provides a full Linux terminal to access SmartPlug™ based Prototypes from anywhere.
  7. Open a JavaScript Shell (), which allows remote monitoring of JavaScript application execution on SmartPlug™ based Prototypes, and
  8. Open a Remote File Manager (), which allows remote file operations such as upload, download, create, delete or rename files on SmartPlug™ based Prototypes.

The image below displays a Prototype Management console with a few Prototype devices.

Prototype Management Console

You can filter or add columns to the Prototype Management Console by clicking on the column section and filter dropdown on the right hand side of each column as shown below.

Prototype Management Console

The physical device of the Prototype may use a SmartPlug™ agent or a REST, WebSockets or MQTT library to connect to the platform. The use of a SmartPlug™ enables the SmartPlug™ App store which allows you to select SmartPlug™ applications that you have created and provision them on your Prototype.

The next section describes how to create a Prototype.

Back to Top

Creating a Prototype

Prototypes can be created by opening the Prototypes tile ( Prototype ) of the CloudPlugs IoT web desktop, or by using the connection libraries or the REST API.  This document focuses on the use of the web desktop interface. To create a Prototype using the libraries or REST API please refer to the Creating a Prototype with the REST API document.

To create a Prototype using the web desktop:

  1. Open the Prototypes Management Console by clicking on the Prototypes tile () on the platform’s web desktop.
  2. Click on New ( New ).
Create Prototype
  1. Give your Prototype a name and optionally add any notes to its metadata. In the example below, we call our Prototype Test1.
  2. Optionally, add any notes.
Create Prototype
  1. Save and Close ( Save and Close )
  2. The Prototype Properties Console will open and you are ready to use it.

Once a Prototype is created, you can open it by:

  1. Selecting the Prototype on the Prototypes Management Console, and
  2. Clicking on the Open ( Open ), or
  3. Double-Clicking on the Prototype.

The Prototypes Device Profile is displayed as shown below.

Additional properties

There are several things you can do with the virtual Prototype before connecting your physical device.

  1. Set the device General ( General ) -> Device Profile properties (Profile).
  2. Set location ( Location ) information.
  3. Create triggers (Triggers) and alarms that you can test using the Data publish function. Triggers can be created on channels, even if they do not exist yet
  4. View traffic and storage use statistics (Statistics).
  5. Publish test data ( Pub Data ). Publishing test data will automatically create the channels in which the data is published.
  6. Associate SmartPlug Apps ( SmartPlug Apps ) with the Prototype using the SmartPlug Apps store. Note that this assumes that you have already developed and saved SmartPlug™ applications in the SmartPlug Apps IDE ( SmartPlug Apps ).

When you are done working with the Prototype you can:

  1. Connect a device to the Prototype, or
  2. Create a Production Template to connect your device as a Production Thing.

Back to Top

Connecting a Prototype Device

Connecting a physical device to your Prototype is easy given that the enrollment process is simplified. If you do not plan to use control applications, you can consider connecting your device as a Prototype. However, if you want to develop and test control applications on your device, you should create a Production Thing by first creating a Production Template.

Before connecting a device as a Prototype to the platform, you must decide whether to:

  1. Connect the Prototype device using a SmartPlug™, or
  2. Connect the Prototype device using a Connectivity Library.

In order to connect to the CloudPlugs platform, new Prototype devices must enroll to the CloudPlugs platform using their Plug-ID and a password. The Prototype’s default enroll password is the user’s CloudPlugs account password. The enroll password can be changed under Permissions in the [Device Profile](./General/Device Profile) panel.

Back to Top

SmartPlug™ Connection

To connect the physical device as a Prototype with a SmartPlug™:

  1. Download the SmartPlug™ version for your hardware type and operating system.
  2. Edit the smartplug.conf file and do as follows:
  3. Uncomment the prototype_id and prototype_pass lines. prototype_id = dev-XXXXXXXXX prototype_pass = PASSWORD
  4. Replace dev-XXXXXXXX with the Prototype Plug-ID which can be obtained from the General->Device Profile panel.
  5. Replace PASSWORD

When a Prototype is connected with a SmartPlug™ and the SmartPlug™ tab -> Overview is selected, the SmartPlug™ remote management tools: Terminal, JS Shell and File Manager and system overview become visible.

Make Template

Back to Top

Library Connection

You can also connect the physical device as a Prototype using either a REST or MQTT library as explained in the sections below.

You can also consult our tutorials that provide examples with step by step instructions.

Back to Top

REST Connection

A list of the CloudPlugs REST libraries is found here. Select and download the most appropriate library for your device.

The libraries include examples that you can easily edit to connect and test your Things.  We recommend that you read our tutorials which provide detailed steps on how to connect sample things.  You can open an example of the libraries and do the following:

  1. Set the variable AUTH_PLUGID to the Plug-ID of the prototype being created.
  2. Set the variable AUTH_PASS which authenticates the Prototype for access to the platform to either your login password (which is the default) or to the password set under Permissions in the General->Device Profile window.  If you set a new password under Permissions, you must also change the AUTH_MASTER flag to false.
  3. You can write the appropriate functions to capture your data.
  4. Publish the data using the library’s functions and methods described in the REST Api of the Developer’s Guide.
  5. If the connection was successful, the data published will appear in the Published data window.

Back to Top

MQTT Connection

If your device is low powered, you may want to use the MQTT protocol. The Eclipse Paho project has MQTT client libraries compatible with CloudPlugs in multiple languages. The various clients can be found in the links below:

Java C++ Embedded C/C++
Android JavaScript Pyhton
Go C# .Net, Win RT

The libraries include examples that you can easily edit to connect and test your Things.  We recommend that you read our tutorials which provide detailed steps on how to connect sample things.  You can open an example of the libraries and do the following:

  1. Set the variable AUTH_PLUGID to the Plug-ID of the prototype being created.
  2. Set the variable AUTH_PASS which authenticates the Prototype for access to the platform to either your login password (which is the default) or to the password set under Permissions in the Prototype window.  If you set a new password under Permissions, you must also change the AUTH_MASTER flag to “false&rdquo.
  3. You can write the appropriate functions to capture your data.
  4. Publish the data using the library’s functions and methods.
  5. If the connection was successful, the data published will appear in the Published data window.

Back to Top

Tutorials

The following tutorials have examples on connecting devices as Prototypes using the Connectivity Libraries:

Back to Top

Provisioning SmartPlug Apps

To learn how to provision SmartPlug Apps on a Prototype, please refer to the Provision SmartPlug Apps Guide

Back to Top

Create a Production Template

Once you are satisfied with your prototype, you are ready to create a Production Template to provision and connect your production Things. You can create a Template directly from the Prototype Management Console window by:

  1. Selecting a Prototype.
  2. Clicking on the Make Template ( Create Template ) button in the Prototypes Management Console, or by opening the Prototype and clicking on the Make Template button on Prototype Properties Console as shown below.
Make Template Additional properties

Back to Top

Still need help? Get in touch!
Last updated on 15th Feb 2019