Configuring Device Simulators¶
You can use the device simulator function for the following purposes.
Getting started with EnOS: You can leverage this function to simulate a device to receive data to understand how to use the capabilities of EnOS.
Testing and debugging: In application development, sometimes you need to simulate a device to send a specific value to verify a device function. Real devices rarely sends that specific value. In this case you can use the device simulator to facilitate application development.
This section shows how to create and start device simulators.
Prerequisites¶
Ensure that you have registered the device to be simulated. For information, see Registering Devices.
Ensure that you have obtained the Developer role to have the access to Application Portal > Developer Console. If not, contact your OU administrator.
Ensure that you have read the limitations for device simulators. See Limitations.
Step 1: Adding a Device Simulator¶
Go to Application Portal > Developer Console, and select Device Management > Simulators.
Click New Simulator, and select the device to be simulated in this page.
The device list shows all the devices that have been created in the current OU. For simulation purpose, users can only select an Inactive device. It is impossible to simulate any Online or Offline device.
Click OK to create a simulator for the selected device.
In the list of simulators, you can see the simulator you have just created. Next, you need to define the simulation data sample for it.
Step 2: Adding Data Samples¶
If the number of devices is small, you can add samples one by one. If a large number of similar devices (i.e., devices belonging to the same product) have been imported, you can batch add simulator data samples.
Adding Data Samples One By One¶
Find the simulator you created in the list of simulators and click Define Sample
button.
Click Download in the pop-up window.
Input the simulation data sample in the downloaded template.
The first column timeOfDay is the time from 0:00:00 to 23:59:59 in minutes.
Starting from the second column header, these are the model measurement point IDs. For the measurement point columns requiring simulated data, simply fill in the values corresponding to each timestamp; it’s not necessary to list data for all measurement points. If it’s an array type, use the format [value1, value2, value3]. If a specific point has no value at the current timestamp, leave it blank.
In the pop-up window, click Upload to upload the simulation data.
Click OK.
Adding Data Samples in Batch¶
In the Device Management > Simulators, click Batch Define Sample .
Select the product whose devices needs the data sample.
Click Download to download the data sample template.
Edit sample.xlsx that you downloaded and save your change.
You can add some abnormal values to the sample to trigger an alert.
Click Upload, select the sample to be uploaded and click Next.
Select the devices that needs simulating and click OK.
The existing sample for the selected device will be overwritten.
Step 3: Starting Device Simulators¶
You can start device simulators one by one. If the number of simulators to be started is large, you can also batch start multiple simulators.
Starting Simulators One By One¶
Locate the target simulator from the device simulator list, select Start
button.
In the pop-up window, set the simulation end time.
The simulation start time defaults to the system time when you click Start, and the simulator’s end time cannot exceed 90 days from the current system time.
Starting Simulators in Batch¶
Select the simulators to be started from the list.
You can select only those with data samples.
Click More > Batch Start .
Set an end time for all selected simulators.
The end time of simulation should be within 90 days after the current system time.
If the selected simulators include simulators that have already started, their end time will be overwritten.
Results¶
The device simulator starts to simulate and send data. Users can suspend the device simulator, download the data sample, or edit the data sample as needed.
Only after pausing the device simulator can users edit or download data samples.