Provisioning 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 ().
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:
- Using the Thing’s Properties Console.
- Provisioning the apps in the Thing’s Production Template and then saving and provisioning the Template.
Provisioning through a Thing’s Properties Console
To provision a SmartPlug™ application on a Production Things through its Properties Console:
- Open the Things Management Console using the Things tile ( )in the web desktop.
- Select and Open an exiting Thing.
- Open the Thing’s SmartPlug Apps panel through the ( ) tab.
- Select the desired application(s) from the App Store panel.
- Drag and drop the application(s) into the Associated Apps panel.
- Save () or Save and Close () the Thing. Saving the new application configuration will provision the applications on the Thing’s SmartPlug™ as follows:
- 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.
- 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.
Provisioning through a Thing’s Production Template
SmartPlug™ applications can be provisioned through the Production Templates either:
- Before Things are enrolled, which means that once Things are enrolled they will inherit their Production Template applications.
- After one or more Things are enrolled.
To provision applications using the Production Template:
- Open the Production Templates Management Console using the Template tile ( )in the web desktop.
- Select and Open an exiting Template.
- Open the Template’s SmartPlug Apps panel through the ( ) tab.
- Select the desired application(s) from the App Store panel.
- Drag and drop the application(s) into the Associated Apps panel.
- Save () or Save and Close () the Template.
- Provision () the Template. Saving and Provisioning the new application configuration will provision the applications on all the Production Template Things SmartPlugs™ as follows:
- 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.
- 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:
- Applications provisioned through a Production Template cannot be deleted using the Thing’s SmartPlug Applications panel.
- 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:
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:
-
To create and deploy applications, use the SmartPlug Apps IDE.
-
To manage application execution and provisioning in individual devices, use the SmartPlug Apps tab () in the Properties Console of Production Things and Production Templates.
-
To perform application management functions across multiple devices, there are two options:
- 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.
- 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.