Introduction
As the IoT advances, various companies are building systems that use the edge and the cloud. We have received many requests from our customers for easy communication between the edge and the cloud.
In this article, we would like to introduce how to transfer data between edge clouds using Microsoft's cloud environment, Azure, and how to edit templates and transfer your data to the cloud.
Azure Certified Device
The Azure Certified Device program shows you how to build solutions through a program that certifies IoT devices to run on Azure. They have already provided documentation on how to check connectivity with Azure, making it easy and time-saving to build your solution.
If you are looking for such edge devices, ADLINK and IEI also have certified devices that you can choose from to quickly build a system that connects to the cloud.
Point: IEI devices https://devicecatalog.azure.com/devices?searchTerm=IEI
Using IEI's FLEX-BX200 catalog
Now, let's take a look at the actual operation of IEI's FLEX-BX200 using the catalogs that are available. This time, we will use IEI's FLEX-BX200 to build the environment.
Point : IEI FLEX-BX200 : https://www.macnica.co.jp/business/semiconductor/manufacturers/iei_integration/products/134169/
The Azure Certified Device Catalog page for the above FLEX-BX200 is here.
Point : Azure Certified Device : IEI FLEX-BX200
https://devicecatalog.azure.com/devices/69919c86-ed84-4bc0-b248-615e32c963ce
Basically, you can follow the above page " Get started guide " as it is. However, there are some points that need to be corrected when viewing data in the cloud.
Note: The following main.exe file can be downloaded from Git Hub:
Leave windows_device_info_component_name blank in L.24 of the main.py file downloaded from Git Hub.
(default)
↓↓
(After modification)
When executed, it will look like the following.
You can see that Property is updated at the first communication and Telemetry is updated (default 2 seconds) among the items supported by Windows listed on Github.
Point : Github About Azure PnP in this project
https://devicecatalog.azure.com/devices/69919c86-ed84-4bc0-b248-615e32c963ce
Adding data items to be transferred
We have used the device catalog to transfer various data. Now what if you want to send your own data in the same way? This can also be easily done by editing the device catalog described above. There are only two major items to edit, and they can be added very easily.
- Modify the source code of the edge device and transfer your data
Add the data you want to transfer to the prepared main.py - Edit the device template so that it can be displayed on Azure IoT Central side.
Register the data to be transferred in the items of the prepared device template so that it can be displayed.
Let's take a look at each of them.
1. modify the source code of the edge device to transfer your own data
If you want to add data, you can edit main.py depending on whether you want to include it in Property (only for the first transfer) or Telemetry (for periodic transfers).
- L.45 - 174 : Property section
- L.176 - 213 : Telemetry items
In this example, we will consider adding a Telemetry entry.
There are two necessary edits.
(1) Acquire the data to be forwarded: There is a default data acquisition item in L.179 - L.184, so enter the data to be added here.
(2) Add the data to be transferred to JSON. L.193 - L.198 contain the fields that are added to JSON for transfer, so register them there as additional items to JSON.
This is all for the application on the device side. Now the information (JSON) transferred to the cloud will include the added items. However, since the items to be displayed on the cloud side have not been added with just this, it is necessary to edit the added items so that they can be displayed on the cloud side. In the next section, add the data items to be transferred to the display items on the cloud side.
(Tip: The update interval can be changed in period in L.28 of main.py)
Edit the device template so that it can be displayed on the Azure IoT Central side.
Edit the device template to display the items transferred from the application side on the cloud side. Add a name to be displayed in the cloud, the name to be acquired, and the name to be displayed in the cloud.
You only need to enter three main items: the name to be displayed in the cloud, the data item to be retrieved (the name of the JSON item added in step 1), and the type of function (Property, Telemetry).
Conclusion
As described above, we were able to easily transfer between edge clouds and add data transfer items using Azure Certified Device. This article only describes the data transfer to Azure, but I think it can be applied to actual business use cases such as analyzing the transferred data using the Azure platform.
We can also introduce Azure Certified Device, so please contact us for more information.
For more information, please contact us.
Macnica Ultima Company, Inc.
Product Marketing Department e-Mail: alt-pm@macnica.co.jp