Unit 1: Registering the PC on the EnOS™ Management Console¶
Before connecting the PC to EnOS IoT Hub, you need to register it on the EnOS Management Console, which includes defining the computer model, creating a computer product, and registering the PC as a device that can be connected directly to the EnOS Cloud。
Step 1: Defining a Computer Model¶
A model is the abstraction of the features of an object that is connected to the IoT Hub. The model defines the features of a device, including its attributes, measurement points, services, and events. For more information about models, see Device Modeling.
This step assumes that there is no existing computer model that can be reused in EnOS. To create a model named Computer and define its features, follow the steps below.
- Log in to the EnOS Management Console, and click Models from the left navigation menu. 
- Click the New Model button, and enter the following in the pop-up window. - Identifier: Computer 
- Model Name: Computer 
- Category: None 
- Created From: No 
- Source Model: No 
- Description: Model for computer 
 
- Click OK to save the model.   
- From the list of created models, click the Edit icon  of the computer model that you have just created, and click the Feature Definition tab on the Model Details page. of the computer model that you have just created, and click the Feature Definition tab on the Model Details page.
- Click Edit > Add > Create Custom Feature and add the following features in the Add Feature window. - Attributes¶ - Feature Type - Name - Identifier - Data Type - String Length - Description - Attribute - system - system - string - 64 - System information of the computer - Attribute - model - model - string - 128 - Model information of the computer - Attribute - cpu_core - cpu_core - int - – - Number of CPU cores in the computer - Attribute - mem_total - mem_total - double - – - Total memory of the computer - Measurement Points¶ - Feature Type - Name - Identifier - Point Type - Data Type - Description - Measurement Points - cpu_used - cpu_used - AI - double - The measurement point for getting the used CPU data - Measurement Points - mem_used - mem_used - AI - double - The measurement point for getting the used memory data - Measurement Points - cpu_percent - cpu_percent - AI - double - The measurement point for getting the data of the usage percentage of the CPU - Measurement Points - mem_percent - mem_percent - AI - double - The measurement point for getting data of the memory usage percentage - Service¶ - Feature Type - Name - Identifier - Input Parameters - Output Parameters - Description - Service - control - control - interval (int) - result (enum; 0:success, 1:failure) - The service that controls the data upload frequency of the computer - Event¶ - Feature Type - Name - Identifier - Severity - Output Parameters - Description - Event - cpu_event - cpu_event - Warning - value (double); message (string) - The event for monitoring the CPU load 
- Click the Publish button to save the features you have added above.   
For details about device model settings, see Creating a Model.
Step 2: Creating a Computer 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 JSON format and that the data transmission is not encrypted using the CA certificate.
- In the EnOS Management 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 Device Collection (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 the EnOS Management Console, select Device Management > Device Assets. 
- Click the New Device button, and enter the following in the New Device window. - Product: Computer 
- Device Name: PC_Win10 
- Device Key: Optional (it can be generated automatically by the system) 
- Timezone/City: UTC+08:00 
- Use DST: No 
- 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  in the Operations column 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 IoT Hub.
 in the Operations column 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 IoT Hub.
