Smart Device Control¶
This page introduces the method of accessing the edge computing platform based on a custom protocol from end devices and interacting with the cloud. Using a scenario of controlling a light switch with gestures as an example, the overall implementation process is explained.
Preparation¶
- Edge node, for node access requirements, refer to Edge Node Access Requirements
- LED light with a control unit
- LED light driver mapper, for mapper development, refer to How to Develop Device Driver Application Mapper
Create End Devices¶
-
Deploy the LED light driver mapper to the edge node, the deployment process can be found in Creating Workloads
-
Go to the edge unit details page, select the left menu Edge Resources -> End Devices , and click the Create Device button on the top right of the end device list.
-
Fill in the basic information.
Note
The access protocol must be consistent with the protocol name defined in the mapper.
-
Fill in the device configuration, add device twin properties and tags.
- The property value is the expected value of the device.
- The access method must be consistent with the key-value data defined in the mapper.
-
Fill in the device access configuration.
The access parameters for the platform to connect to the device. In this scenario, the device access path is /dev/ttyACM0, with a baud rate of 9600.
-
Information confirmation, verify that the configured information is correct, click OK to complete the device creation.
Verify Effect¶
-
In the device list, click the device name to enter the device details page and view the reported status values of the device.
-
Edit the device twin properties, modify the expected value of the device, and see the change in the LED light status.