Provisioning SmartPlug Apps

SmartPlug Apps SmartPlug Apps are provisioned into Production Thing devices running a SmartPlug™ IoT agent. Once provisioned, the device’s SmartPlug™ will execute the applications. The application execution can be monitored through the device’s JS Shell (JS Shell).

In order for a Production Thing device to run a SmartPlug™ application, the application must first be provisioned, or associated with the device.

SmartPlug™ applications are provisioned in Production Things either through the Thing Properties Console or through the Thing’s Production Template, or both.

The Properties consoles of Production Things and Production Templates allow to manage which applications will be executed by the devices. Applications can be added or removed on demand. When an application existing in the SmartPlug™ Apps store is added and the device or Production Template is saved, it is provisioned over the air.

IMPORTANT!

SmartApp scripts cannot be renamed once they are deployed.

The following sections explain the process for provisioning and managing SmartPlug Apps.

Provision SmartPlug Apps on Production Things

There are two ways to Provision SmartPlug Apps on Production Things:

  1. Using the Thing’s Properties Console.
  2. Provisioning the apps in the Thing’s Production Template and then saving and provisioning the Template.

Back to Top

Provisioning through a Thing’s Properties Console

To provision a SmartPlug™ application on a Production Things through its Properties Console:

  1. Open the Things Management Console using the Things tile ( Thing )in the web desktop.
  2. Select and Open an exiting Thing.
  3. Open the Thing’s SmartPlug Apps panel through the ( ) tab.
  4. Select the desired application(s) from the App Store panel.
  5. Drag and drop the application(s) into the Associated Apps panel.
  6. Save (Save) or Save and Close (Save and Close) the Thing. Saving the new application configuration will provision the applications on the Thing’s SmartPlug™ as follows:
  1. If the device’s SmartPlug™ was already connected, the Save action will initiate a Bundle Sync process and the SmartPlug™ worker process will be re-spawned to start running the application(s) provisioned.
  2. If the device’s SmartPlug™ was not connected, once the SmartPlug™ is connected, it will download the application(s) and will run them.

Important! Notice that the Apps inherited from the Production Template panel will contain any applications provisioned in the Thing's Production Template before the Thing enrolled into the platform. These apps cannot be removed from the Thing. They can only be removed from the Production Template which must be saved for the changes to take effect.

The result of the process is shown in the image below.

Provision Thing

Back to Top

Provisioning through a Thing’s Production Template

SmartPlug™ applications can be provisioned through the Production Templates either:

  1. Before Things are enrolled, which means that once Things are enrolled they will inherit their Production Template applications.
  2. After one or more Things are enrolled.

To provision applications using the Production Template:

  1. Open the Production Templates Management Console using the Template tile ( Template )in the web desktop.
  2. Select and Open an exiting Template.
  3. Open the Template’s SmartPlug Apps panel through the ( ) tab.
  4. Select the desired application(s) from the App Store panel.
  5. Drag and drop the application(s) into the Associated Apps panel.
  6. Save (Save) or Save and Close (Save and Close) the Template.
  7. Provision (Provision) the Template. Saving and Provisioning the new application configuration will provision the applications on all the Production Template Things SmartPlugs™ as follows:
  1. If the device was already enrolled and its SmartPlug™ was already connected, the Save action will initiate a Bundle Sync process and the SmartPlug™ worker process will be re-spawned to start running the application(s) provisioned.
  2. If one or more of Template’s Things were not enrolled or connected, once the devices enroll and their SmartPlugs™ connect, they will download the application(s) and will run them.

Please note that:

  1. Applications provisioned through a Production Template cannot be deleted using the Thing’s SmartPlug Applications panel.
  2. To delete applications provisioned by the Production Template, they must be deleted in the Production Template’s SmartPlug Apps panel.

The result of the Provisioning process through a Production Template is shown below:

Provision Template

Back to Top

Managing SmartPlug Apps

There are several way to manage SmartPlug Apps on your devices. At the core of the service is the SmartApps Store which is managed with the SmartPlug Apps IDE. All applications are created, deployed and removed from the store through the IDE Scripts panel.

Here the options for application management:

  1. To create and deploy applications, use the SmartPlug Apps IDE.

  2. To manage application execution and provisioning in individual devices, use the SmartPlug Apps tab () in the Properties Console of Production Things and Production Templates.

  3. To perform application management functions across multiple devices, there are two options:

  1. Use the Properties Console of Production Templates to manage the applications that are provisioned on all the Production Things that belong to the template. Adding or deleting provisioned applications will update the applications on all the devices belonging to the template.
  2. Use the Bulk Actions function on the Things Management Console to provision, delete and update applications on specific groups of devices is achieved through accessible through the Things Management Console.

Back to Top

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