Unit 1: Registering PC on EnOS¶
Before connecting the PC to EnOS, you need to register it on EnOS Application Portal, which includes defining the computer model, creating a computer product, and registering the PC as a device that can be connected directly to EnOS Cloud.
Step 1: Defining a Computer Model¶
A model is the abstraction of the features of an object that is connected to the Device Connectivity & Management. For more information about models, see Basic Modeling: Designing and Creating Models.
This step assumes that there is no existing computer model that can be reused in EnOS. Refer to Creating a Model from Scratch to create a new model from scratch and fill in the following information for the model:
Group: Custom (custom)
Name: Computer
Business ID: Computer
Model Usage: Device Connection
Description: PC Model
On the model details page, refer to Creating Model Elements to create the following attributes and measurement points:
Attributes
Category
Name
ID
Data Type
Max Length
Description
Is Required
Is Writable
Attribute
system
system
string
64
System information of the computer
Yes
Yes
Attribute
model
model
string
128
Model information of the computer
Yes
Yes
Attribute
cpu_core
cpu_core
int
–
Number of CPU cores in the computer
Yes
Yes
Attribute
mem_total
mem_total
double
–
Total memory of the computer
Yes
Yes
Measurement Points
Category
Name
ID
Point Type
Data Type
Description
Quality Indicator
Is Writable
Measurement Points
cpu_used
cpu_used
AI
double
The measurement point for getting the used CPU data
No
Yes
Measurement Points
mem_used
mem_used
AI
double
The measurement point for getting the used memory data
No
Yes
Measurement Points
cpu_percent
cpu_percent
AI
double
The measurement point for getting the data of the usage percentage of the CPU
No
Yes
Measurement Points
mem_percent
mem_percent
AI
double
The measurement point for getting data of the memory usage percentage
No
Yes
Command
Category: command
Name: control
ID: control
Input Parameter:
Name: interval
ID: interval
Data Type: object. And define the following parameters for the data type:
Parameter Name: interval
Parameter ID: interval
Data Type: integer
Output Parameter:
Name: result
ID: result
Data Type: object. And define the following parameters for the data type:
Parameter Name: result
Parameter ID: result
Data Type: enum
Enumeration Value Type: string
Enumeration Value: 0: success, 1: failure
Description: Service to control the frequency of PC data upload
Once completed, you can use the model to create products and register devices.
Step 2: Creating a PC Product¶
A product is a collection of devices with the same features. With the model as a base, a product further defines the communication specifications for the device.
In this step, create a product called Computer. It is assumed that a device of this product model sends data in standard format and that the data transmission is not encrypted using the CA certificate.
In EnOS Application Portal > Developer Console, select Device Management > Products.
Click the New Product button, and enter the following in the New Product window.
Product Name: Computer
Asset Type: Device
Model: Computer
Onboarding Method: Only EnOS IoT
Certificate-Based Authentication: Disabled
Description: Personal Computer
Click OK to save the configuration.
For details about the configuration of a product, see Creating a Product.
Step 3: Registering the PC as a Device¶
A device is the instance of a product. It is created from a product so that it inherits not only the basic features of the model, but also the communication features of the product (the device key-secret pair and device certificate used for secure communication).
In this step, create a device named PC_Win10, which belongs to the Computer product created in the previous step.
In EnOS Application Portal > Developer Console, select Device Management > Device Assets.
Click the New Device button, and enter the following in the New Device window.
Basic Information:
Product: Computer
Device Name: PC_Win10
Device Key: Optional (it can be generated automatically by the system)
Timezone/City: UTC+08:00
Attributes:
system: Enter the system information of the computer (for example, Win10)
model: Enter the model information of the computer (for example, E480)
cpu_core: Enter the number of CPU cores of the computer (for example, 4)
mem_total: Enter the total memory of the computer (for example, 8000000000)
Note
Enter estimated attribute values for now. The real attributes will be ingested and updated after the PC device is connected to EnOS.
Click OK to save the configuration.
For details about device settings, see Registering a Device.
After completing the registration of the PC, find the registered device from the device list, and click to open the Device Details page. You can get the device triple values (Product Key, Device Key, and Device Secret) from there, which will be used to connect the PC to EnOS.
For details about devices, see Registering a Device.