Noun explanation:

Service: One of the functional models of a device, a capability or method that can be externally invoked by the device, and input and output parameters can be set. A service can implement more complex business logic, such as performing a specific task, through an instruction than an attribute. – Excerpted from Aliyun Iot product documentation.

From 1991, when Professor Kevin Ash-ton of Massachusetts Institute of Technology first proposed the concept of the Internet of Things, various cloud platforms of the Internet of Things have blossomed. The outlook for the Internet of Things has always been optimistic, but in the context of such prosperity, the issue of hidden costs (implementation costs and maintenance costs) has become increasingly prominent. The implementation of Internet of Things projects has been far from the practice of the industrial control era, for two reasons: 1. Internet of Things projects require high speed of implementation; 2. Comprehensive cost sensitivity. How to achieve the project quality of industrial control under such high requirements, the key lies in how to reduce the implied cost. Alink object model service delivery, take you to experience how to remotely implement and maintain.

I. Cloud configuration

Log in to Aliyun iot platform to create product examples in device management options

4. View the corresponding products and create object model attributes. View product details, select function definition, and add custom properties and services

A. Add custom attributes and create a template, as shown in Figure 1-1

B. Add a user-defined service. There are two types of service types: parameter service and control service. Event creation includes service name identifiers and definition of input and output parameters. (According to the rules for defining the YFIOs service engine: 1. The identifier of the parameter service must be Server_Parameter_Device, and that of the control service must be Server_Control_Device. The call mode is asynchronous. 2. Each event has two input parameters and two output parameters: (Input parameters: command words and parameter information. The command is a string of 32 bytes. Parameter The value of the command is text (a string of 32 bytes). Parameter is a string of 1024 bytes. Output parameters: Execution status and status description. The execution state is int32 (an integer) and ranges from -100 to 100. The step length is 1. The status description is text (a character string) and the data length is 256 bytes. Figure 1-2 shows how to create a template

 

Figure 1-2

5. Under the newly created product, the DeviceName must be Test, and the device certificate (Productkey, DeviceName, and DeviceSecret) must be saved.

2. Equipment connection

Operating environment construction: Win7 system please download the relevant device driver, download address is:, please install VS2010/VS2015 and expand the package

Materials: YF3300 equipment package, configuration key (the manufacturer will give you a one-month experience version when purchasing the product) download YFIOsManager configuration management software. Download link:

www.yfiot.com/content/dow…

Device connection: a. Insert the configuration key into the computer, connect the attached GPRS antenna, and insert the attached Internet of Things card (you can also use your own Internet of Things card)

B. Connect the YF3300 to the PC through Type-c.

Equipment configuration:

Open the downloaded YFIOsManager software, select USB connection mode, connect YF3300 to create a device in the user device, click New, in the driver support, select the official DRIVER of YF3300 from YFSoft in other series. DeviceName: cloud DeviceName (Test)

3. Create a new property in the data configuration (Test:T)

4. Click Save to save the customized configuration project

5. Create a policy in the policy list and choose SYS > AliYun MQTT Client (compact version) as the policy file. Fill in the device triplet and product key in the corresponding place in the service configuration. The service address will be automatically changed, the scanning interval can be changed, and the change upload can be selected

6. Create a policy in the policy list and choose SYS > Ali Cloud Service Delivery (sample version) as the policy file.

After the deployment is complete, click the Deployment button to deploy the created drivers and policies. Restart the system. Wait 5 to 10 seconds for the communication indicator to be steady on, indicating that the device successfully communicates with the cloud. You can also monitor the cloud process in YFIOsManager and MQTT Connect OK appears!! , proving that the communication between the device and the cloud is successful

Iii. Service delivery demonstration

Open Ali Cloud platform, click Monitoring operation and maintenance, and enter online debugging. Select the product name and device name, select the real device to be debugged, select the service name to be debugged, enter the CORRESPONDING JSON string in the following text box, and select send command to deliver the service. Deliver the control service and parameter service

Note: 1. The sample policy supports two control service commands

A. Light on command

The value is a Json character string

{” command “:” Open “.

“Parameter” : “1”

}

B. Light off instruction

The value is a Json character string

{” command “:” Close “.

“Parameter” : “0”

}

Service delivery feedback:

The configuration client:

Device side: Judge whether the command is successfully delivered according to the status of the status indicator

Ali Cloud:

 

The sample version policy supports a parameter service command Temperature calibration instruction Json the content is

{” command “:” calibrate temperature “,

Parameter: “30”, // Enter any temperature value (between -100 and 100)

}

Service delivery feedback:

The configuration client:

You can also check whether the corresponding temperature data is calibration data in data monitoring

Ali Cloud:

If you want to experience alibaba Cloud IoT platform, you can click the following link:

Dev.iot.aliyun.com/sale?source…