How to add custom functions for LoRa node devices on Alibaba Cloud IoT platform

The specific address is:
In the previous article, we introduced how to add LoRa node devices on the Alibaba Cloud IoT platform, and let the LoRa node devices successfully connect to the network on the Alibaba Cloud IoT platform.

However, the successful connection of LoRa node devices on the Alibaba Cloud IoT platform does not mean that the Alibaba Cloud IoT platform can directly process the data from the LoRa node device. It only means that the LoRa node device can send data to Alibaba Cloud. These data are The data transmitted in the form of encrypted binary data will be parsed into a decrypted binary array by Alibaba Cloud, but Alibaba Cloud does not know the specific meaning of these data.

Then, we need to set up a "translator" between the LoRa node device and the Alibaba Cloud IoT platform, so that Alibaba Cloud can understand the meaning of the data sent by the LoRa node device. By setting the product function definition and parsing script of the LoRa node device on the Alibaba Cloud IoT platform, the "translator" setting can be realized.

Product function definition and parsing script are two in one. If you do not define product attributes, there is no need to use parsing script. The parsing script is to convert the data received by Alibaba Cloud into the value of the product definition attribute. For example, the device sends sensor data or functions to Alibaba Cloud. The definition of this sensor data or function is the product function definition. For example, a temperature and humidity sensor must have at least temperature and humidity attributes. Therefore, a parsing script is needed to parse this binary array into a format recognized by Alibaba Cloud, so that Alibaba Cloud can convert the binary data into specific attributes of the device, such as temperature and humidity.

This article describes how to set product function definitions on the Alibaba Cloud IoT platform.


1. "Function definition" of the product on the Alibaba Cloud management platform

As shown in Figure 1, enter the device management-product page, click the "view" operation on the right side of the product column.

Alibaba Cloud, IoT platform, product creation
Figure 1 View the created products on the Alibaba Cloud IoT platform

2. Click the function definition on the product page-select the custom function below-add function


Alibaba Cloud, IoT platform, product function definition

Figure 2 Product function definition page of Alibaba Cloud IoT platform

On Figure 2, click "Edit Draft" and select "Quick Import":

Alibaba Cloud, IoT platform, import object model

Figure 3 A quick introduction of the object model on the Alibaba Cloud IoT platform

Taking the RAK5205 node device as an example, the object model of the LoRa node device that can be imported on the Alibaba Cloud Internet of Things platform is the RAK5205.json file, which can be obtained in the RAKwireless column on Github. The specific address is:


RAK5205 LPWAN Tracker Board
RAK5205 LPWAN Tracker Board
The RAK5205 LPWAN Tracker Board is built upon the RAK811.

https:// github.com/RAKWireless/ RUI_LoRa_node_payload_decoder/blob/master/ali/RAK5205.json

It should be noted that you need to modify the productKey in the RAK5205.json file to match the value of the ProductKey of the product you want to import before you can import the RAK5205.json file.

As shown in Figure 4, the ProductKey value of the product you want to import can be obtained by viewing the ProductKey of the product on the Alibaba Cloud IoT platform.

Alibaba Cloud, IoT platform, ProductKey
Alibaba Cloud, IoT platform, Product Key
 
Figure 4 Alibaba Cloud IoT platform where the Product Key of the product is viewed

After obtaining the Product Key, you need to modify the product Key in the RAK5205.json file as shown in Figure 5 to be consistent with the Product Key value of the product viewed on the Alibaba Cloud IoT platform.








RAK5205, modify productKey
Figure 5 Modify the productKey in the RAK5205.json file

3. Release updates


After importing the object model (such as the RAK5205.json file), the effect is shown in Figure 6.

Click "Release Update" on the interface shown in Figure 6, and the function definition of the product is complete.

Alibaba Cloud, Internet of Things platform, imported object model, effect diagram

Figure 6 Schematic diagram of the effect of the Alibaba Cloud IoT platform after importing the object model

Conclusion

This article introduces that when the standard functions of the Alibaba Cloud IoT platform cannot meet their needs, users can customize the functions of the product on the Alibaba Cloud IoT platform according to the actual data attributes of the LoRa node device. The purpose of the business customization function.

How to analyze the data will be introduced in the next article.

For more information, please visit the official website of Shenzhen Rakwireless Technology Co., Ltd. RAKwireless.com , or email info@rakwireless.com for consultation.

Original Post: https://zhuanlan.zhihu.com/p/136370235

Post a Comment

0 Comments