<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Yokogawa Technologies Solutions India</title>
    <description>The latest articles on DEV Community by Yokogawa Technologies Solutions India (@yokogawa-yts_india).</description>
    <link>https://dev.to/yokogawa-yts_india</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F3583%2F143867bd-919c-48e8-b523-e3606489e76c.jpg</url>
      <title>DEV Community: Yokogawa Technologies Solutions India</title>
      <link>https://dev.to/yokogawa-yts_india</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yokogawa-yts_india"/>
    <language>en</language>
    <item>
      <title>Data Visualization on the e-RT3 using Node-RED, InfluxDB Cloud, and Grafana</title>
      <dc:creator>Yokogawa-NetraGandhi</dc:creator>
      <pubDate>Mon, 23 Sep 2024 15:35:09 +0000</pubDate>
      <link>https://dev.to/yokogawa-yts_india/data-visualization-on-the-e-rt3-using-node-red-influxdb-cloud-and-grafana-30lj</link>
      <guid>https://dev.to/yokogawa-yts_india/data-visualization-on-the-e-rt3-using-node-red-influxdb-cloud-and-grafana-30lj</guid>
      <description>&lt;h2&gt;
  
  
  Table of Contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
Setup

&lt;ul&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;
Overview

&lt;ul&gt;
&lt;li&gt;Materials&lt;/li&gt;
&lt;li&gt;Software&lt;/li&gt;
&lt;li&gt;Manuals&lt;/li&gt;
&lt;li&gt;Wiring&lt;/li&gt;
&lt;li&gt;Network Addresses&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;

Procedure

&lt;ul&gt;
&lt;li&gt;SD Card Setup&lt;/li&gt;
&lt;li&gt;Setting up the Cloud&lt;/li&gt;
&lt;li&gt;Configuring the Network&lt;/li&gt;
&lt;li&gt;Wiring Connections&lt;/li&gt;
&lt;li&gt;e-RT3 Dependencies&lt;/li&gt;
&lt;li&gt;Boot&lt;/li&gt;
&lt;li&gt;Grafana Dashboard Setup&lt;/li&gt;
&lt;li&gt;Gateway Node-RED Setup&lt;/li&gt;
&lt;li&gt;e-RT3 Node-RED Setup&lt;/li&gt;
&lt;li&gt;Using the Application&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setup &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Introduction &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;The purpose of this application is to receive data from sushi sensors, using the e-RT3 as a data acquisition module. The e-RT3 will send sushi data to a cloud database, InfluxDB Cloud, and will monitor the data using a visualization software, Grafana.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnztxikar8gu5olecfl52.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnztxikar8gu5olecfl52.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Overview &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Materials &lt;a&gt;&lt;/a&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.amazon.com/dp/B08GYG6T12/ref=twister_B0BN8Q1Z9S?_encoding=UTF8&amp;amp;psc=1" rel="noopener noreferrer"&gt;SD card&lt;/a&gt; (SanDisk 32GB Ultra SDHC)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://fccid.io/N89-WR214E/User-Manual/Users-Manual-I-645102" rel="noopener noreferrer"&gt;Router&lt;/a&gt; (CyberTAN Technology WR214E Wireless-B Broadband Router)&lt;/li&gt;
&lt;li&gt;PC

&lt;ul&gt;
&lt;li&gt;e-RT3 setup&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;CPU module (F3RP70-2L)

&lt;ul&gt;
&lt;li&gt;Power modules (F3PU10-0S, F3PU16-0S, F3PU20-0S, F3PU26-0S, F3PU30-0S, F3PU36-0S)&lt;/li&gt;
&lt;li&gt;Base modules (F3BU04-0N, F3BU06-0N, F3BU05-0D, F3BU09-0N, F3BU013-0N, F3BU16-0N)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Sushi setup (please follow manuals to configure)

&lt;ul&gt;
&lt;li&gt;Vibration/pressure/temperature sensor&lt;/li&gt;
&lt;li&gt;Gateway&lt;/li&gt;
&lt;li&gt;Phone with "Sushi Sensor App" and "Key Card Editor"&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Software &lt;a&gt;&lt;/a&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.influxdata.com/products/influxdb-cloud/" rel="noopener noreferrer"&gt;InfluxDB Cloud&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Time-based database, cloud&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;a href="https://nodered.org/" rel="noopener noreferrer"&gt;Node-RED (e-RT3)&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Flow-based, low code development tool &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;a href="https://grafana.com/oss/grafana/" rel="noopener noreferrer"&gt;Grafana (e-RT3)&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Visualization software&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Helpful tools:

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://etcher.balena.io/#download-etcher" rel="noopener noreferrer"&gt;Balena Etcher (PC)&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Writes OS images&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;a href="https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.4" rel="noopener noreferrer"&gt;Windows PowerShell&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Command line&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;a href="https://winscp.net/eng/download.php" rel="noopener noreferrer"&gt;WinSCP&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;File manager, SFTP, FTP&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;a href="https://www.puttygen.com/download-putty" rel="noopener noreferrer"&gt;PuTTY&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Terminal emulator&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;a href="https://github.com/Yokogawa-Technologies-Solutions-India/e-RT3-docs/tree/31e5e48d1183f42d1935226cc87a6cff2cf520a3/Articles/e-RT3-SushiSensor" rel="noopener noreferrer"&gt;Github documentation&lt;/a&gt;

&lt;ul&gt;
&lt;li&gt;Web-based version control&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Manuals &lt;a&gt;&lt;/a&gt;
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;e-RT3

&lt;ul&gt;
&lt;li&gt;IM 34M06M52-25E&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Sushi

&lt;ul&gt;
&lt;li&gt;IM 01W06C01-01EN&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Gateway

&lt;ul&gt;
&lt;li&gt;TI01W06A51-50EN&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;GA10

&lt;ul&gt;
&lt;li&gt;IM 04L65B01-01EN&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h4&gt;
  
  
  Wiring &lt;a&gt;&lt;/a&gt;
&lt;/h4&gt;

&lt;p&gt;The LoRaWAN Gateway, PC, and LAN1 of e-RT3 should be connected to the router. All wiring can be connected now or connected as the manual progresses.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi2sbywsol76no4kxlbeg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi2sbywsol76no4kxlbeg.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Network Addresses &lt;a&gt;&lt;/a&gt;
&lt;/h4&gt;

&lt;h5&gt;
  
  
  &lt;em&gt;Default Addresses&lt;/em&gt;
&lt;/h5&gt;

&lt;p&gt;&lt;strong&gt;e-RT3 Web-browser&lt;/strong&gt;:&lt;br&gt;
&lt;a href="http://192.168.3.72" rel="noopener noreferrer"&gt;http://192.168.3.72&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gateway Web-browser&lt;/strong&gt;:&lt;br&gt;
&lt;a href="http://192.168.2.1" rel="noopener noreferrer"&gt;http://192.168.2.1&lt;/a&gt;&lt;br&gt;
Default username: admin&lt;br&gt;
Default password: Yokogawa1  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Router Web-browser&lt;/strong&gt;:&lt;br&gt;
&lt;a href="http://192.168.1.1" rel="noopener noreferrer"&gt;http://192.168.1.1&lt;/a&gt;&lt;br&gt;
*Default username: admin&lt;br&gt;
*Default password: admin&lt;br&gt;
*Check your router’s default settings  &lt;/p&gt;
&lt;h5&gt;
  
  
  &lt;em&gt;Final Addresses&lt;/em&gt;
&lt;/h5&gt;

&lt;p&gt;&lt;strong&gt;e-RT3 Web-browser&lt;/strong&gt;:&lt;br&gt;
&lt;a href="http://192.168.2.72" rel="noopener noreferrer"&gt;http://192.168.2.72&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;e-RT3 Grafana Server&lt;/strong&gt;:&lt;br&gt;
&lt;a href="http://192.168.2.72:3000" rel="noopener noreferrer"&gt;http://192.168.2.72:3000&lt;/a&gt;&lt;br&gt;
Default username: admin&lt;br&gt;
Default password: admin&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;e-RT3 Node-RED Server&lt;/strong&gt;:&lt;br&gt;
&lt;a href="http://192.168.2.72:1880" rel="noopener noreferrer"&gt;http://192.168.2.72:1880&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gateway Web-browser&lt;/strong&gt;:&lt;br&gt;
&lt;a href="https://192.168.2.4/" rel="noopener noreferrer"&gt;https://192.168.2.4/&lt;/a&gt;&lt;br&gt;
Default username: admin&lt;br&gt;
Default password: Yokogawa1&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gateway Node-RED Server&lt;/strong&gt;:&lt;br&gt;
&lt;a href="https://192.168.2.4:1880" rel="noopener noreferrer"&gt;https://192.168.2.4:1880&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Router Web-browser&lt;/strong&gt;:&lt;br&gt;
&lt;a href="http://192.168.2.1" rel="noopener noreferrer"&gt;http://192.168.2.1&lt;/a&gt;&lt;br&gt;
*Default username: admin&lt;br&gt;
*Default password: admin&lt;br&gt;
*Check your router’s default settings&lt;/p&gt;
&lt;h2&gt;
  
  
  Procedure &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;
&lt;h3&gt;
  
  
  1) SD Card Setup &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Please image the following file onto an SD card. The CPU module supports SDHC 4GB to 32GB. The&lt;br&gt;
recommended SD card is a &lt;a href="https://www.yokogawa.com/solutions/products-and-services/control/control-devices/real-time-os-based-machine-controllers/ert3-products/ert3-products-cpu/#Details__License__AI-control-learning-service-for-F3RP70-SFRL18-MPC" rel="noopener noreferrer"&gt;SanDisk Memory Card.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;a. &lt;a href="https://etcher.balena.io/#download-etcher" rel="noopener noreferrer"&gt;Download balenaEtcher.&lt;/a&gt;&lt;br&gt;
b. Un-zip and extract the “eRT3 + Sushi Sensor Application” folder to a desired location.&lt;br&gt;
c. Login or create an account on the &lt;a href="https://myportal.yokogawa.com/" rel="noopener noreferrer"&gt;Yokogawa Customer Portal.&lt;/a&gt;&lt;br&gt;
d. Please locate the latest SD card image and click on the file to download it. You can navigate &lt;br&gt;
from the homepage to “[Useful Links]” “PLC/PAC &amp;amp; Embedded Controller” &amp;gt; “OS-free CPU &lt;br&gt;
module OS image Download” &amp;gt; “Agree” &amp;gt; “OS image for F3RP70” &lt;br&gt;
“rp70_OS_Image_R211.zip”.&lt;br&gt;
OR click on the &lt;a href="https://partner.yokogawa.com/global/itc/ert3-software/sfrd14.htm" rel="noopener noreferrer"&gt;following link.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabo5je9j05xccxlmtqr0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabo5je9j05xccxlmtqr0.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;e. Use a SD card reader to insert the SD card into the PC.&lt;br&gt;
f. Open balenaEtcher. Select the OS image. Select target (SD card). Select Flash!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1zzn5su51cqip79qlx5r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1zzn5su51cqip79qlx5r.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;g. You may now insert the SD card into the SD1 slot of the e-RT3.&lt;/p&gt;
&lt;h3&gt;
  
  
  2) Setting up the Cloud &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;a. Create an account on &lt;a href="https://cloud2.influxdata.com/signup" rel="noopener noreferrer"&gt;InfluxDB Cloud.&lt;/a&gt; Use the official &lt;a href="https://docs.influxdata.com/influxdb/cloud/sign-up/" rel="noopener noreferrer"&gt;InfluxDB website&lt;/a&gt; for more information.&lt;br&gt;
b. Fill out the prompts for company and organization after logging in. My company name is “Yokogawa Corporation of America”. My organization name is “eRT3”. Make sure to select the correct region for the server. I selected “US East”.&lt;br&gt;
c. Choose the “Free” plan.&lt;br&gt;
d. Once you have reached the dashboard, go to “API Tokens”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjie0o0qoz30kq1af9q3t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjie0o0qoz30kq1af9q3t.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;e. Select “Generate API Token” &amp;gt; “All Access API Token”. Enter a description for the API Token. Click “Save”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fejp1xds2grgfsbil68a1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fejp1xds2grgfsbil68a1.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;f. &lt;strong&gt;Please copy and paste the custom API token into a safe location&lt;/strong&gt; where you can access it in the future.&lt;br&gt;
g. Navigate to “Load Data” &amp;gt; “Buckets” from the side bar.&lt;br&gt;
h. Click on “Create Bucket” and name the bucket “sushiSensor”. If you are on the free version, keep the “Data Retention Preferences” as “30 days”. Click “Create”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F550fdra8m7bbf2kovmlr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F550fdra8m7bbf2kovmlr.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;i. &lt;strong&gt;Please note down the server address located in your URL bar.&lt;/strong&gt; You can learn more about your &lt;a href="https://docs.influxdata.com/influxdb/cloud/reference/regions/" rel="noopener noreferrer"&gt;cloud region here.&lt;/a&gt; For example, if you live in the US East, please note down: &lt;a href="https://us-east-1-1.aws.cloud2.influxdata.com/" rel="noopener noreferrer"&gt;https://us-east-1-1.aws.cloud2.influxdata.com/.&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  3) Configuring the Network &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;To configure the network and change IP addresses of various devices, the PC IP address will need to be within the same network as the device it is communicating with. This will involve changing the PC IP address various times using the following steps:&lt;/p&gt;

&lt;p&gt;a. Go to your PC’s “Control Panel” &amp;gt; “Network and Internet” &amp;gt; “Network Connections”. Select the Ethernet connection to the router.&lt;br&gt;
b. Double-click on “Properties”.&lt;br&gt;
c. Double-click “Internet Protocol Version 4 (TCP/IPv4)”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F34fvz8tcsak3m6slodrm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F34fvz8tcsak3m6slodrm.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;d. Select “Use the following IP address:”.&lt;br&gt;
e. Change the PC IP address to one that is in the same network as the device’s address. For example, the default e-RT3 IP address is 192.168.3.72. Therefore, the PC address would need to be changed to 192.168.3.X (you may choose anything for X that has not already been assigned). Make the Subnet mask 255.255.255.0 (smaller network).&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2k9hxcp1lc3wfcs30v9b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2k9hxcp1lc3wfcs30v9b.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h5&gt;
  
  
  &lt;em&gt;Changing the e-RT3 IP address&lt;/em&gt;
&lt;/h5&gt;

&lt;p&gt;a. On the physical device itself, check to see if the e-RT3 is on Command Mode: 0 (the arrow should be pointing to 0). Make sure the e-RT3 is mounted to the Base module and is being powered through the Power Supply module. Refer to &lt;strong&gt;IM 34M06M52-25E&lt;/strong&gt; for more details.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp142k0sh41m6iejxjhno.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp142k0sh41m6iejxjhno.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;b. Using an ethernet cord, connect the PC directly to LAN1 of the e-RT3.&lt;br&gt;
c. Change the PC IP address to one that is in the same network as the e-RT3 (Use Ex: 192.168.3.3). &lt;br&gt;
d. This manual will be using Windows PowerShell as its terminal. If not already installed on your PC, please use the &lt;a href="https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-7.4" rel="noopener noreferrer"&gt;following link&lt;/a&gt; to install or find an alternative terminal.&lt;br&gt;
e. Wait until the display on the e-RT3 lights up “OS” under “BAT”. This means that the operating system is now running. If you try to SSH before the “OS” appears, it will not work.&lt;br&gt;
f. SSH into the e-RT3 using the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh ert3@192.168.3.72
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When prompted for the password, type (note: the typing will be invisible):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user_ert3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;g. (Optional):&lt;/strong&gt; If you have used this SSH key before and it notifies you that remote host identification has changed, you may need to locate and open your “known_hosts” file (may be located in the .ssh folder) in a text editor and remove the all the lines that includes the IP address and the key (corresponding to 192.168.3.72). You can then save the “known_hosts” file and attempt to SSH again. This time you will be prompted to add and confirm a new host key to the “known_hosts” file. Type “yes” if prompted.&lt;br&gt;
h. To make sure the DNS servers are specified, we need to change the resolved.conf file. Type the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/systemd/resolved.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When prompted for the password, type (note: it will be invisible):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user_ert3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;i. Once the file opens in the terminal, uncomment the DNS and Fallback DNS lines by deleted the “#” and add the Google DNS server addresses as shown below. Please note there is a space between “8.8.8.8” and “8.8.4.4”:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Resolve]
# Some examples of DNS servers which may be used for DNS= and FallbackDNS=:
# Cloudflare: 1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001
# Google:     8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844
# Quad9:      9.9.9.9 2620:fe::fe
DNS=8.8.8.8 8.8.4.4
FallbackDNS=8.8.8.8 8.8.4.4
#Domains=
#DNSSEC=no
#DNSOverTLS=no
#MulticastDNS=yes
#LLMNR=yes
#Cache=yes
#DNSStubListener=yes
#DNSStubListenerExtra=
#ReadEtcHosts=yes
#ResolveUnicastSingleLabel=no
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;j. On your keyboard, use the shortcut “ctrl + s” to save and then “ctrl + x” to exit the program.&lt;br&gt;
k. Restart systemd-resolved:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart systemd-resolved
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;l. To change the IP address for LAN1, we need to change its network configuration file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/systemd/network/10-eth0.network
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If prompted for the password, type (note: it will be invisible):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user_ert3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;m. Once the file opens in the terminal, change the text in the file so that it matches to the routes below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Match]
Name=eth0

[Network]
Address=192.168.2.72/24

[Route]
Gateway=192.168.2.1
Destination=192.168.2.0/24

[Route]
Gateway=192.168.2.1
Destination=0.0.0.0/0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;n. On your keyboard, use the shortcut “ctrl + s” to save and then “ctrl + x” to exit the program.&lt;br&gt;
o. Restart systemd-networkd:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart systemd-networkd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;p. Turn the e-RT3 off and on. The e-RT3 and PC are now on the same network and the e-RT3 has internet access.&lt;br&gt;
&lt;strong&gt;q. (Optional):&lt;/strong&gt; Change the PC IP address to one that is in the same network as the e-RT3 (Ex: 192.168.2.3). Ping 192.168.2.72 to make sure the PC and the e-RT3 are now on the same network:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ping 192.168.2.72
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you can send and receive packets successfully, the setup is correct.&lt;/p&gt;

&lt;p&gt;r. You may now remove the ethernet cord.&lt;/p&gt;

&lt;h5&gt;
  
  
  &lt;em&gt;Changing the Gateway IP address&lt;/em&gt;
&lt;/h5&gt;

&lt;p&gt;If further information is needed to set up the Gateway, please refer to &lt;strong&gt;TI01W06A51-50EN.&lt;/strong&gt;&lt;br&gt;
a. Using an ethernet cord, connect the PC directly to the Gateway.&lt;br&gt;
b. Change the PC IP address to one that is in the same network as the Gateway (Ex: 192.168.2.3). The default IP address of the Gateway is 192.168.2.1.&lt;br&gt;
c. Access the Gateway web-browser by entering “192.168.2.1” into the URL bar.&lt;br&gt;
d. An error message may appear but click on “Advanced” &amp;gt; “Proceed to 192.168.2.1 (unsafe)”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa78z5wvir3zg1gvrbcdu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa78z5wvir3zg1gvrbcdu.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fow1lfjlmc542jtcffoho.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fow1lfjlmc542jtcffoho.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;e. Login into the Gateway web-browser with the following default username and password:&lt;/p&gt;

&lt;p&gt;Username: admin&lt;/p&gt;

&lt;p&gt;Password: Yokogawa1&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fua3pt7yv6pekpm7jq56u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fua3pt7yv6pekpm7jq56u.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;f. On the left side of the dashboard, select “Setup” &amp;gt; “Network Interfaces”.&lt;br&gt;
g. Click the pen under “Options” to edit the IP address visible under the name “br0”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvtfa3az9yjrd4sb5udf4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvtfa3az9yjrd4sb5udf4.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;h. Change the IP address to 192.168.2.4 and hit “Submit”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpx9r6512fg7j0azc3nn6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpx9r6512fg7j0azc3nn6.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;i. Click on “Save and Restart” and press “OK” when prompted.&lt;br&gt;
j. The Gateway IP address is now changed. Give the web-browser some time to restart. Access the web-browser now at &lt;a href="https://192.168.2.4:1880/" rel="noopener noreferrer"&gt;https://192.168.2.4:1880/&lt;/a&gt; in the URL bar.&lt;br&gt;
k. You may now remove the ethernet cord.&lt;/p&gt;
&lt;h5&gt;
  
  
  &lt;em&gt;Changing the router IP address&lt;/em&gt;
&lt;/h5&gt;

&lt;p&gt;This procedure is for the CyberTAN Technology router WR214E. Please refer to your own router’s manual if different.&lt;/p&gt;

&lt;p&gt;a. Using an ethernet cord, connect the PC directly to one of the ports of the router. Make sure the router is connected to the internet and is powered.&lt;br&gt;
b. Reference your router’s manual to change its IP address. For example, the router in this setup, WR214E, has a default web-browser of &lt;a href="http://192.168.1.1/" rel="noopener noreferrer"&gt;http://192.168.1.1&lt;/a&gt; and a default username and password: admin. You will need to change the PC IP address to one that is in the same network as the router temporarily (Ex: 192.168.1.2).&lt;br&gt;
c. After changing the router IP address (to 192.168.2.1) and applying the changes within the web-browser, turn the router off and on. &lt;br&gt;
d. Change the PC IP address to one that is in the same network as the router (Ex: 192.168.2.2). You can now access the router web-browser at &lt;a href="http://192.168.2.1/" rel="noopener noreferrer"&gt;http://192.168.2.1.&lt;/a&gt;&lt;br&gt;
e. You may now remove the ethernet cord.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw10ueaab77lpi0dasajz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw10ueaab77lpi0dasajz.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  4) Wiring Connections &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;a. Please connect all devices to the same network via the router. The PC, LAN1 of the e-RT3, and Gateway can all plug into the router with an ethernet cord. The router needs to connect to an ethernet cable wired with internet connectivity. Make sure all devices are powered. The PC is only optional after the application is setup.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fivbnzogoml1xtsyxjmmq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fivbnzogoml1xtsyxjmmq.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  5) e-RT3 Dependencies &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A couple of different dependencies will need to be built on the e-RT3: NVM (Node Version Manager), Node.js, npm, Node-RED, Grafana. To interact with the e-RT3, you will need to SSH into it and continue to work in PowerShell.&lt;/p&gt;
&lt;h5&gt;
  
  
  &lt;em&gt;Installing NVM, Node.js, and npm&lt;/em&gt;
&lt;/h5&gt;

&lt;p&gt;Please refer to &lt;a href="https://medium.com/@imvinojanv/how-to-install-node-js-and-npm-using-node-version-manager-nvm-143165b16ce1" rel="noopener noreferrer"&gt;this manual&lt;/a&gt; for more information on how to install NVM. NVM is used to install Node.js and npm while maintaining various Node.js versions.&lt;/p&gt;

&lt;p&gt;a. SSH into the e-RT3 (using the steps shown in the “Configuring the Network” section of this manual.&lt;br&gt;
b. Run the following command to download and install NVM:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;c. Restart PowerShell by closing and opening it.&lt;br&gt;
d. SSH into the e-RT3.&lt;br&gt;
e. Verify that NVM was properly installed by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nvm --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;f. Install the latest version of Node.js using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nvm install --lts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;g. Verify that Node.js and npm were properly installed by running the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  &lt;em&gt;Installing Node-RED&lt;/em&gt;
&lt;/h5&gt;

&lt;p&gt;a. If needed, SSH into the e-RT3.&lt;br&gt;
b. Run the following command to install Node-RED:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g --unsafe-perm node-red
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;c. Verify that Node-RED was properly installed by running the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node-red --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;d. To start the Node-RED server, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node-red
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the server is running and you want to access the command line, you will have to open a new terminal as the current terminal will be preoccupied with the server.&lt;/p&gt;

&lt;p&gt;e. You may now access the Node-RED web-browser on the e-RT3 at &lt;a href="http://192.168.2.72:1880/" rel="noopener noreferrer"&gt;http://192.168.2.72:1880/&lt;/a&gt;.&lt;/p&gt;

&lt;h5&gt;
  
  
  &lt;em&gt;Installing Grafana&lt;/em&gt;
&lt;/h5&gt;

&lt;p&gt;a. If needed, SSH into the e-RT3.&lt;br&gt;
b. Update the packages list on the e-RT3:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;c. Run the following commands to install Grafana:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get install -y adduser libfontconfig1 musl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wget --no-check-certificate https://dl.grafana.com/oss/release/grafana_10.0.6_armhf.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo dpkg -i grafana_10.0.6_armhf.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;d. To start the Grafana server, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl start grafana-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;e. You may now access the Grafana web-browser on the e-RT3 at &lt;a href="http://192.168.2.72:3000/." rel="noopener noreferrer"&gt;http://192.168.2.72:3000/&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  6) Boot &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Once Node-RED and Grafana are installed, their servers must be manually started through the command line every time the e-RT3 is restarted. For convenience, it is recommended to automatically start the servers when the e-RT3 is booting.&lt;/p&gt;

&lt;h5&gt;
  
  
  &lt;em&gt;Node-RED Boot&lt;/em&gt;
&lt;/h5&gt;

&lt;p&gt;a. If needed, SSH into the e-RT3.&lt;br&gt;
b. To add Node-RED to the systemd boot, we will be using PM2, a process manager for Node.js. Run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g pm2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Please change the highlighted with the latest version of Node.js installed, if different. Use the command “node –version” to find the latest version.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pm2 start /home/ert3/.nvm/versions/node/v20.15.1/bin/node-red
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pm2 save
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pm2 startup systemd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The following command is given within the terminal and may change depending on your setup. If different than below, please follow the instructions for the path given in the terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo env PATH=$PATH:/home/ert3/.nvm/versions/node/v20.15.1/bin /home/ert3/.nvm/versions/node/v20.15.1/lib/node_modules/pm2/bin/pm2 startup systemd -u ert3 --hp /home/ert3
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;c. Turn the e-RT3 off and on.&lt;br&gt;
d. Verify that Node-RED is properly started at boot by accessing the web-browser (&lt;a href="http://192.168.2.72:1880/" rel="noopener noreferrer"&gt;http://192.168.2.72:1880/&lt;/a&gt;) without any additional commands.&lt;/p&gt;
&lt;h5&gt;
  
  
  &lt;em&gt;Grafana Boot&lt;/em&gt;
&lt;/h5&gt;

&lt;p&gt;a. If needed, SSH into the e-RT3.&lt;br&gt;
b. To add Grafana to the systemd boot, run the following commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo /bin/systemctl daemon-reload
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo /bin/systemctl enable grafana-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo /bin/systemctl start grafana-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;c. Turn the e-RT3 off and on.&lt;br&gt;
d. Verify that Grafana is properly started at boot by accessing the web-browser (&lt;a href="http://192.168.2.72:3000/" rel="noopener noreferrer"&gt;http://192.168.2.72:3000/&lt;/a&gt;) without any additional commands.&lt;/p&gt;

&lt;h3&gt;
  
  
  7) Grafana Dashboard Setup &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;We will be setting up the Grafana Dashboard and its connection to the InfluxDB Cloud server.&lt;/p&gt;

&lt;p&gt;a. Access the Grafana web-browser at &lt;a href="http://192.168.2.72:3000/." rel="noopener noreferrer"&gt;http://192.168.2.72:3000/&lt;/a&gt;&lt;br&gt;
b. Login into the Grafana web-browser with the following default username and password:&lt;/p&gt;

&lt;p&gt;Username: admin&lt;/p&gt;

&lt;p&gt;Password: admin&lt;/p&gt;

&lt;p&gt;c. You can set your own password or choose to keep it the same.&lt;br&gt;
d. On the home page, click the hamburger icon on the left to access “Connections” &amp;gt; “Data sources”. &lt;br&gt;
e. Click on “Add data source”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwf0wctmn32sx68jm0h1q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwf0wctmn32sx68jm0h1q.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;f. Select the InfluxDB option.&lt;br&gt;
g. Under “Query Language”, select “Flux”.&lt;br&gt;
h. Under “HTTP”, fill in the InfluxDB Cloud server URL: &lt;a href="https://us-east-1-1.aws.cloud2.influxdata.com/." rel="noopener noreferrer"&gt;https://us-east-1-1.aws.cloud2.influxdata.com/&lt;/a&gt; If you live in a different region, use the appropriate server URL.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwlhfprcirihwclqoog4z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwlhfprcirihwclqoog4z.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;i. Under “Auth”, turn on “Basic auth” and “Skip TLS Verify”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flhiq37kn49565vq2zb3x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flhiq37kn49565vq2zb3x.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Depending on your company’s security policies, you may need to assign a CA certificate rather than skipping the TLS Verify.&lt;/p&gt;

&lt;p&gt;j. In “InfluxDB Details”, name the “Organization” as “ert3”. Under “Token”, fill in the API token generated from the InfluxDB Cloud. Click on “Save &amp;amp; test”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffuk4tq0qsbz4r6uits3n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffuk4tq0qsbz4r6uits3n.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;h. Click on the hamburger icon on the left again and navigate to “Dashboards”.&lt;br&gt;
i. Select “New” &amp;gt; “Import”.&lt;br&gt;
j. Upload the " eRT3_Sushi_Dashboard-1719517428740.json" JSON file from the ZIP-folder provided with this manual.&lt;br&gt;
k. Under the “InfluxDB Cloud” dropdown, select “InfluxDB (default)” and click “Import”. You can now view the dashboard panels and change them as you wish. As the Node-RED flow is not configured and no data has been sent through the cloud database, all the panels should say “No data”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fze1egaijos8b5k5g6r3c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fze1egaijos8b5k5g6r3c.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  8) Gateway Node-RED Setup &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;We will be setting up the Gateway Node-RED flow and its connection to the e-RT3 Node-RED flow. The purpose of this flow is to receive data from the LoRaWAN and send it to the e-RT3 in the form of a JSON object. It is important to note that firmware versions of the gateway older than 5.3.0 use Node-RED. 5.3.0 or later use the “GW Custom App Generator for Sushi Sensor”. This manual uses the Node-RED firmware version. These steps can also be replicated with the Custom App version by placing &lt;a href="http://192.168.2.72:1800/sushidata" rel="noopener noreferrer"&gt;http://192.168.2.72:1800/sushidata&lt;/a&gt; in the URL box. You can learn more in the Gateway manual &lt;strong&gt;TI01W06A51-50EN&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;a. Access the Gateway Node-RED web-browser at &lt;a href="https://192.168.2.4:1880/" rel="noopener noreferrer"&gt;https://192.168.2.4:1880/&lt;/a&gt;. You can also access the web-browser from the Gateway web-browser by navigating to “Apps” and then clicking on “Launch Node-RED”.&lt;br&gt;
b. Login into the Gateway Node-RED web-browser with the following default username and password:&lt;/p&gt;

&lt;p&gt;Username: admin&lt;/p&gt;

&lt;p&gt;Password: Yokogawa1&lt;/p&gt;

&lt;p&gt;c. The dashboard will appear. Ensure all the blocks are in place and connected by dragging and dropping them from the left-hand bar:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkjlhh5voyey3atner75n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkjlhh5voyey3atner75n.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;d. Double-click on the orange function block and use the script below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7xt5km1fkr2bcoocd22h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7xt5km1fkr2bcoocd22h.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;e. Exit the function block. Double-click on the yellow input block and match the inputs below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqsgyitdjdub94mohll1j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqsgyitdjdub94mohll1j.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Gateway Node-RED server will be making a http post request to the e-RT3 Node-RED server.&lt;/p&gt;

&lt;p&gt;f. Make sure to click on the “Deploy” button if any changes were made.&lt;/p&gt;

&lt;h3&gt;
  
  
  9) e-RT3 Node-RED Setup &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;We will be setting up the e-RT3 Node-RED flow and its connection to the Gateway Node-RED flow and the InfluxDB Cloud server. The purpose of this flow is the translate the JSON object received from the Sushi Gateway into readable sensor data and send it to the cloud database.&lt;/p&gt;

&lt;p&gt;a. Access the e-RT3 Node-RED web-browser at &lt;a href="http://192.168.2.72:1880/." rel="noopener noreferrer"&gt;http://192.168.2.72:1880/&lt;/a&gt;&lt;br&gt;
b. Skip through the tutorial and instructions.&lt;br&gt;
c. Click on the hamburger icon on the top-right side and select “Import”.&lt;br&gt;
l. Click on “select a file to import” and upload the “eRT3_Sushi_Application_NodeRED_flow.json” JSON file from the ZIP-folder provided with this manual. Click on “Import”.&lt;br&gt;
d. Switch to the new tab created by the file named “eRT3_Sushi_Application_NodeRED_flow.json”.&lt;br&gt;
e. You will notice that an error is thrown for the influxdb blocks. To fix this error, we will need to add the “influxdb” library.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa0bgigjvkij5fb0080ds.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa0bgigjvkij5fb0080ds.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;f. Click on the hamburger icon and click on “Manage pallete”. Switch to the “Install” tab and look up the module “node-red-contrib-influxdb”. Select the first option with this exact name. When selecting which node-red packages to install, it is important to consider the last time the package was updated.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fegjlc7mkqx3iaec7tzrp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fegjlc7mkqx3iaec7tzrp.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;g. Click on “install”.&lt;br&gt;
h. Once it is done installing, click on “Close”.&lt;br&gt;
i. Double-click on the brown influxdb block named “[v2.0] Cloud sushi” that has appeared.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Few83aqsx7on0f4t1ln5l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Few83aqsx7on0f4t1ln5l.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;j. Match the inputs below if different:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4sfi4osjg341xi5qp2q3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4sfi4osjg341xi5qp2q3.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The bucket name must match what was named within the InfluxDB Cloud server. If you followed the manual exactly, use “sushiSensor”. Keep the “Measurement” name as “sushi” or you will have to change things later.&lt;/p&gt;

&lt;p&gt;k. Click on the pencil icon to edit the influxdb node. &lt;br&gt;
l. Fill in the InfluxDB Cloud server URL: &lt;a href="https://us-east-1-1.aws.cloud2.influxdata.com/." rel="noopener noreferrer"&gt;https://us-east-1-1.aws.cloud2.influxdata.com/&lt;/a&gt; If you live in a different region, use the appropriate server URL. &lt;br&gt;
m. Make sure to input the InfluxDB Cloud API token:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F362q4h209a5xh3l099h4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F362q4h209a5xh3l099h4.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;n. Click on “Update” and “Done”.&lt;br&gt;
&lt;strong&gt;o. (Optional):&lt;/strong&gt; Double-click on the leftmost yellow http request block to see it matches the code below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh3td12nwpivkxxd85x9r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh3td12nwpivkxxd85x9r.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;br&gt;
The URL must match the endpoint given in the Gateway Node-RED http request (“/sushidata”).&lt;/p&gt;

&lt;p&gt;b. Double-click the “sushiTranslation” block and copy and paste the code from the “sushi_translation_script_on_ert3.txt” text file into the “On Message” entry. You can find this file in the ZIP-folder provided with this manual.&lt;br&gt;
c. If you wish to send data to GA10, draw a line from the initial post request to the GA10 post request. You must have GA10 setup on your PC. Please refer to &lt;strong&gt;IM 04L65B01-01EN&lt;/strong&gt; for more information on how to connect GA10 and Sushi. Match the inputs below if different:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff1a1qoztvg7ict8b0792.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff1a1qoztvg7ict8b0792.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;p. Click on “Deploy” in the top-right corner. You should receive a successful deployment message. You have now completed setting up all the software.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffoxkqrc23hfe9ju4ddm2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffoxkqrc23hfe9ju4ddm2.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;q. To save the flow, click on the hamburger icon. Select “Export”.&lt;br&gt;
r. Click on the “Local” tab. Name the JSON file whatever you wish and click on “Export to library”.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0fh7obgdo4hzcymwn9li.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0fh7obgdo4hzcymwn9li.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  10) Using the Application &lt;a&gt;&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;You have completed all the steps to set up the application. To collect data and visualize it, you need to turn on the Sushi sensors that are connected to the Gateway. Vibration, temperature, and pressure sensors work with this application. Please refer to the Sushi sensor and Gateway manuals to learn more, respectively: &lt;strong&gt;IM 01W06C01-01EN, TI01W06A51-50EN&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;a. Turn on all Sushi sensors configured with the Gateway.&lt;br&gt;
b. Monitor the Grafana “eRT3_Sushi_Dashboard” as data comes through by navigating through the hamburger icon. Click on “Dashboards”. Select the “eRT3_Sushi_Dashboard”.&lt;br&gt;
c. You can select which devices you wish to monitor based on their EUIs. Click on the “eui” drop-down menu and select accordingly. If you select more than one EUI to display, the panels will repeat for each EUI.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdjebh9udxps791dns7ss.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdjebh9udxps791dns7ss.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;d. Depending on the sensor you are monitoring, certain panels will display “No data”. For instance, if you are displaying a vibration sensor, the panels for temperature and pressure sensors will display “No data”. Depending on the parameters selected within the Sushi app, these will appear appropriately within the panels. In the image below, a vibration sensor with the parameters for only the X-Axis is being visualized:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmjqa53qvje8xj6smeoo1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmjqa53qvje8xj6smeoo1.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;e. If you wish to show/hide any panels, click on the drop-down arrows next to the title names:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F40bxnshbzdggsji3fg25.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F40bxnshbzdggsji3fg25.png" alt="Image description" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;f. If you do not wish to have a permanent monitor, you can remove the PC from the setup. The sensors will continue to collect data and send it to the cloud database and Grafana regardless of if the PC is present.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You can now visualize Sushi sensor data on Grafana using InfluxDB Cloud and the e-RT3.&lt;br&gt;
Contact &lt;a href="//mailto:netra.gandhi@yokogawa.com"&gt;netra.gandhi@yokogawa.com&lt;/a&gt; for questions.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>nodered</category>
      <category>influxdb</category>
      <category>grafana</category>
      <category>ert3plus</category>
    </item>
    <item>
      <title>Using Power BI to visualize Edge data sent to Azure IoT Hub</title>
      <dc:creator>Yokogawa-BrigitteZacharia</dc:creator>
      <pubDate>Tue, 04 Apr 2023 10:00:36 +0000</pubDate>
      <link>https://dev.to/yokogawa-yts_india/using-power-bi-to-visualize-edge-data-sent-to-azure-iot-hub-3n60</link>
      <guid>https://dev.to/yokogawa-yts_india/using-power-bi-to-visualize-edge-data-sent-to-azure-iot-hub-3n60</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Azure IoT Runtime enables you to collect information and execute commands on Edge devices remotely. When installed on e-RT3 Plus, the features of both e-RT3 Plus and Azure Runtime Environment can be utilized to perform various operations.&lt;/p&gt;

&lt;p&gt;This is the last part of a five-part series that demonstrates how to use Azure Runtime Environment with e-RT3 Plus. The first two parts describe how to use Azure IoT Runtime environment to create and deploy Azure IoT Edge Python modules that read and upload data to an IoT Hub. In the first part we read data from a sample temperature module, in the second part we read data from an Analog Input Edge device.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d"&gt;Deploying a sample Python module on an Edge Device installed with Azure IoT Edge Runtime&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/yokogawa-yts_india/create-an-azure-iot-edge-python-module-to-gather-data-from-an-edge-device-and-transmit-it-to-the-iot-hub-5742"&gt;Create an Azure IoT Edge Python module to gather data from an Edge device and transmit it to the IoT Hub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The third part describes creating and deploying an Azure IoT Edge Python module that writes data to an Edge device.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/yokogawa-yts_india/create-an-azure-iot-edge-python-module-that-writes-data-to-an-edge-device-2p0j"&gt;Create an Azure IoT Edge Python module that writes data to an Edge device&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The fourth part describes visualizing the data received at the IoT Hub using a web application created by using Azure App Service.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/yokogawa-yts_india/using-azure-app-service-to-visualize-edge-data-sent-to-azure-iot-hub-apj"&gt;Using Azure App Service to visualize Edge data sent to Azure IoT Hub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this article, we visualize the data received at the IoT Hub by using Power BI. To send the data to Power BI, an Azure Stream Analytics job is created which connects to the Power BI workspace. The data visualizations are then configured in the designer of Power BI.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftm84n9oer1idnfqi6mca.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftm84n9oer1idnfqi6mca.png" alt="00_PowerBI_Positioning" width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The ultimate goal for this article series is to demonstrate how to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a Python data collection module to gather data, process it and upload it to IoT Hub&lt;/li&gt;
&lt;li&gt;Create a Python module for writing data to an Edge device&lt;/li&gt;
&lt;li&gt;Visualize the collected data using Azure App Service and Power BI.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This article is based on the Microsoft tutorial &lt;a href="https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-power-bi" rel="noopener noreferrer"&gt;Visualize real-time sensor data from Azure IoT Hub using Power BI&lt;/a&gt;. For more information about installing and deploying Azure IoT Runtime environment, refer to &lt;a href="https://dev.to/yokogawa-yts_india/deploying-azure-runtime-environment-on-e-rt3-plus-4dlj"&gt;Deploying Azure Runtime Environment on e-RT3 Plus&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hardware modules
&lt;/h2&gt;

&lt;p&gt;The following table describes the hardware modules used in this article.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Module&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;e-RT3 Plus F3RP70-2L (CPU module, Ubuntu 18.04 32-bit)&lt;/td&gt;
&lt;td&gt;e-RT3 Plus controls the complete module set. It accesses each module from the CPU module to read and write data.  The &lt;code&gt;armhf&lt;/code&gt; architecture package runs on this device.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F3AD08-6R (Analog Input module)&lt;/td&gt;
&lt;td&gt;The Analog Input module (AD module) converts the external analog data received to digital data.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F3DA04-6R (Analog Output module)&lt;/td&gt;
&lt;td&gt;The Analog Output (DA module) module converts the digital data sent from the e-RT3 Plus to analog data.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F3BU05-0D (Base module)&lt;/td&gt;
&lt;td&gt;This is the base for connecting each module. It takes care of the power supply and communication between the modules that are connected to it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F3PU20-0S (Power module)&lt;/td&gt;
&lt;td&gt;The Power module is connected on the Base module and is used for power supply.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The module configuration and wiring is the same as described in the &lt;a href="https://dev.to/yokogawa-yts_india/create-an-azure-iot-edge-python-module-that-writes-data-to-an-edge-device-2p0j"&gt;previous article&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For more information on the hardware modules, refer to &lt;a href="https://www.yokogawa.com/solutions/products-and-services/control/control-devices/real-time-os-based-machine-controllers/#Overview" rel="noopener noreferrer"&gt;this page&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The IoT Edge module development and device operations are performed on Windows 10 using Google Chrome as the web browser.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before trying to visualize the data in the IoT Hub using Power BI, you must complete the steps mentioned in the previous articles &lt;a href="https://dev.to/yokogawa-yts_india/create-an-azure-iot-edge-python-module-to-gather-data-from-an-edge-device-and-transmit-it-to-the-iot-hub-5742"&gt;Create an Azure IoT Edge Python module to gather data from an Edge device and transmit it to the IoT Hub&lt;/a&gt; and &lt;a href="https://dev.to/yokogawa-yts_india/create-an-azure-iot-edge-python-module-that-writes-data-to-an-edge-device-2p0j"&gt;Create an Azure IoT Edge Python module that writes data to an Edge device&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Workflow
&lt;/h2&gt;

&lt;p&gt;To visualize the data sent to the IoT Hub in Power BI, you must complete the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install Power BI&lt;/li&gt;
&lt;li&gt;Create IoT Hub consumer group&lt;/li&gt;
&lt;li&gt;Create Stream Analytics&lt;/li&gt;
&lt;li&gt;Configure Stream Analytics settings&lt;/li&gt;
&lt;li&gt;Configure and visualize data in Power BI&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Installing Power BI Desktop
&lt;/h2&gt;

&lt;p&gt;Power BI is a data analytics and reporting tool from Microsoft that helps you to visualize data. You can use it as a desktop application with Power BI Desktop or as a web service with Power BI service. In this demonstration, we use Power BI Desktop which is signed into a personal account.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The steps described in this article are the same if you use Power BI Desktop with a corporate account.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Follow these steps to install Power BI Desktop on your computer:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Navigate to the &lt;a href="https://powerbi.microsoft.com/en-us/desktop/" rel="noopener noreferrer"&gt;official website&lt;/a&gt; and click &lt;strong&gt;Download free&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Open Microsoft Store&lt;/em&gt; dialog box appears.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Open Microsoft Store&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the Microsoft Store window that opens, click &lt;strong&gt;Get&lt;/strong&gt; to download the installer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Install Power BI and open it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To sign in, in the upper-right corner, click &lt;strong&gt;Sign-in&lt;/strong&gt; and follow the instructions displayed.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdppzrzkc5oh9yf249y82.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdppzrzkc5oh9yf249y82.png" alt="01_InstallPowerBI" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Creating IoT Hub consumer group
&lt;/h2&gt;

&lt;p&gt;To create a IoT Hub consumer group from Azure Portal, follow the steps mentioned in the &lt;a href="https://dev.to/yokogawa-yts_india/using-azure-app-service-to-visualize-edge-data-sent-to-azure-iot-hub-apj#adding-a-consumer-group-to-the-iot-hub"&gt;previous article&lt;/a&gt;. For this demonstration, we have created a consumer group with the name &lt;code&gt;ert3-visualization-powerbi&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Ensure that you save the name of the consumer group as you will need to use it later.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Creating Stream Analytics
&lt;/h2&gt;

&lt;p&gt;To send data from the IoT Hub to Power BI, we create a Steam Analytics job in Azure Portal.&lt;/p&gt;

&lt;p&gt;Follow these steps to create a stream analytics job:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to &lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;Azure Portal&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;In the upper left corner of the page, click &lt;strong&gt;Create a resource&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the search box, type &lt;code&gt;Stream Analytics job&lt;/code&gt; and select the same from the search results.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu8vw83s5hb1jrwmdix6t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu8vw83s5hb1jrwmdix6t.png" alt="02_StreamAnalytics" width="498" height="244"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the mandatory details as shown in the following table.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Project details - Subscription&lt;/td&gt;
&lt;td&gt;Select any existing subscription&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Project details - Resource Group&lt;/td&gt;
&lt;td&gt;Create a new Resource Group or select any existing Resource Group&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Instance details - Name&lt;/td&gt;
&lt;td&gt;Specify any unique name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Instance details - Region&lt;/td&gt;
&lt;td&gt;Select any region as applicable&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Instance details - Hosting environment&lt;/td&gt;
&lt;td&gt;Select &lt;strong&gt;Cloud&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Streaming unit details - Streaming unit&lt;/td&gt;
&lt;td&gt;In this demonstration, as we are not using any special processing for the stream data, streaming unit 3 is sufficient.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8vt1ayysyg7rsj81rjtf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8vt1ayysyg7rsj81rjtf.png" alt="03_Form_StreamAnalytics" width="745" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Stream Analytics usage is billed based on the start time and the number of streaming units. For more information on pricing, click &lt;a href="https://azure.microsoft.com/en-us/pricing/details/stream-analytics/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Review + create&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After verifying the configured information, click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;A message is displayed indicating that the Stream Analytics job is deployed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuring Stream Analytics settings
&lt;/h2&gt;

&lt;p&gt;Follow these steps to configure the settings for the Stream Analytics job:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Navigate to &lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;Azure Portal&lt;/a&gt; and open the Stream Analytics job that you created.&lt;/p&gt;

&lt;p&gt;The overview page appears.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs3amtniehcnqn0mxbo60.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs3amtniehcnqn0mxbo60.png" alt="04_Summary_StreamAnalytics" width="800" height="469"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To add an input to the Stream Analytics job, perform these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Add input&lt;/strong&gt; and select &lt;strong&gt;IoT Hub&lt;/strong&gt; from the drop-down list.&lt;br&gt;
The &lt;em&gt;IoT Hub&lt;/em&gt; pane appears.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjj72qvi0deqnthcqwq5h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjj72qvi0deqnthcqwq5h.png" alt="05_IoTHubSettings" width="362" height="539"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the parameters as shown in the following table.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Input alias&lt;/td&gt;
&lt;td&gt;Specify any name to use as an alias&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Subscription&lt;/td&gt;
&lt;td&gt;Select the Azure subscription that you are using for the IoT Hub from which you want to visualize data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IoT Hub&lt;/td&gt;
&lt;td&gt;Select the IoT Hub from which you want to to visualize data&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Consumer group&lt;/td&gt;
&lt;td&gt;Specify the consumer group created in Creating IoT Hub consumer group
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Save&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The IoT hub is added to the input list and a message is displayed indicating that the connection test is successful.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;To add an output to the Stream Analytics job, perform these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;From the overview page, click &lt;strong&gt;Add output&lt;/strong&gt; and then select &lt;strong&gt;Power BI&lt;/strong&gt; from the drop-down list.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Power BI - New output&lt;/em&gt; pane appears.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frpjoqau52tdvzmz7nbvb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frpjoqau52tdvzmz7nbvb.png" alt="06_AddOutput" width="800" height="495"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Authorize&lt;/strong&gt; and follow the instructions displayed to sign in to your Power BI account.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2r3c34jedg0moekn4yi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2r3c34jedg0moekn4yi.png" alt="07_PowerBISettings" width="437" height="866"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After you sign in to Power BI, configure the parameters as shown in the following table.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Output alias&lt;/td&gt;
&lt;td&gt;Specify any name to use as an alias&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Subscription&lt;/td&gt;
&lt;td&gt;Select your target group workspace&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Dataset name&lt;/td&gt;
&lt;td&gt;Specify a dataset name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Table name&lt;/td&gt;
&lt;td&gt;Specify a table name&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Save&lt;/strong&gt;.&lt;br&gt;
The Power BI settings are added to the ouput list and a message is displayed indicating that the connection test is successful.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;To configure the query for the Stream Analytics job, perform these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;On the left pane, under &lt;strong&gt;Job topology&lt;/strong&gt;, select &lt;strong&gt;Query&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fitafsw3skowxcmkncqzl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fitafsw3skowxcmkncqzl.png" alt="08_Query" width="800" height="327"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the editor that appears, type the query as follows:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;
&lt;span class="n"&gt;messageID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;deviceID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="k"&gt;CAST&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nb"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="nb"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="nb"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="n"&gt;ch1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch8&lt;/span&gt;
&lt;span class="k"&gt;INTO&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;Set&lt;/span&gt; &lt;span class="k"&gt;output&lt;/span&gt; &lt;span class="k"&gt;alias&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;Set&lt;/span&gt; &lt;span class="k"&gt;input&lt;/span&gt; &lt;span class="k"&gt;alias&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Save query&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;A notification appears indicating that the settings are saved.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;To start the Stream Analytics job, from the overview page, click &lt;strong&gt;Start&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;After the job is started successfully, the job status changes from &lt;code&gt;Stopped&lt;/code&gt; to &lt;code&gt;Running&lt;/code&gt;.&lt;/p&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;h2&gt;
  
  
  Configure and visualize data in Power BI
&lt;/h2&gt;

&lt;p&gt;Follow these steps to visualize the data in Power BI:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Power BI Desktop.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From the menu bar, select &lt;strong&gt;Home &amp;gt; Get data &amp;gt;Power BI Datasets&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Data hub&lt;/em&gt; page appears.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp65jlocb0jk7wg0d6dpm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp65jlocb0jk7wg0d6dpm.png" alt="09_Dataselection" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select the dataset that you specified in step 3 of Configuring Stream Analytics settings.&lt;/p&gt;

&lt;p&gt;The data set is loaded and the designer appears. The &lt;strong&gt;Filter&lt;/strong&gt;, &lt;strong&gt;Visualizations&lt;/strong&gt;, and &lt;strong&gt;Fields&lt;/strong&gt; panes appear on the right.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz9m03ffw4nbfua7ly0z8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz9m03ffw4nbfua7ly0z8.png" alt="10_ConfigureDataset" width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To design the visualization chart, perform these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;To visualize the data in a particular channel, in the &lt;strong&gt;Fields&lt;/strong&gt; pane, select the checkbox next to channel name.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Visualizations&lt;/strong&gt; pane, select the &lt;strong&gt;Line graph&lt;/strong&gt; icon. You can resize the chart screen displayed in the centre as necessary.&lt;/p&gt;

&lt;p&gt;The sum of values is displayed, since the horizontal axis is not yet configured.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk83ttvjgptpmotbg5arn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk83ttvjgptpmotbg5arn.png" alt="11_ConfigureChart" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the &lt;strong&gt;Fields&lt;/strong&gt; pane, select the &lt;strong&gt;datetime&lt;/strong&gt; check box and drag it to the &lt;strong&gt;X-axis&lt;/strong&gt; section in the &lt;strong&gt;Visualizations&lt;/strong&gt; pane.  &lt;/p&gt;

&lt;p&gt;The date and time is displayed on the horizontal axis.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the &lt;strong&gt;Filters pane&lt;/strong&gt;, expand &lt;strong&gt;datetime&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;From the &lt;strong&gt;Filter type&lt;/strong&gt; drop-down list, select &lt;strong&gt;Relative time&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;From the &lt;strong&gt;Show items when the value&lt;/strong&gt; drop-down list, select &lt;strong&gt;is in the last&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the value box, type &lt;code&gt;5&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From the drop-down list, select &lt;strong&gt;minutes&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The chart is updated to display data from the last five minutes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3pnfh6ckbemobzvwrvvv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3pnfh6ckbemobzvwrvvv.png" alt="12_Output" width="800" height="466"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;To refresh the data displayed on the chart click &lt;strong&gt;Update&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If the visualization is successful, the following chart is displayed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ckb8ooebntdnimt9xl1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0ckb8ooebntdnimt9xl1.png" alt="13_Visualization" width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;To stop sending data, after the verification is complete, in Azure Portal, expand the Stream Analytics job summary and click &lt;strong&gt;Stop&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;

&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The Stream Analytics billing is calculated based on operation time and streaming units.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The data that is sent to the IoT Hub is visualized in Power BI Desktop. This concludes the article series that demonstrates how to use Azure IoT Runtime to send data to IoT Hub from an Edge device, write data to an Edge device, and visualize the data in Power BI and Azure App Service.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.yokogawa.com/solutions/products-and-services/control/control-devices/real-time-os-based-machine-controllers/#Overview" rel="noopener noreferrer"&gt;Real-time OS controller e-RT3 Plus F3RP70-2L&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://devicecatalog.azure.com/" rel="noopener noreferrer"&gt;Azure Certified Device catalog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-web-apps" rel="noopener noreferrer"&gt;Visualize real-time sensor data from your Azure IoT hub in a web application&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-power-bi" rel="noopener noreferrer"&gt;Tutorial: Visualize real-time sensor data from Azure IoT Hub using Power BI&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ert3plus</category>
      <category>powerbi</category>
      <category>azureruntimeenvironment</category>
      <category>azureiotruntime</category>
    </item>
    <item>
      <title>Using Azure App Service to visualize Edge data sent to Azure IoT Hub</title>
      <dc:creator>Yokogawa-BrigitteZacharia</dc:creator>
      <pubDate>Tue, 04 Apr 2023 09:40:59 +0000</pubDate>
      <link>https://dev.to/yokogawa-yts_india/using-azure-app-service-to-visualize-edge-data-sent-to-azure-iot-hub-apj</link>
      <guid>https://dev.to/yokogawa-yts_india/using-azure-app-service-to-visualize-edge-data-sent-to-azure-iot-hub-apj</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Azure IoT Runtime enables you to collect information and execute commands on Edge devices remotely. When installed on e-RT3 Plus, the features of both e-RT3 Plus and Azure Runtime Environment can be utilized to perform various operations.&lt;/p&gt;

&lt;p&gt;This is part four of a five-part series that demonstrates how to use Azure Runtime Environment with e-RT3 Plus. The first two parts describe how to use Azure IoT Runtime environment to create and deploy Azure IoT Edge Python modules that read and upload data to an IoT Hub. In the first part we read data from a sample temperature module, in the second part we read data from an Analog Input Edge device.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d"&gt;Deploying a sample Python module on an Edge Device installed with Azure IoT Edge Runtime&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/yokogawa-yts_india/create-an-azure-iot-edge-python-module-to-gather-data-from-an-edge-device-and-transmit-it-to-the-iot-hub-5742"&gt;Create an Azure IoT Edge Python module to gather data from an Edge device and transmit it to the IoT Hub&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The third part describes creating and deploying an Azure IoT Edge Python module that writes data to an Edge device.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/yokogawa-yts_india/create-an-azure-iot-edge-python-module-that-writes-data-to-an-edge-device-2p0j"&gt;Create an Azure IoT Edge Python module that writes data to an Edge device&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this article, we create a web application that visualizes the data received at the IoT Hub using Azure App Services.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8jlq8jzj96h7vxgmaxn3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8jlq8jzj96h7vxgmaxn3.png" alt="00_WebApp_Positioning" width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The ultimate goal for this article series is to demonstrate how to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create an Azure IoT Edge Python module to gather data, process it, and upload it to IoT Hub&lt;/li&gt;
&lt;li&gt;Create an Azure IoT Edge Python module for writing data to an Edge device&lt;/li&gt;
&lt;li&gt;Visualize the collected data using Azure App Service and Power BI.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This article is based on the Microsoft tutorial &lt;a href="https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-web-apps" rel="noopener noreferrer"&gt;Visualize real-time sensor data from your Azure IoT hub in a web application&lt;/a&gt;. For more information about installing and deploying Azure IoT Runtime environment, refer to &lt;a href="https://dev.to/yokogawa-yts_india/deploying-azure-runtime-environment-on-e-rt3-plus-4dlj"&gt;Deploying Azure Runtime Environment on e-RT3 Plus&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hardware modules
&lt;/h2&gt;

&lt;p&gt;The following table describes the hardware modules used in this article.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Module&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;e-RT3 Plus F3RP70-2L (CPU module, Ubuntu 18.04 32-bit)&lt;/td&gt;
&lt;td&gt;e-RT3 Plus controls the complete module set. It accesses each module from the CPU module to read and write data.  The &lt;code&gt;armhf&lt;/code&gt; architecture package runs on this device.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F3AD08-6R (Analog Input module)&lt;/td&gt;
&lt;td&gt;The Analog Input module (AD module) converts the external analog data received to digital data.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F3DA04-6R (Analog Output module)&lt;/td&gt;
&lt;td&gt;The Analog Output (DA module) module converts the digital data sent from the e-RT3 Plus to analog data.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F3BU05-0D (Base module)&lt;/td&gt;
&lt;td&gt;This is the base for connecting each module. It takes care of the power supply and communication between the modules that are connected to it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F3PU20-0S (Power module)&lt;/td&gt;
&lt;td&gt;The Power module is connected on the Base module and is used for power supply.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The module configuration and wiring is the same as described in the &lt;a href="https://dev.to/yokogawa-yts_india/create-an-azure-iot-edge-python-module-that-writes-data-to-an-edge-device-2p0j"&gt;previous article&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For more information on the hardware modules, refer to &lt;a href="https://www.yokogawa.com/solutions/products-and-services/control/control-devices/real-time-os-based-machine-controllers/#Overview" rel="noopener noreferrer"&gt;this page&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The IoT Edge module development and device operations are performed on Windows 10 using Google Chrome as the web browser.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before trying to visualize the data in the IoT Hub using Azure App Service, you meet the following requirements:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Complete the steps mentioned in the articles &lt;a href="https://dev.to/yokogawa-yts_india/create-an-azure-iot-edge-python-module-to-gather-data-from-an-edge-device-and-transmit-it-to-the-iot-hub-5742"&gt;Create an Azure IoT Edge Python module to gather data from an Edge device and transmit it to the IoT Hub&lt;/a&gt; and &lt;a href="https://dev.to/yokogawa-yts_india/create-an-azure-iot-edge-python-module-that-writes-data-to-an-edge-device-2p0j"&gt;Create an Azure IoT Edge Python module that writes data to an Edge device&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Install &lt;a href="https://git-scm.com/" rel="noopener noreferrer"&gt;Git for Windows&lt;/a&gt; on your computer as Git is used in the deployment of the web application.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Workflow
&lt;/h2&gt;

&lt;p&gt;To create a web application that visualizes the data received at the IoT Hub using Azure App services, we must complete the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Adding a consumer group to the IoT Hub&lt;/li&gt;
&lt;li&gt;Obtaining the IoT Hub service connection string&lt;/li&gt;
&lt;li&gt;Creating web application&lt;/li&gt;
&lt;li&gt;Deploying a web application&lt;/li&gt;
&lt;li&gt;Verifying data visualization in the web application&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Adding a consumer group to the IoT Hub
&lt;/h2&gt;

&lt;p&gt;Adding a consumer group to the IoT hub endpoint to enables the web application to read data from it.&lt;/p&gt;

&lt;p&gt;Follow these steps to add a consumer group to the IoT Hub:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to &lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;Azure Portal&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;On the left pane, under the &lt;strong&gt;Hub settings&lt;/strong&gt; category, click &lt;strong&gt;Built-in endpoints&lt;/strong&gt;.
The &lt;em&gt;Built-in endpoints&lt;/em&gt; page appears.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd0qz3ihg24wdcd5zz7g5.png" alt="01_ConsumerGroupSettings" width="800" height="474"&gt;
&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Consumer Groups&lt;/strong&gt; section, create a consumer group.
&amp;gt; &lt;strong&gt;Note&lt;/strong&gt;: Ensure that you save the name of the consumer group as you will need to use it later.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Obtaining the IoT Hub service connection string
&lt;/h2&gt;

&lt;p&gt;The service connection string provides the required permissions for a service to read and write data to the IoT Hub's endpoints.&lt;/p&gt;

&lt;p&gt;Follow these steps to obtain the service connection string for your IoT Hub:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to &lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;Azure Portal&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the left pane, under the &lt;strong&gt;Security settings&lt;/strong&gt; category, click &lt;strong&gt;Shared access policies&lt;/strong&gt;.&lt;br&gt;
The &lt;em&gt;Shared access policies&lt;/em&gt; page appears.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzad0mx9lo9mip3p8r00w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzad0mx9lo9mip3p8r00w.png" alt="02_ConnectionString" width="800" height="310"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Under the &lt;strong&gt;Manage shared access policies&lt;/strong&gt; section, click &lt;strong&gt;iothubowner&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;iothubowner&lt;/em&gt; pane appears, displaying the Primary and secondary connection strings.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Copy either the &lt;strong&gt;Primary connection string&lt;/strong&gt; or &lt;strong&gt;Secondary connection string&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Ensure that you save the connection string as you will need to use it later.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Creating web application
&lt;/h2&gt;

&lt;p&gt;To create a web application using Azure App Service, we must complete the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create App Service resource&lt;/li&gt;
&lt;li&gt;Configure App Service settings&lt;/li&gt;
&lt;li&gt;Modify web application code&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Creating App Service resource
&lt;/h3&gt;

&lt;p&gt;Follow these steps to create an App service resource:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to &lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;Azure Portal&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;In the upper left corner of the page, click &lt;strong&gt;Create a resource&lt;/strong&gt;.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9iu3zj4qu4q8v82wy3af.png" alt="03_CreateWebApp" width="800" height="602"&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Web App&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Create Web App&lt;/em&gt; page appears.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8snol6792n41rsxh2tl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8snol6792n41rsxh2tl.png" alt="04_SpecifydetailsWebApp" width="767" height="861"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the mandatory parameters as described in the following table.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Parameter&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Project details - Subscription&lt;/td&gt;
&lt;td&gt;Select an existing subscription&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Project details - Resource Group&lt;/td&gt;
&lt;td&gt;Create a new Resource Group or select an existing Resource Group&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Instance details - Name&lt;/td&gt;
&lt;td&gt;Specify any name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Instance details - Publish&lt;/td&gt;
&lt;td&gt;Select &lt;strong&gt;Code&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Instance details - Runtime stack*&lt;/td&gt;
&lt;td&gt;Specify &lt;strong&gt;Node 16 LTS&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Instance details - Operating System&lt;/td&gt;
&lt;td&gt;Select &lt;strong&gt;Windows&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Instance details - Region&lt;/td&gt;
&lt;td&gt;Select region&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;App Service Plan - Windows Plan (&amp;lt;region name&amp;gt;)&lt;/td&gt;
&lt;td&gt;Create a new plan or select an existing plan.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;App Service Plan - SKU&lt;/td&gt;
&lt;td&gt;Select any item as necessary&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;App Service Plan - Size&lt;/td&gt;
&lt;td&gt;Select any item as necessary&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;*&lt;/code&gt; - Since the web application is created based on the sample described in &lt;a href="https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-web-apps" rel="noopener noreferrer"&gt;Visualize real-time sensor data from your Azure IoT hub in a web application&lt;/a&gt;, select &lt;strong&gt;Node 16 LTS&lt;/strong&gt; for runtime stack.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Review + create&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After verifying the configured information, click &lt;strong&gt;Create&lt;/strong&gt;.&lt;br&gt;
A message is displayed indicating that the App Service is deployed.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Configuring App Service settings
&lt;/h3&gt;

&lt;p&gt;After creating the App Service resource, we must configure it.&lt;/p&gt;

&lt;p&gt;Follow these steps to configure the settings of the App Service:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to &lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;Azure Portal&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;App Services&lt;/strong&gt;, and then select your app.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the left pane, under the &lt;strong&gt;Settings&lt;/strong&gt; category, select &lt;strong&gt;Configuration&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Configuration&lt;/em&gt; page appears.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwifqt1ds46inedq66wtp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwifqt1ds46inedq66wtp.png" alt="041_Configuration" width="800" height="310"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Application settings&lt;/strong&gt; tab, click &lt;strong&gt;+ New application setting&lt;/strong&gt; and perform these steps:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr7x2vn0q2uqit8ernfpp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr7x2vn0q2uqit8ernfpp.png" alt="05_ConfigureSettings" width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Add the application settings described in the following table.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;th&gt;Deployment slot and settings&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;EventHubConsumerGroup&lt;/td&gt;
&lt;td&gt;Specify the consumer group name created in Adding a consumer group to the IoT Hub
&lt;/td&gt;
&lt;td&gt;Empty&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;IotHubConnectionString&lt;/td&gt;
&lt;td&gt;Specify the IoT Hub connection string obtained in the previous step
&lt;/td&gt;
&lt;td&gt;Empty&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Verify the added settings and click &lt;strong&gt;Save&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The settings are applied.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If a dialog box appears, click &lt;strong&gt;Continue&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Click the &lt;strong&gt;General settings&lt;/strong&gt; tab and specify the following details.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs233lmuxu6rh0lcg6dfn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs233lmuxu6rh0lcg6dfn.png" alt="06_AppSettingsModifyAdd" width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;From the &lt;strong&gt;HTTP version&lt;/strong&gt; drop-down list, select &lt;strong&gt;2.0&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;On&lt;/strong&gt; for the &lt;strong&gt;Web sockets&lt;/strong&gt; configuration.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Save&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;On the left pane, under the &lt;strong&gt;Deployment&lt;/strong&gt; category, click &lt;strong&gt;Deployment Center&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ghmmfu1jjjhg9dcnaat.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2ghmmfu1jjjhg9dcnaat.png" alt="07_GitURIClone" width="800" height="255"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;In the &lt;strong&gt;Settings&lt;/strong&gt; tab, from the &lt;strong&gt;Source&lt;/strong&gt; drop-down list, select &lt;strong&gt;Local Git&lt;/strong&gt; and click &lt;strong&gt;Save&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;FTPS credentials&lt;/strong&gt; tab changes to &lt;strong&gt;Local Git/FTPS credentials&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptn34292zhwbrbt8146j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptn34292zhwbrbt8146j.png" alt="08_FTPSCredentialInfo" width="789" height="474"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click the &lt;strong&gt;Local Git/FTPS credentials&lt;/strong&gt; tab.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Git Clone Uri&lt;/strong&gt; is displayed in the &lt;strong&gt;Local Git&lt;/strong&gt; section. Since this is required when you deploy the web application, copy and save it for future use.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;User scope&lt;/strong&gt; section, specify the &lt;strong&gt;Username&lt;/strong&gt;, &lt;strong&gt;Password&lt;/strong&gt; and &lt;strong&gt;Confirm Password&lt;/strong&gt;. These credentials will be required when you deploy the web application.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn8e2y0edoljzaimp74f6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn8e2y0edoljzaimp74f6.png" alt="09_AccountInfo" width="800" height="692"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: You can also change the username and password in this User scope section.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Save&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Modifying web application code
&lt;/h3&gt;

&lt;p&gt;The web application is created based on the sample code described in the tutorial &lt;a href="https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-web-apps" rel="noopener noreferrer"&gt;Visualize real-time sensor data from your Azure IoT hub in a web application&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: In this demonstration, we have used the code with the tag number &lt;code&gt;193943&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Follow these steps to modify the web application code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Run the following commands to clone the &lt;a href="https://github.com/Azure-Samples/web-apps-node-iot-hub-data-visualization" rel="noopener noreferrer"&gt;sample code&lt;/a&gt; with tag number &lt;code&gt;193943&lt;/code&gt; and create a branch.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/Azure-Samples/web-apps-node-iot-hub-data-visualization.git &lt;span class="nt"&gt;-b&lt;/span&gt; 193943
&lt;span class="nb"&gt;cd &lt;/span&gt;web-apps-node-iot-hub-data-visualization
git branch master
git checkout master
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;The license is available &lt;a href="https://github.com/Azure-Samples/web-apps-node-iot-hub-data-visualization/blob/master/LICENSE" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If your computer is in an environment that requires proxies to connect to the internet, configure the system environment variables as described here.&lt;/p&gt;
&lt;/blockquote&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Open the &lt;code&gt;web-apps-node-iot-hub-data-visualization&lt;/code&gt; folder in Visual Studio Code and edit following files:&lt;/p&gt;&lt;/li&gt;

&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;public/index.html&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Edit the title of the chart as follows:
&lt;/code&gt;&lt;/pre&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```html
&amp;lt;!-- Line 14 --&amp;gt;
&amp;lt;title&amp;gt;e-RT3 Plus &amp;amp;amp; AD08 Real-time Data&amp;lt;/title&amp;gt;

&amp;lt;!-- Line 23 --&amp;gt;
&amp;lt;span&amp;gt;e-RT3 Plus &amp;amp; AD08 Real-time Data&amp;lt;/span&amp;gt;
```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;public/js/chart-device-data.js&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The sample code is configured such that the temperature and humidity data collected from the sample module is represented on the vertical axis of the chart.

We modify it such that data from channel 1 and 2 of the Analog Input module is represented on the vertical axis of the chart.

Replace the parameters in the file `public/js/chart-device-data.js` according to the following table.

|Existing parameter|Modified value|
|---|---|
|temperatureData|ch1Data|
|humidityData|ch2Data|
|temperature, Temperature, Temperature (ºC)|ch1|
|humidity, Humidity, Humidity(%)|ch2|
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;scripts/event-hub-reader.js&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The sample code is configured such that the date and time at which the IoT Hub received telemetry data is represented on the horizontal axis of the chart.

We modify it such that the date and time at which the Python IoT Edge data collection module fetches the channel data is represented on the horizontal axis of the chart.

Modify the file `scripts/event-hub-reader.js` as follows:
&lt;/code&gt;&lt;/pre&gt;

&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```javascript
// Line 28
events[i].body.datetime,
```
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Deploying a web application
&lt;/h2&gt;

&lt;p&gt;Follow these steps to deploy the web application:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Visual Studio Code.&lt;/li&gt;
&lt;li&gt;From the Menu bar, select &lt;strong&gt;View &amp;gt; Terminal&lt;/strong&gt; to open the terminal.
&amp;gt; &lt;strong&gt;Note&lt;/strong&gt;: Ensure that the current working directory in the terminal is &lt;code&gt;web-apps-node-iot-hub-data-visualization&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the following commands to save the code changes to the local repository.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;    git add
    git commit
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the following command to add the remote repository.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git remote add webapp &amp;lt;Git_Clone_URI&amp;gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Here, &lt;code&gt;Git_Clone_URI&lt;/code&gt; is the URI obtained in step 8 of Configuring App Service settings.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the following command to push the web application to the remote repository.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git push webapp master:master
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;If the operation is completed, the following messages are displayed on the terminal. This operation usually takes a while to execute.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;remote: Deployment successful.
To ＜Git clone URI＞
&lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;new branch] master -&amp;gt; master
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate to &lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;Azure Portal&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the left pane, under the &lt;strong&gt;Deployment&lt;/strong&gt; category, click &lt;strong&gt;Deployment Center&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Deployment Center&lt;/em&gt; page appears.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F04defpwb2accsx4xtc2o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F04defpwb2accsx4xtc2o.png" alt="10_Deploy" width="800" height="302"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select the &lt;strong&gt;Logs&lt;/strong&gt; tab and verify whether the web application has been pushed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the web application is successfully deployed, on the left pane, click &lt;strong&gt;Overview&lt;/strong&gt; and then click &lt;strong&gt;Start&lt;/strong&gt; to start the web application.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw52alf5rksal9sava25c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw52alf5rksal9sava25c.png" alt="11_VerifyDeploy" width="800" height="217"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Verifying data visualization in the web application
&lt;/h2&gt;

&lt;p&gt;After starting the web application, you can open it by using the URL that is displayed on the same page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzadfygm1lp8gae4foyqd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzadfygm1lp8gae4foyqd.png" alt="11_1_URLDeploy" width="800" height="217"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The data collected by the IoT Edge module is displayed in real time.&lt;/p&gt;

&lt;p&gt;The following figure shows the chart displayed when the data is sent every 2 seconds.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpjc7a6nvz1ibphevyq3t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpjc7a6nvz1ibphevyq3t.png" alt="13_Twoseconds" width="800" height="434"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also modify the data collection interval for the Module Twin and observe the corresponding changes in the chart. The procedure to modify the interval for a Module Twin is described &lt;a href="https://dev.to/yokogawa-yts_india/create-an-azure-iot-edge-python-module-to-gather-data-from-an-edge-device-and-transmit-it-to-the-iot-hub-5742#update-module-twin-and-verify-operation"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The following figure shows the chart displayed when the data is sent every 5 seconds.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsx6naj319cpyt4g4rye8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsx6naj319cpyt4g4rye8.png" alt="14_Fiveseconds" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Since this URL can be accessed by anyone who has the link, you must stop the web application after confirming the operation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The data sent to IoT Hub by the Azure IoT Edge data collection module is visualized by using an Azure App Service web application. In the next article, we will use Power BI to visualize this data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Appendix
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Proxy settings
&lt;/h3&gt;

&lt;p&gt;If your computer is in an environment that requires proxies to connect to the internet, you must add the HTTPS_PROXY to the system environment variables in your computer.&lt;/p&gt;

&lt;p&gt;Follow these steps to add the HTTPS_PROXY to the system environment variables in your computer:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click the Start icon and search for &lt;code&gt;System environment variables&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From the search results, select "Edit the system environment variables".&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;System Properties&lt;/em&gt; dialog box appears.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Environment Variables...&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Environment Variables&lt;/em&gt; dialog box appears.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;System variables&lt;/strong&gt; section click &lt;strong&gt;New...&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;New System Variable&lt;/em&gt; dialog box appears.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7pb4n05jix14wnklgznk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7pb4n05jix14wnklgznk.png" alt="37_EnVariable" width="743" height="213"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Specify the &lt;strong&gt;Variable name&lt;/strong&gt; and &lt;strong&gt;Variable value&lt;/strong&gt; as described in the following table and then click &lt;strong&gt;OK&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Item name&lt;/th&gt;
&lt;th&gt;Setting information&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Variable name&lt;/td&gt;
&lt;td&gt;HTTPS_PROXY&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Variable value&lt;/td&gt;
&lt;td&gt;&lt;code&gt;http://username:password@example.com:port/&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The HTTPS_PROXY is added to the system environment variables in your computer.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.yokogawa.com/solutions/products-and-services/control/control-devices/real-time-os-based-machine-controllers/#Overview" rel="noopener noreferrer"&gt;Real-time OS controller e-RT3 Plus F3RP70-2L&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://devicecatalog.azure.com/" rel="noopener noreferrer"&gt;Azure Certified Device catalog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-web-apps" rel="noopener noreferrer"&gt;Visualize real-time sensor data from your Azure IoT hub in a web application&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-power-bi" rel="noopener noreferrer"&gt;Tutorial: Visualize real-time sensor data from Azure IoT Hub using Power BI&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ert3plus</category>
      <category>azurewebapps</category>
      <category>visualizedata</category>
      <category>azureiotruntime</category>
    </item>
    <item>
      <title>Create an Azure IoT Edge Python module that writes data to an Edge device</title>
      <dc:creator>Yokogawa-BrigitteZacharia</dc:creator>
      <pubDate>Tue, 04 Apr 2023 09:15:02 +0000</pubDate>
      <link>https://dev.to/yokogawa-yts_india/create-an-azure-iot-edge-python-module-that-writes-data-to-an-edge-device-2p0j</link>
      <guid>https://dev.to/yokogawa-yts_india/create-an-azure-iot-edge-python-module-that-writes-data-to-an-edge-device-2p0j</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Azure IoT Runtime enables you to collect information and execute commands on Edge devices remotely. When installed on e-RT3 Plus, the features of both e-RT3 Plus and Azure Runtime Environment can be utilized to perform various operations.&lt;/p&gt;

&lt;p&gt;This is part three of a five-part series that demonstrates how to use Azure Runtime Environment with e-RT3 Plus. The first two parts describe how to create and deploy Azure IoT Edge Python modules that read and upload data to an IoT Hub. In the first part, we read data from a sample temperature module, and in the second part we read data from an Analog Input Edge device.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d"&gt;Deploying a sample Python module on an Edge Device installed with Azure IoT Edge Runtime&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/yokogawa-yts_india/create-an-azure-iot-edge-python-module-to-gather-data-from-an-edge-device-and-transmit-it-to-the-iot-hub-5742"&gt;Create an Azure IoT Edge Python module to gather data from an Edge device and transmit it to the IoT Hub&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The aim of this article is to add a Azure IoT Edge Python writing module that generates waveform data according to the configuration received from the Module Twin and writes it to the Analog Output module. The Analog Input module which is connected to the Analog Output module receives the generated data. Subsequently, the Azure IoT Edge Python data collection module deployed in the &lt;a href="https://dev.to/yokogawa-yts_india/create-an-azure-iot-edge-python-module-to-gather-data-from-an-edge-device-and-transmit-it-to-the-iot-hub-5742"&gt;previous article&lt;/a&gt; collects data from all channels of the Analog Input module and sends the data to the IoT Hub.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzh7f9zlplwx9rk3jl0gj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzh7f9zlplwx9rk3jl0gj.png" alt="00_Write_Positioning" width="800" height="441"&gt;&lt;/a&gt;&lt;br&gt;
The ultimate goal for this article series is to demonstrate how to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create an Azure IoT Edge Python module to gather data, process it and upload it to IoT Hub&lt;/li&gt;
&lt;li&gt;Create a Azure IoT Edge Python module for writing data to an Edge device&lt;/li&gt;
&lt;li&gt;Visualize the collected data using Azure App Service and Power BI.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For more information about installing and deploying Azure IoT Runtime environment, refer to &lt;a href="https://dev.to/yokogawa-yts_india/deploying-azure-runtime-environment-on-e-rt3-plus-4dlj"&gt;Deploying Azure Runtime Environment on e-RT3 Plus&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Hardware modules
&lt;/h2&gt;

&lt;p&gt;The following figure shows the hardware modules used for this demonstration.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvzh4ih8e56i8a3ywu8c5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvzh4ih8e56i8a3ywu8c5.png" alt="Write_Setup" width="624" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The image shows connections to channels 1 and 2 only. However, in the actual test, channels 1 to 4 are connected.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The following table describes the hardware modules used in this article.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Module&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;e-RT3 Plus F3RP70-2L (CPU module, Ubuntu 18.04 32-bit)&lt;/td&gt;
&lt;td&gt;e-RT3 Plus controls the complete module set. It accesses each module from the CPU module to read and write data.  The &lt;code&gt;armhf&lt;/code&gt; architecture package runs on this device.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F3AD08-6R (Analog Input module)&lt;/td&gt;
&lt;td&gt;The Analog Input module (AD module) converts the external analog data received to digital data.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F3DA04-6R (Analog Output module)&lt;/td&gt;
&lt;td&gt;The Analog Output  module (DA module) converts the digital data sent from the e-RT3 Plus to analog data.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F3BU05-0D (Base module)&lt;/td&gt;
&lt;td&gt;This is the base for connecting each module. It takes care of the power supply and communication between the modules that are connected to it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F3PU20-0S (Power module)&lt;/td&gt;
&lt;td&gt;The Power module is connected on the Base module and is used for power supply.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For more information on the hardware modules, refer to &lt;a href="https://www.yokogawa.com/solutions/products-and-services/control/control-devices/real-time-os-based-machine-controllers/#Overview" rel="noopener noreferrer"&gt;this page&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The IoT Edge module development and device operations are performed on Windows 10.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before performing the steps described in this article, you must complete the steps mentioned in the &lt;a href="https://dev.to/yokogawa-yts_india/create-an-azure-iot-edge-python-module-to-gather-data-from-an-edge-device-and-transmit-it-to-the-iot-hub-5742#prerequisites"&gt;previous article&lt;/a&gt;. Additionally, you must meet the hardware requirements listed here.&lt;/p&gt;

&lt;p&gt;Follow these steps to verify the versions of the installed software:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Run the following command to verify that Azure IoT Edge version 1.1.4 is installed.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;iotedge &lt;span class="nt"&gt;--version&lt;/span&gt;
iotedge 1.1.4
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;For information about installing Azure IoT Edge, refer to &lt;a href="https://dev.to/yokogawa-yts_india/deploying-azure-runtime-environment-on-e-rt3-plus-4dlj"&gt;Deploying Azure Runtime Environment on e-RT3 Plus&lt;/a&gt;.&lt;/p&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Run the following commands to verify that Docker Desktop version 20.10 is installed.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;docker &lt;span class="nt"&gt;--version&lt;/span&gt;
Docker version 20.10.18+azure-1, build b40c2f6b5deeb11ac6c485c940865ee40664f0f0
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;For information about installing Docker Desktop, refer to &lt;a href="https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d#setting-up-the-container-engine"&gt;Setting up the Container Engine&lt;/a&gt;.&lt;/p&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;h2&gt;
  
  
  Workflow
&lt;/h2&gt;

&lt;p&gt;To write data from e-RT3 Plus to the Analog Output module, we must complete the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create Azure IoT Edge Python writing module&lt;/li&gt;
&lt;li&gt;Deploy module on e-RT3 Plus&lt;/li&gt;
&lt;li&gt;Verify module operation&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Module creation
&lt;/h2&gt;

&lt;p&gt;The Azure IoT Edge Python writing module writes data on channels 1 – 4 of the Analog Output module every 0.1 seconds. It can generate data for four types of waveforms.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sine wave&lt;/li&gt;
&lt;li&gt;Triangle wave&lt;/li&gt;
&lt;li&gt;Square wave&lt;/li&gt;
&lt;li&gt;Sawtooth wave&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To create and push the Azure IoT Edge Python writing module module to Azure portal, you must complete the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create module project&lt;/li&gt;
&lt;li&gt;Modify module code&lt;/li&gt;
&lt;li&gt;Build and push module&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Create module project
&lt;/h3&gt;

&lt;p&gt;The steps for creating a new Python module in Visual Studio Code are the same as described in the steps 2 - 4 of &lt;a href="https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d#creating-and-deploying-a-module"&gt;the previous article&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In this demonstration, we have created a project with the following details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Solution name : Ert3WriteDA&lt;/li&gt;
&lt;li&gt;Module template : Python Module&lt;/li&gt;
&lt;li&gt;Module name : Ert3WriteDAModule&lt;/li&gt;
&lt;li&gt;Target architecture : arm32v7&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Modify module code
&lt;/h3&gt;

&lt;p&gt;After creating the project, rewrite the contents of &lt;code&gt;main.py&lt;/code&gt; as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;signal&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ctypes&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;azure.iot.device&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;IoTHubModuleClient&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;azure.iot.device&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Message&lt;/span&gt;

&lt;span class="n"&gt;DESIRED_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;desired&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;ERT3DAOUT_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ert3daout&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;FORM_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;form&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;FORM_SIN_TAG&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;sin&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;FORM_TRIANGLE_TAG&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;triangle&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;FORM_SQUARE_TAG&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;square&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;FORM_SAWTOOTH_TAG&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;sawtooth&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;CYCLE_SEC_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;cycle_sec&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;AMPLITUDE_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;amplitude&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;OFFSET_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;offset&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;STATUS_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;CYCLE_SEC_DEFAULT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;
&lt;span class="n"&gt;AMPLITUDE_DEFAULT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2000&lt;/span&gt;
&lt;span class="n"&gt;OFFSET_DEFAULT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;CHTAG_KEYS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ch1&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ch2&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ch3&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ch4&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ch5&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ch6&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ch7&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ch8&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;FAM3DA_CHNUM&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;DA04&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;DA08&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;UNIT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;SLOT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="n"&gt;INTERVAL_SEC&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.1&lt;/span&gt;
&lt;span class="n"&gt;LDCONFIGEXEC&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ldconfig&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;M3LIB_PATH&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;/usr/local/lib/libm3.so.1&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;DaOut&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;unit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;slot&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;interval_sec&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__unit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;unit&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__slot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;slot&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__interval_sec&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;interval_sec&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__libc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cdll&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;LoadLibrary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M3LIB_PATH&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__libc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getM3IoName&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;restype&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;c_char_p&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__chnum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;__get_m3da_ch_num&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__counters&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__chnum&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__configs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;CHTAG_KEYS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__chnum&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;
        &lt;span class="n"&gt;signal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;signal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;signal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SIGALRM&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__signal_handler&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;signal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setitimer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;signal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ITIMER_REAL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;interval_sec&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;interval_sec&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__get_m3da_ch_num&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;namebytes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__libc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getM3IoName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;c_int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__unit&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;c_int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__slot&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
        &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;namebytes&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FAM3DA_CHNUM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;namebytes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__write_m3da_ch_data&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;short_arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;c_short&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
        &lt;span class="n"&gt;ch_data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;short_arr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__libc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;writeM3IoRegister&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;c_int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__unit&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;c_int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__slot&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;c_int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;c_int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="n"&gt;ch_data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__da_form_out&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;interval&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cycle&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ampl&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;offset&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;
        &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cycle&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;interval&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;FORM_SIN_TAG&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ampl&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pi&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;interval&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;cycle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;FORM_TRIANGLE_TAG&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;interval&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;ampl&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;cycle&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ampl&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ampl&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;ampl&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ampl&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;

        &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;FORM_SQUARE_TAG&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ampl&lt;/span&gt;
            &lt;span class="nf"&gt;if &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;cycle&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;interval&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
                &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt;

        &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;FORM_SAWTOOTH_TAG&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;count&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;interval&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;ampl&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;cycle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;ampl&lt;/span&gt;

        &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;data&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;offset&lt;/span&gt;

        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;__write_m3da_ch_data&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ch&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__signal_handler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;signum&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;frame&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__chnum&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;FORM_KEY&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__configs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;CHTAG_KEYS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]]:&lt;/span&gt;
                &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;__da_form_out&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
                    &lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__configs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;CHTAG_KEYS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]][&lt;/span&gt;&lt;span class="n"&gt;FORM_KEY&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
                    &lt;span class="n"&gt;INTERVAL_SEC&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__configs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;CHTAG_KEYS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]].&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;CYCLE_SEC_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;CYCLE_SEC_DEFAULT&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__configs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;CHTAG_KEYS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]].&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;AMPLITUDE_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;AMPLITUDE_DEFAULT&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__configs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;CHTAG_KEYS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]].&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;OFFSET_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;OFFSET_DEFAULT&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__counters&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
                    &lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__counters&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__counters&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;set_condition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;desired&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ERT3DAOUT_KEY&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;desired&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;STATUS_KEY&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__chnum&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;CHTAG_KEYS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;desired&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ERT3DAOUT_KEY&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
                &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__configs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;CHTAG_KEYS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
                &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__counters&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
            &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__configs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;CHTAG_KEYS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;desired&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ERT3DAOUT_KEY&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;CHTAG_KEYS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;{}):&lt;/span&gt;
                &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__configs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;CHTAG_KEYS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;desired&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ERT3DAOUT_KEY&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;CHTAG_KEYS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;{})&lt;/span&gt;
                &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__counters&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;

        &lt;span class="n"&gt;reported&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;STATUS_KEY&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;reported&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;da_out&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;module_client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;IoTHubModuleClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create_from_edge_environment&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;module_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;twin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;module_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_twin&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="n"&gt;daout&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;DaOut&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;UNIT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;SLOT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;INTERVAL_SEC&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;reported&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;daout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_condition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;twin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DESIRED_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{}))&lt;/span&gt;
    &lt;span class="n"&gt;module_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;patch_twin_reported_properties&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reported&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;reported&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;daout&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_condition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;module_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;receive_twin_desired_properties_patch&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;module_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;patch_twin_reported_properties&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reported&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;module_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;disconnect&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;


&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;LDCONFIGEXEC&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

    &lt;span class="nf"&gt;da_out&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Data is written to the Analog Output module every 0.1 seconds.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The library to access to Analog Output module is not included in the Azure IoT Edge Python writing module. Instead we bind the CPU module library for use.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Build and push modules
&lt;/h3&gt;

&lt;p&gt;After rewriting the code in &lt;code&gt;main.py&lt;/code&gt; and saving it, you must push the Azure IoT Edge Python writing module to the Container Registry.&lt;/p&gt;

&lt;p&gt;Follow these steps to build and push the Azure IoT Edge Python writing module to the Container Registry:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;On the left pane of the Visual Studio Code window, in the project folder, locate the &lt;code&gt;deployment.template.json&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Right-click the &lt;code&gt;deployment.template.json&lt;/code&gt; file and select &lt;strong&gt;Build and Push IoT Edge Solution&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The Azure IoT Edge Python writing module is built and pushed to the Container Registry. The progress of the command execution and the execution result is displayed on the Terminal pane at the bottom of the window.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Pushing the Azure IoT Edge Python writing module to Container Registry will fail if the proxy settings are not configured correctly. For more information about configuring the Visual Studio Code and Docker Desktop proxy settings refer &lt;a href="https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d#proxy-settings"&gt;Proxy settings&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Deploy module
&lt;/h2&gt;

&lt;p&gt;Except for the Module Twin settings, the deployment procedure for this module is the same as described in the &lt;a href="https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d#deploying-python-module"&gt;previous article&lt;/a&gt;. You can configure the Module Twin settings according to the format described here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhund7uf54dovznrkkj35.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhund7uf54dovznrkkj35.png" alt="01_deployModules" width="800" height="526"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: After deployment, verify that runtime status of the modules &lt;code&gt;$edgeAgent&lt;/code&gt;, &lt;code&gt;$edgeHub&lt;/code&gt;, &lt;code&gt;Ert3D2cModule&lt;/code&gt; and the deployed &lt;code&gt;Ert3WriteDAModule&lt;/code&gt; is displayed as  &lt;code&gt;running&lt;/code&gt;. Additionally, the &lt;code&gt;IoT Edge Runtime Response&lt;/code&gt; must be displayed as &lt;code&gt;200-OK&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Verify operation
&lt;/h2&gt;

&lt;p&gt;The module operation can be verified by performing the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Verifying the channel data&lt;/li&gt;
&lt;li&gt;Modifying the Module Twin and observing the changes&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Verifying channel data
&lt;/h3&gt;

&lt;p&gt;You can verify the operation of the module by following the procedure described in the &lt;a href="https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d#verifying-module-operation"&gt;previous article&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If the values of channels 1 - 4 are displayed in the following format, it means that the waveform data generated in the e-RT3 Plus device is sent to the Analog Output module.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"messageID"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;336&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"deviceID"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"test_ert3_f3rp70"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"datetime"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2021-04-07T02:30:53.839398Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"ch1"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;-358&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"ch2"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;827&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"ch3"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;501&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"ch4"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;413&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"ch5"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"ch6"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"ch7"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"ch8"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"enqueuedTime"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2021-04-07T02:30:53.847Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"properties"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Modifying Module Twin
&lt;/h3&gt;

&lt;p&gt;By modifying the properties of the Module Twin on the Azure portal, you can control the type of waveform generated for each output channel of the Analog Output module. You can also modify the properties of the waveform such as amplitude, wave period, and offset.&lt;/p&gt;

&lt;p&gt;Modify the properties of the Module Twin according to the format described here. For more information about how to edit the Module Twin, refer to the &lt;a href="https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d#editing-module-twin"&gt;previous article&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;After configuring the Module Twin settings, you can verify the operation of the deployed Azure IoT Edge Python writing module by following the procedure described in the &lt;a href="https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d#verifying-module-operation"&gt;previous article&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The waveform data is sent by the Azure IoT Edge Python writing module to the Analog Output module according to the settings configured in Module Twin. In the next article, we will visualize the data sent to the IoT Hub.&lt;/p&gt;

&lt;h2&gt;
  
  
  Appendix
&lt;/h2&gt;

&lt;h2&gt;
  
  
  Module Twin
&lt;/h2&gt;

&lt;p&gt;The following table describes the JSON parameters in the Module Twin that you can configure for generating waveforms with the Analog Output module.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;JSON parameter&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1ch - 4ch&lt;/td&gt;
&lt;td&gt;Channel for which the waveform settings are configured&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;form&lt;/td&gt;
&lt;td&gt;Wave form&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;cycle_sec&lt;/td&gt;
&lt;td&gt;Wave period&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;amplitude&lt;/td&gt;
&lt;td&gt;Wave amplitude&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;offset&lt;/td&gt;
&lt;td&gt;Wave offset&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Let us consider a sample configuration for generating waveforms at the Analog Output module as shown in the following table.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Channel number&lt;/th&gt;
&lt;th&gt;Wave type&lt;/th&gt;
&lt;th&gt;Wave period (seconds)&lt;/th&gt;
&lt;th&gt;Wave amplitude&lt;/th&gt;
&lt;th&gt;Wave offset&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Channel 1&lt;/td&gt;
&lt;td&gt;Sine wave&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;td&gt;2000&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Channel 2&lt;/td&gt;
&lt;td&gt;Triangle wave&lt;/td&gt;
&lt;td&gt;120&lt;/td&gt;
&lt;td&gt;1000&lt;/td&gt;
&lt;td&gt;100&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Channel 3&lt;/td&gt;
&lt;td&gt;Square wave&lt;/td&gt;
&lt;td&gt;30&lt;/td&gt;
&lt;td&gt;500&lt;/td&gt;
&lt;td&gt;0&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Channel 4&lt;/td&gt;
&lt;td&gt;Sawtooth wave&lt;/td&gt;
&lt;td&gt;40&lt;/td&gt;
&lt;td&gt;1500&lt;/td&gt;
&lt;td&gt;500&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The JSON code for configuring the Analog Output module to generate the waveforms as described in the table is as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ert3daout"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"ch1"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"form"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sin"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"cycle_sec"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"amplitude"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"offset"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"ch2"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"form"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"triangle"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"cycle_sec"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"amplitude"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"offset"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;-100&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"ch3"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"form"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"square"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"cycle_sec"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"amplitude"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"offset"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"ch4"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"form"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"sawtooth"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"cycle_sec"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"amplitude"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"offset"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;-500&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.yokogawa.com/solutions/products-and-services/control/control-devices/real-time-os-based-machine-controllers/#Overview" rel="noopener noreferrer"&gt;Real-time OS controller e-RT3 Plus F3RP70-2L&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://devicecatalog.azure.com/" rel="noopener noreferrer"&gt;Azure Certified Device catalog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-web-apps" rel="noopener noreferrer"&gt;Visualize real-time sensor data from your Azure IoT hub in a web application&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-power-bi" rel="noopener noreferrer"&gt;Tutorial: Visualize real-time sensor data from Azure IoT Hub using Power BI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-develop-for-linux?view=iotedge-1.4" rel="noopener noreferrer"&gt;Tutorial: Develop IoT Edge modules with Linux containers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-python-module?view=iotedge-1.4" rel="noopener noreferrer"&gt;Tutorial: Develop and deploy a Python IoT Edge module using Linux containers&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ert3plus</category>
      <category>pythonwritemodule</category>
      <category>azureruntime</category>
      <category>python</category>
    </item>
    <item>
      <title>Create an Azure IoT Edge Python module to gather data from an Edge device and transmit it to the IoT Hub</title>
      <dc:creator>Yokogawa-BrigitteZacharia</dc:creator>
      <pubDate>Tue, 04 Apr 2023 07:56:56 +0000</pubDate>
      <link>https://dev.to/yokogawa-yts_india/create-an-azure-iot-edge-python-module-to-gather-data-from-an-edge-device-and-transmit-it-to-the-iot-hub-5742</link>
      <guid>https://dev.to/yokogawa-yts_india/create-an-azure-iot-edge-python-module-to-gather-data-from-an-edge-device-and-transmit-it-to-the-iot-hub-5742</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Azure IoT Runtime enables you to collect information and execute commands on Edge devices remotely. When installed on e-RT3 Plus, the features of both e-RT3 Plus and Azure Runtime Environment can be utilized to perform various operations.&lt;/p&gt;

&lt;p&gt;This is part two of a five-part series that demonstrates how to use Azure Runtime Environment with e-RT3 Plus. In the &lt;a href="https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d"&gt;previous article&lt;/a&gt;, we created a Python module that sends data to the IoT Hub from a Simulated Temperature sensor module. In this article, we create a Python IoT Edge data collection module that gathers data from the Analog Input module (F3AD08-6R) and uploads it to the IoT Hub.&lt;/p&gt;

&lt;p&gt;The ultimate goal for this article series is to demonstrate how to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a Python data collection module to gather data, process it and upload it to IoT Hub&lt;/li&gt;
&lt;li&gt;Create a Python module for writing data to an Edge device&lt;/li&gt;
&lt;li&gt;Visualize the collected data using Azure App Service and Power BI&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fne62exljhss38yt48nv5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fne62exljhss38yt48nv5.png" alt="Positioning" width="800" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Hardware modules
&lt;/h2&gt;

&lt;p&gt;The following figure shows the hardware modules used for this demonstration.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7o2mzf8dhcu1f1qzbyyr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7o2mzf8dhcu1f1qzbyyr.png" alt="Setup" width="624" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The following table describes the hardware modules used in this article.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Module&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;e-RT3 Plus F3RP70-2L (CPU module, Ubuntu 18.04 32-bit)&lt;/td&gt;
&lt;td&gt;e-RT3 Plus controls the complete module set. It accesses each module from the CPU module to read and write data.  The &lt;code&gt;armhf&lt;/code&gt; architecture package runs on this device.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F3AD08-6R (Analog Input module)&lt;/td&gt;
&lt;td&gt;The Analog Input module converts the external analog data received to digital data.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F3BU05-0D (Base module)&lt;/td&gt;
&lt;td&gt;This is the base for connecting each module. It takes care of the power supply and communication between the modules that are connected to it.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;F3PU20-0S (Power module)&lt;/td&gt;
&lt;td&gt;Used for power supply, the Power module is connected on the Base module.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;For more information on the hardware modules, refer to &lt;a href="https://www.yokogawa.com/solutions/products-and-services/control/control-devices/real-time-os-based-machine-controllers/#Overview" rel="noopener noreferrer"&gt;this page&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The IoT Edge module development and device operations are performed on Windows 10.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;The prerequisites to complete this article are the same as the prerequisites mentioned in the &lt;a href="https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d#prerequisites"&gt;previous article&lt;/a&gt;. Additionally, you must meet the hardware requirements listed here.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;To send data from e-RT3 Plus to the IoT Hub and view the received data, we must complete the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create Python IoT Edge module&lt;/li&gt;
&lt;li&gt;Deploy module on e-RT3 Plus&lt;/li&gt;
&lt;li&gt;Verify module operation&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Module creation
&lt;/h2&gt;

&lt;p&gt;To create a module for collecting data from the Analog Input module and sending it to the IoT Hub, we create a new Python project using Visual Studio Code and then modify the code to suit our requirements.&lt;/p&gt;

&lt;p&gt;The Python IoT Edge data collection module must collect data from all the channels of the Analog Input module and send the collected data to the IoT Hub. Additionally, you must be able to configure the data collection frequency from the module twin.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create new project
&lt;/h3&gt;

&lt;p&gt;The steps for creating a new Python module in Visual Studio Code are the same as described in the steps 2 and 4 of &lt;a href="https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d#creating-and-deploying-a-module"&gt;the previous article&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In this demonstration, we have created a project with the following details:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Solution name : Ert3D2c&lt;/li&gt;
&lt;li&gt;Module template : Python Module&lt;/li&gt;
&lt;li&gt;Module name : Ert3D2cModule&lt;/li&gt;
&lt;li&gt;Target architecture : arm32v7&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Modify code
&lt;/h3&gt;

&lt;p&gt;After creating the project, rewrite the contents of &lt;code&gt;main.py&lt;/code&gt; as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;subprocess&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;signal&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ctypes&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;azure.iot.device&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;IoTHubModuleClient&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;azure.iot.device&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Message&lt;/span&gt;

&lt;span class="n"&gt;DESIRED_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;desired&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;ERT3ADD2C_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ert3add2c&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;INTERVALSEC_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;interval_sec&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;STATUS_KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;FAM3AD_CHNUM&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;AD04&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;AD08&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;UNIT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;SLOT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="n"&gt;DEFAULT_INTERVAL_SEC&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;2.0&lt;/span&gt;
&lt;span class="n"&gt;LDCONFIGEXEC&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ldconfig&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;M3LIB_PATH&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;/usr/local/lib/libm3.so.1&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="n"&gt;DEVICE_ID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;IOTEDGE_DEVICEID&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;OUTPUT_NAME&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;IOTEDGE_MODULEID&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ToIoTHub&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;


&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;AdD2C&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
    Class implemented by each function that collects data from the AD module.
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;module_client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;unit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;slot&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
        Contructor.
        &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__module_client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;module_client&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__unit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;unit&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__slot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;slot&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__message_no&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__libc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cdll&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;LoadLibrary&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;M3LIB_PATH&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__libc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;getM3IoName&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;restype&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;c_char_p&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__chnum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;__get_m3ad_ch_num&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;signal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;signal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;signal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SIGALRM&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__signal_handler&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__get_m3ad_ch_num&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
        Decide on either AD08 or  AD04.
        &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
        &lt;span class="n"&gt;namebytes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__libc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getM3IoName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;c_int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__unit&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;c_int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__slot&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
        &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;namebytes&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FAM3AD_CHNUM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;namebytes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decode&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__read_m3ad_ch_datas&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
        Obtain data from all channels of AD module.
        &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
        &lt;span class="n"&gt;short_arr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;c_short&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__chnum&lt;/span&gt;
        &lt;span class="n"&gt;ch_datas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;short_arr&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__libc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;readM3IoRegister&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;c_int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__unit&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;c_int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__slot&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;c_int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="n"&gt;ctypes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;c_int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__chnum&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="n"&gt;ch_datas&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;ch_datas&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__signal_handler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;signum&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;frame&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
        Create message and send to edgeHub module.
        &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
        &lt;span class="n"&gt;bodyDict&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;messageID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__message_no&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;deviceID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;DEVICE_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;utcnow&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;isoformat&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Z&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
            &lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;ch_datas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;__read_m3ad_ch_datas&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ch_value&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ch_datas&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
            &lt;span class="n"&gt;bodyDict&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;ch&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ch_value&lt;/span&gt;

        &lt;span class="n"&gt;bodyStr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dumps&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bodyDict&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Message&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bodyStr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;output_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;OUTPUT_NAME&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__module_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send_message&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bodyStr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

        &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__message_no&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;__message_no&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;set_condition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;desired&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
        Configure the data collection frequency settings.
        &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;ERT3ADD2C_KEY&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;desired&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;STATUS_KEY&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

        &lt;span class="n"&gt;interval_sec&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;desired&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ERT3ADD2C_KEY&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;INTERVALSEC_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                                                  &lt;span class="n"&gt;DEFAULT_INTERVAL_SEC&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;reported&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="n"&gt;reported&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ERT3ADD2C_KEY&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;desired&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ERT3ADD2C_KEY&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;interval_sec&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mf"&gt;0.0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;reported&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ERT3ADD2C_KEY&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;STATUS_KEY&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;False&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;signal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setitimer&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;signal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ITIMER_REAL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;interval_sec&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;interval_sec&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;reported&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;ERT3ADD2C_KEY&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="n"&gt;STATUS_KEY&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;

        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;reported&lt;/span&gt;


&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;send_ad_data&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
    Call each function.
    Monitor the changes in the module twin.
    &lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="n"&gt;module_client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;IoTHubModuleClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create_from_edge_environment&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;module_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;twin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;module_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_twin&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="n"&gt;add2c&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;AdD2C&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;module_client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;UNIT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;SLOT&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;reported&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;add2c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_condition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;twin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;DESIRED_KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{}))&lt;/span&gt;
    &lt;span class="n"&gt;module_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;patch_twin_reported_properties&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reported&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;reported&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;add2c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set_condition&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;module_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;receive_twin_desired_properties_patch&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;module_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;patch_twin_reported_properties&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;reported&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;module_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;disconnect&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;


&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;subprocess&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="n"&gt;LDCONFIGEXEC&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;

    &lt;span class="nf"&gt;send_ad_data&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The code flow is explained as comments in the code. Additional information on the code is described in Python code details.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Build and push modules
&lt;/h3&gt;

&lt;p&gt;After rewriting the code in &lt;code&gt;main.py&lt;/code&gt; and saving it, you must push the Python IoT Edge data collection module to the Container Registry.&lt;/p&gt;

&lt;p&gt;Follow these steps to build and push the Python IoT Edge data collection module to the Container Registry:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;On the left pane of the Visual Studio Code window, in the project folder, locate the &lt;code&gt;deployment.template.json&lt;/code&gt; file.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Right-click the &lt;code&gt;deployment.template.json&lt;/code&gt; file and select &lt;strong&gt;Build and Push IoT Edge Solution&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The Python IoT Edge data collection module is built and pushed to the Container Registry. The progress of the command execution and the execution result is displayed on the Terminal pane at the bottom of the window.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Pushing the Python IoT Edge data collection module to Container Registry will fail if the proxy settings are not configured correctly. For more information about configuring the Visual Studio Code and Docker Desktop proxy settings refer &lt;a href="https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d#proxy-settings"&gt;Proxy settings&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Deploy module
&lt;/h2&gt;

&lt;p&gt;After building the Python IoT Edge data collection module and pushing it to the Container Registry, we must deploy it on the e-RT3 Plus device.&lt;/p&gt;

&lt;p&gt;Follow these steps to deploy the Python IoT Edge data collection module on e-RT3 Plus from Azure Portal:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;Azure Portal&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Navigate to the IoT Hub that you created.&lt;/li&gt;
&lt;li&gt;On the left pane, under the &lt;strong&gt;Device management&lt;/strong&gt; section, click &lt;strong&gt;IoT Edge&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From the device IDs that are displayed, select the ID of the target device on which you want to deploy the module.&lt;/p&gt;

&lt;p&gt;The device information appears.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Set modules&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiwy0c3ygnwzf5d68gbdg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiwy0c3ygnwzf5d68gbdg.png" alt="Setup" width="800" height="397"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Container Registry Credentials&lt;/strong&gt; section, ensure that the credentials are configured. For more information about configuring the credentials, refer to step 7 of &lt;a href="https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d#creating-a-new-project"&gt;Creating a new project&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If the &lt;code&gt;PythonModule&lt;/code&gt; and &lt;code&gt;SimulatedTemperatureSensor&lt;/code&gt; modules configured in the &lt;a href="https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d#deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime"&gt;previous article&lt;/a&gt; are displayed, remove them by clicking the &lt;strong&gt;Delete&lt;/strong&gt; icon on the right.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To configure the settings of the Python IoT Edge data collection module, click &lt;strong&gt;+Add&lt;/strong&gt; and then select &lt;strong&gt;IoT Edge Module&lt;/strong&gt; from the drop-down list.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp5gdg6upw92asrwfdcev.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fp5gdg6upw92asrwfdcev.png" alt="IoTEdgeModuleParameters" width="800" height="617"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the parameters of the IoT Edge module as described in the following table and click &lt;strong&gt;Add&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting&lt;/th&gt;
&lt;th&gt;Information to be entered&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Module name&lt;/td&gt;
&lt;td&gt;The module name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Image URI&lt;/td&gt;
&lt;td&gt;Image URI obtained from the repository of Container Registry. For information about how to obtain the image URI, refer to Image URI.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Restart Policy&lt;/td&gt;
&lt;td&gt;Always (retain default settings)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Desired Status&lt;/td&gt;
&lt;td&gt;Running (retain default settings)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Image Pull Policy&lt;/td&gt;
&lt;td&gt;Empty (retain default settings)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click the &lt;strong&gt;Container Create Options&lt;/strong&gt; tab and specify the options in the editor as follows.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"HostConfig"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; 
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;   
        &lt;/span&gt;&lt;span class="nl"&gt;"Binds"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"/usr/local/lib/libm3.so.1.0.1:/usr/local/lib/libm3.so.1.0.1"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"Devices"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"PathOnHost"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/dev/m3io"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"PathInContainer"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/dev/m3io"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"CgroupPermissions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rwm"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"PathOnHost"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/dev/m3sysctl"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"PathInContainer"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/dev/m3sysctl"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"CgroupPermissions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rwm"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"PathOnHost"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/dev/m3cpu"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"PathInContainer"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/dev/m3cpu"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"CgroupPermissions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rwm"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"PathOnHost"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/dev/m3mcom"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"PathInContainer"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/dev/m3mcom"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"CgroupPermissions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rwm"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"PathOnHost"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/dev/m3dev"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"PathInContainer"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/dev/m3dev"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"CgroupPermissions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rwm"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"PathOnHost"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/dev/m3ras"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"PathInContainer"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/dev/m3ras"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"CgroupPermissions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rwm"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"PathOnHost"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/dev/m3wdt"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"PathInContainer"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/dev/m3wdt"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"CgroupPermissions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"rwm"&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foy7l2pi00qkvhs2vefn3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foy7l2pi00qkvhs2vefn3.png" alt="CreateOptions" width="800" height="477"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For more information about Container Create Options, refer to the &lt;a href="https://learn.microsoft.com/en-us/azure/iot-edge/how-to-use-create-options?view=iotedge-1.4" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For information about the settings that can be configured, refer to the &lt;a href="https://docs.docker.com/engine/api/v1.32/#tag/Container/operation/ContainerCreate" rel="noopener noreferrer"&gt;Docker documentation&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The library information is specified in the &lt;code&gt;Binds&lt;/code&gt; tag and the device information is specified in the &lt;code&gt;Devices&lt;/code&gt; tag.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click the &lt;strong&gt;Module Twin Settings&lt;/strong&gt; tab and specify the settings as follows:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ert3add2c"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; 
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"interval_sec"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpotvuargqhzfpxv0uzcp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpotvuargqhzfpxv0uzcp.png" alt="Interval" width="800" height="720"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, we configure an interval of 2 seconds. This configures the Python module to collect data from all the channels of the Analog Input module in a time interval of two seconds.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Apply&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click the &lt;strong&gt;Routes&lt;/strong&gt; tab and configure the details as described in the following table.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;NAME&lt;/th&gt;
&lt;th&gt;VALUE&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;yourModuleToIoTHub&lt;/td&gt;
&lt;td&gt;FROM /messages/modules/&lt;code&gt;&amp;lt;yourModule&amp;gt;&lt;/code&gt;/outputs/* INTO $upstream&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs71vodb6fm6utjgjls35.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs71vodb6fm6utjgjls35.png" alt="Routes" width="800" height="305"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here, we configure the routes to send data from the Python IoT Edge data collection module to the IoT Hub.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If the routes configured in the &lt;a href="https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d#deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime"&gt;previous article&lt;/a&gt; are displayed, remove them by clicking the &lt;strong&gt;Delete&lt;/strong&gt; icon on the right.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Review + create&lt;/strong&gt; and verify the configuration information.&lt;/p&gt;

&lt;p&gt;In the upper-left corner of the screen, the message "Validation passed" is displayed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After verifying the configuration information, in the lower-left corner of the page, click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Device settings&lt;/em&gt; page appears, and the module list with the status of each module is displayed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5zs1gql74n373pkqmqob.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5zs1gql74n373pkqmqob.png" alt="ModuleStatus" width="800" height="485"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Verify the following information:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;IoT Edge Runtime Response&lt;/strong&gt; must be displayed as &lt;code&gt;200 - OK&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;The runtime status of all the modules ([edgeAgent], [edgeHub], and the module you deployed[yourModule]) must be displayed as &lt;code&gt;running&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: It usually takes some time to view the status of the deployment. If any of the above conditions are not satisfied, click &lt;strong&gt;Refresh&lt;/strong&gt; to view the latest information.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Verify module operation
&lt;/h2&gt;

&lt;p&gt;To verify the module operation we must observe the following outcomes:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;View telemetry data in IoT Hub&lt;/p&gt;

&lt;p&gt;Verify that the telemetry data sent by the Python IoT Edge data collection module is received in the IoT Hub.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;View changes in operation corresponding to Module twin updates&lt;/p&gt;

&lt;p&gt;To verify that updates to the module twin are reflected in the messages received at the IoT Hub, we perform the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Increase the frequency of data collection and observe the corresponding change at the IoT Hub.&lt;/li&gt;
&lt;li&gt;Set the frequency of data collection to zero. This stops data transmission.&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;h3&gt;
  
  
  View telemetry data
&lt;/h3&gt;

&lt;p&gt;You can verify the operation of the Python IoT Edge data collection module in the same way described in the &lt;a href="https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d#verifying-module-operation"&gt;previous article&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If the format of the telemetry data received is as follows, the Python IoT Edge data collection module is running properly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"messageID"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2034&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"deviceID"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"test_ert3_f3rp70"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"datetime"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2021-01-26T03:50:58.445146Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"ch1"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;-1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"ch2"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"ch3"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"ch4"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"ch5"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"ch6"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"ch7"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"ch8"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"enqueuedTime"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2021-01-26T03:50:58.476Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"properties"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: As an 8-channel F3AD08 is used, data from 8 channels is transmitted.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Update module twin and verify operation
&lt;/h3&gt;

&lt;p&gt;We can update the module twin from Azure portal and verify that the module operation changes accordingly.&lt;/p&gt;

&lt;p&gt;Follow these steps to update the module twin:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;Azure portal&lt;/a&gt; and navigate to the IoT Hub that you created.&lt;/li&gt;
&lt;li&gt;On the left pane, under the &lt;strong&gt;Device management&lt;/strong&gt; section, click &lt;strong&gt;IoT Edge&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From the device IDs that are displayed, select the ID of the device on which you want to deploy the module.&lt;/p&gt;

&lt;p&gt;The device information appears.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Set modules&lt;/strong&gt;, select the IoT Edge module that you want to modify.&lt;/p&gt;

&lt;p&gt;The IoT Edge module screen appears.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click the &lt;strong&gt;Module Twin Settings&lt;/strong&gt; tab.&lt;/p&gt;

&lt;p&gt;The module twin information is displayed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Update the module twin information in the text box as necessary. Verify the updated information and if there are no issues, click &lt;strong&gt;Review + Create&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Modify the frequency of data collection&lt;/p&gt;

&lt;p&gt;Update the value of &lt;code&gt;interval_sec&lt;/code&gt; to change the frequency of data collection. For example, we have updated the data collection frequency to 5 seconds as follows:&lt;br&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ert3add2c"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"interval_sec"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Stop data collection&lt;/p&gt;

&lt;p&gt;If the value of &lt;code&gt;interval_sec&lt;/code&gt; is set to zero, then data collection is stopped and messages will not be sent to IoT Hub.&lt;br&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="w"&gt;     &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
     &lt;/span&gt;&lt;span class="nl"&gt;"ert3add2c"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
         &lt;/span&gt;&lt;span class="nl"&gt;"interval_sec"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The module is created and deployed with the updates. After the deployment is complete, verify the operation as follows:&lt;br&gt;
     1. If you increased or decreased the data collection frequency, the telemetry data received at the IoT Hub changes accordingly.&lt;br&gt;
     2. If you stopped data collection, no messages are received at the IoT Hub.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If you want to restart data collection, change the value of &lt;code&gt;interval_sec&lt;/code&gt; to any value greater than 1.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The data from the Analog Input module is received by the Python module deployed in the e-RT3 Plus device. Subsequently, the same data can be viewed in Azure IoT Hub, proving that the Python module created is functioning as expected. In the next article, we will create an IoT Edge module that writes data into an analog output module that is connected to the e-RT3 Plus device.&lt;/p&gt;
&lt;h2&gt;
  
  
  Appendix
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Image URI
&lt;/h3&gt;

&lt;p&gt;To obtain the image URI, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;Azure Portal&lt;/a&gt; and navigate to the Container Registry.&lt;/li&gt;
&lt;li&gt;On the left pane, under the &lt;strong&gt;Services&lt;/strong&gt; category, click &lt;strong&gt;Repositories&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;From the list of repositories displayed, click the ID of the repository that you want to deploy.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From the tags that are displayed, click the tag that you want to deploy.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The tags are displayed in the format &lt;code&gt;&amp;lt;version_number&amp;gt;-&amp;lt;target_device&amp;gt;&lt;/code&gt;. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Confirm that the target device in the tag is displayed as &lt;code&gt;arm32v7&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The repository details are displayed. In the &lt;strong&gt;Docker pull command&lt;/strong&gt; box, the content displayed after &lt;code&gt;docker pull&lt;/code&gt; is the image URI.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F11r7hqxqdc1fik6p6j4p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F11r7hqxqdc1fik6p6j4p.png" alt="ImageURI" width="800" height="301"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The image URI is in the format  &lt;code&gt;&amp;lt;registry name&amp;gt;.azurecr.io/&amp;lt;module name&amp;gt;:&amp;lt;tag&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Python code details
&lt;/h3&gt;

&lt;p&gt;The flow of the code is explained as comments in the Python code. Here, we describe additional details:&lt;/p&gt;
&lt;h4&gt;
  
  
  Libraries
&lt;/h4&gt;

&lt;p&gt;The following libraries are imported:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;ctypes&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;ctypes&lt;/code&gt;  library provides C compatible data types, and allows calling functions in DLLs or shared libraries. Since the functions of the e-RT3 Plus device run on C language, we import the &lt;code&gt;ctypes&lt;/code&gt; library.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight python"&gt;&lt;code&gt;    &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ctypes&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;IoTHubModuleClient&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;IoTHubModuleClient&lt;/code&gt; library is part of the &lt;a href="https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-sdks" rel="noopener noreferrer"&gt;Azure IoT Hub SDK&lt;/a&gt;. It is a Synchronous module client that connects to an Azure IoT Hub or Azure IoT Edge instance. For more information on the &lt;code&gt;IoTHubModuleClient&lt;/code&gt; library, click &lt;a href="https://learn.microsoft.com/en-us/python/api/azure-iot-device/azure.iot.device.iothubmoduleclient?view=azure-python" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;azure.iot.device&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;IoTHubModuleClient&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;Message&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;Message&lt;/code&gt; library is part of the &lt;a href="https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-sdks" rel="noopener noreferrer"&gt;Azure IoT Hub SDK&lt;/a&gt;. It represents a message to or from IoTHub. For more information on the &lt;code&gt;Message&lt;/code&gt; library, click &lt;a href="https://learn.microsoft.com/en-us/python/api/azure-iot-device/azure.iot.device.message?view=azure-python" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;azure.iot.device&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Message&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;&lt;p&gt;The library to access the Analog Input module is not included in the Python IoT Edge data collection module, instead it is bound to the CPU module (host) library and used.&lt;/p&gt;&lt;/li&gt;

&lt;/ol&gt;

&lt;h4&gt;
  
  
  Definitions
&lt;/h4&gt;

&lt;p&gt;The following definition provides the value of the symbolic link of e-RT3 Plus within the Python IoT Edge data collection module.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;M3LIB_PATH&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;/usr/local/lib/libm3.so.1&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  e-RT3 Plus functions
&lt;/h4&gt;

&lt;p&gt;The Python module uses the following e-RT3 Plus functions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;getM3IoName&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This function obtains the module ID by specifying the unit and slot ID.&lt;/p&gt;

&lt;p&gt;The function definition is as follows:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;char&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nf"&gt;getM3IoName&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;unit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;slot&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;readM3IoRegister&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This function reads the data from an I/O register by specifying the unit, slot, channel from which you want to read data, number of channels from which you want to read, and data storage position.&lt;/p&gt;

&lt;p&gt;The function definition is as follows:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;readM3IoRegister&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;unit&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;slot&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;pos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;unsigned&lt;/span&gt; &lt;span class="kt"&gt;short&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;
  
  
  Other functions
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;subprocess.run([LDCONFIGEXEC])&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This function is used for binding &lt;code&gt;/usr/local/lib/libm3.so.1.0.1&lt;/code&gt; of F3RP70-2L to &lt;code&gt;/usr/local/lib/libm3.so.1.0.1&lt;/code&gt; of Python IoT Edge data collection module.&lt;/p&gt;

&lt;p&gt;It generates a symbolic link of the library and is invoked at the beginning of the main function to enable the usage of the library within e-RT3 Plus when deploying the Python IoT Edge data collection module.&lt;/p&gt;

&lt;h4&gt;
  
  
  Payload format
&lt;/h4&gt;

&lt;p&gt;The payload for sending data is created in the following format:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nl"&gt;"body"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"messageID"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"deviceID"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"{deviceID}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"datetime"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2020-01-01T00:00:00.000Z"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ch1"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;123&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ch2"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;234&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ch3"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;345&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ch4"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;456&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ch5"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;567&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ch6"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;678&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ch7"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;789&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ch8"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;890&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;messageID&lt;/code&gt; is the ID of the message. The message ID is generated as a sequence of numbers starting from 1,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;deviceID&lt;/code&gt; refers to the ID of the target device on which the Python IoT Edge data collection module is deployed,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;datetime&lt;/code&gt; refers to the time at which the CPU module acquires the data,&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ch1&lt;/code&gt; - &lt;code&gt;ch8&lt;/code&gt; refers to the data acquired from each channel.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.yokogawa.com/solutions/products-and-services/control/control-devices/real-time-os-based-machine-controllers/#Overview" rel="noopener noreferrer"&gt;Real-time OS controller e-RT3 Plus F3RP70-2L&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://devicecatalog.azure.com/" rel="noopener noreferrer"&gt;Azure Certified Device catalog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-web-apps" rel="noopener noreferrer"&gt;Visualize real-time sensor data from your Azure IoT hub in a web application&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-live-data-visualization-in-power-bi" rel="noopener noreferrer"&gt;Tutorial: Visualize real-time sensor data from Azure IoT Hub using Power BI&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-develop-for-linux?view=iotedge-1.4" rel="noopener noreferrer"&gt;Tutorial: Develop IoT Edge modules with Linux containers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-python-module?view=iotedge-1.4" rel="noopener noreferrer"&gt;Tutorial: Develop and deploy a Python IoT Edge module using Linux containers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-sdks" rel="noopener noreferrer"&gt;Summary and usage methods of Azure IoT Hub SDK&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>azureiot</category>
      <category>edge</category>
      <category>runtime</category>
      <category>python</category>
    </item>
    <item>
      <title>Deploying a sample Python module on an Edge Device installed with Azure IoT Edge Runtime</title>
      <dc:creator>Yokogawa-BrigitteZacharia</dc:creator>
      <pubDate>Tue, 25 Oct 2022 05:48:20 +0000</pubDate>
      <link>https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d</link>
      <guid>https://dev.to/yokogawa-yts_india/deploying-a-sample-python-module-on-an-edge-device-installed-with-azure-iot-edge-runtime-164d</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Azure IoT Runtime enables you to collect information and execute commands on Edge devices remotely. When installed on e-RT3 Plus, the features of both e-RT3 Plus and Azure Runtime Environment can be utilized to perform various operations.&lt;/p&gt;

&lt;p&gt;This is part one of a five-part series that demonstrates how to use Azure Runtime Environment with e-RT3 Plus. In this article, we explore how to deploy a sample Python module on e-RT3 Plus and Raspberry Pi 4 Model B and update the values from Azure Portal.&lt;/p&gt;

&lt;p&gt;We deploy two IoT Modules; a Simulated Temperature Sensor module that generates sample temperature values, and a Python module that uploads the temperature values to the IoT Hub whenever the temperature value crosses a threshold. We can view the uploaded temperature values on Visual Studio Code.&lt;/p&gt;

&lt;p&gt;This demonstration is based on two Microsoft tutorials:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-develop-for-linux?view=iotedge-1.4" rel="noopener noreferrer"&gt;Develop IoT Edge modules with Linux containers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-python-module?view=iotedge-1.4" rel="noopener noreferrer"&gt;Develop and deploy a Python IoT Edge module using Linux containers&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;However, it is customized to show the procedure for the ARM 32-bit device.&lt;/p&gt;

&lt;h2&gt;
  
  
  Environment
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Supported devices（OS)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;e-RT3 Plus F3RP70-2L（Ubuntu 18.04 32-bit）&lt;/li&gt;
&lt;li&gt;Raspberry Pi 4 Model B （Ubuntu Server 18.04 32-bit）&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code&gt;armhf&lt;/code&gt; architecture package runs on these devices.&lt;br&gt;
The modules are developed on a computer installed with Windows 10.&lt;/p&gt;
&lt;h2&gt;
  
  
  Workflow
&lt;/h2&gt;

&lt;p&gt;The following figure shows the workflow for deploying a sample python module on e-RT3 Plus using Azure IoT runtime.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsz7m52docz0cckmp07qe.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsz7m52docz0cckmp07qe.jpg" alt="workflow" width="238" height="952"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Azure Runtime environment must be installed on the e-RT3 Plus or the Edge device that you are using. For more information about deploying Azure Runtime Environment on e-RT3 Plus, refer to &lt;a href="https://dev.to/yokogawa-yts_india/deploying-azure-runtime-environment-on-e-rt3-plus-4dlj"&gt;Deploying Azure Runtime Environment on e-RT3 Plus&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The following software must be installed and configured before you start creating the sample Python module.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Container Engine (Docker Desktop)&lt;/li&gt;
&lt;li&gt;Python&lt;/li&gt;
&lt;li&gt;Visual Studio Code&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Setting up the Container Engine
&lt;/h3&gt;

&lt;p&gt;You must set up a container engine on the computer in which you want to develop the Python module. In this demonstration, we install the Docker Desktop container engine.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If your computer is in an environment that requires proxies to connect to the internet, you must configure the Proxy settings.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Follow these steps to set up Docker Desktop on your computer:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Download &lt;a href="https://hub.docker.com/editions/community/docker-ce-desktop-windows/" rel="noopener noreferrer"&gt;Docker Desktop&lt;/a&gt;. For Windows Home and other operating systems, select the corresponding OS from the menu on the left and continue the installation. Ensure that you enable Hyper-V backend during installation.&lt;/p&gt;

&lt;p&gt;For more information on how to install Docker Desktop, refer to &lt;a href="https://docs.docker.com/desktop/install/windows-install/" rel="noopener noreferrer"&gt;Install Docker Desktop on Windows&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Ensure that your computer meets the system requirements specified on &lt;a href="https://docs.docker.com/desktop/install/windows-install/" rel="noopener noreferrer"&gt;Install Docker Desktop on Windows&lt;/a&gt; before installing Docker Desktop.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After the installation is complete, launch Docker Desktop from the Start menu.&lt;br&gt;
A notification appears, indicating that Docker Desktop is running and the container engine setup is complete. Ensure that Docker Desktop is successfully launched before proceeding.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;As we are using a Linux container, ensure that the notification "Linux Containers Hyper-V backend is launching..." is displayed.&lt;/li&gt;
&lt;li&gt;Docker Desktop may fail to launch if the computer load is high. In this case, retry launching.&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Installing Python
&lt;/h3&gt;

&lt;p&gt;Follow these steps to install Python on your computer:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Download the &lt;a href="https://www.python.org/downloads/" rel="noopener noreferrer"&gt;Python installer&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: To maintain compatibility with the Python module template, download Python 3.7.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Open the installer and click &lt;strong&gt;Install Now&lt;/strong&gt;.&lt;br&gt;
Python is installed on your computer.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: In the installer dialog box, select the &lt;strong&gt;Add Python 3.7 to PATH&lt;/strong&gt; check box.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Setting up Visual Studio Code
&lt;/h3&gt;

&lt;p&gt;Visual Studio Code is used for developing the IoT Edge module.&lt;/p&gt;

&lt;p&gt;Follow these steps to install and configure Visual Studio Code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Download the installer for Visual Studio Code from the &lt;a href="https://code.visualstudio.com/" rel="noopener noreferrer"&gt;official website&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Ensure that you select a version that is compatible with your computer.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Start the installer and follow the steps in the installation wizard to complete the installation.&lt;br&gt;
If the installation is completed successfully, a message is displayed indicating the same.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To install Azure IoT Tools and Python extension features, on the left pane, click &lt;strong&gt;Extensions&lt;/strong&gt; and perform the following operations:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;In the search bar, type &lt;code&gt;Azure IoT Tools&lt;/code&gt; and click &lt;strong&gt;Install&lt;/strong&gt; on the corresponding search result.&lt;/p&gt;

&lt;p&gt;Azure IoT Tools extension is downloaded and installed on Visual Studio Code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fni1zvmh355qhy9zvu1bb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fni1zvmh355qhy9zvu1bb.png" alt="01_IntsallAzureExtension" width="386" height="438"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the search bar, type &lt;code&gt;Python&lt;/code&gt; and click &lt;strong&gt;Install&lt;/strong&gt; on the corresponding search result.&lt;/p&gt;

&lt;p&gt;Python extension is downloaded and installed on Visual Studio Code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpj5rom2bk8rcrcfad1u1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpj5rom2bk8rcrcfad1u1.png" alt="02_InstallPythonExtension" width="400" height="370"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To sign in to Azure, in the Command Palette, type &lt;code&gt;Azure: Sign In&lt;/code&gt; and select the corresponding search result.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fus4ndqrrixwdvcf5yat8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fus4ndqrrixwdvcf5yat8.png" alt="03_SignIn" width="612" height="137"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Follow the instructions displayed to sign in.&lt;/p&gt;

&lt;p&gt;If you have successfully signed in, your account information is displayed at the bottom of the Visual Studio Code window.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fleu8adcka7sud46j545g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fleu8adcka7sud46j545g.png" alt="04_Accountdetails" width="782" height="326"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To select the IoT Hub, in the Command Palette, type &lt;code&gt;Azure IoT Hub: Select IoT Hub&lt;/code&gt; and select the corresponding search result.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fewzd8ysmstg8pot1vx0q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fewzd8ysmstg8pot1vx0q.png" alt="05_SelectIoTHub" width="620" height="430"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Follow the instructions displayed and select &lt;strong&gt;Azure subscription&lt;/strong&gt; and &lt;strong&gt;IoT Hub&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flj7xebzrlps3ajaz9d57.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flj7xebzrlps3ajaz9d57.png" alt="06_SelectSubscription" width="622" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhe0c9dzetjhvarn3qezs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhe0c9dzetjhvarn3qezs.png" alt="07_iotHub" width="619" height="105"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To view the IoT Hub and connected devices, on the left pane, select the file explorer and expand &lt;strong&gt;AZURE IOT HUB&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The IoT Hub is displayed and the connected devices are listed under the Devices section.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq3sfarjgshmstlgyz2zh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq3sfarjgshmstlgyz2zh.png" alt="08_viewDevices" width="326" height="508"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Creating and deploying a module
&lt;/h2&gt;

&lt;p&gt;To create, deploy and test an IoT Edge module, you must complete the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create container registry&lt;/li&gt;
&lt;li&gt;Create project&lt;/li&gt;
&lt;li&gt;Add registry credentials&lt;/li&gt;
&lt;li&gt;Select target architecture&lt;/li&gt;
&lt;li&gt;Update module with custom code&lt;/li&gt;
&lt;li&gt;Build and push module&lt;/li&gt;
&lt;li&gt;Deploy Simulated Temperature Sensor module&lt;/li&gt;
&lt;li&gt;Deploy Python module&lt;/li&gt;
&lt;li&gt;Verify the module operation&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Creating container registry
&lt;/h3&gt;

&lt;p&gt;To store the docker images, any registry that is compatible with docker can be used. In this demonstration, we use the Azure Container Registry.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Azure Container Registry is a paid service. For the pricing details, click &lt;a href="https://azure.microsoft.com/en-us/pricing/details/container-registry/" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Follow these steps to create a container registry:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Sign-in to &lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;Azure Portal&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;In the upper-left corner of the page, click &lt;strong&gt;+ Create a resource&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From the left panel, select &lt;strong&gt;Containers&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fszi2tzkcss5o3zzo3pqc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fszi2tzkcss5o3zzo3pqc.png" alt="09_ContainerRegistry" width="613" height="787"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;From the list of displayed services, select &lt;strong&gt;Container Registry&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Information&lt;/strong&gt; tab, specify the following settings information:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Subscription&lt;/li&gt;
&lt;li&gt;Resource group&lt;/li&gt;
&lt;li&gt;Registry name&lt;/li&gt;
&lt;li&gt;Location&lt;/li&gt;
&lt;li&gt;SKU
&amp;gt;&lt;strong&gt;Note&lt;/strong&gt;: SKU must be set to &lt;code&gt;Basic&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click the &lt;strong&gt;Review + create&lt;/strong&gt; tab, and verify the setting information.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the settings are configured correctly, click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Creating a new project
&lt;/h3&gt;

&lt;p&gt;Follow these steps to create a new Edge IoT solution in Visual Studio Code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Visual Studio Code.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the Command Palette, type &lt;code&gt;Azure IoT Edge: New IoT Edge solution&lt;/code&gt; and select the same from the search results.&lt;/p&gt;

&lt;p&gt;The folder selection box appears.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Specify the location where you want to save the project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the &lt;strong&gt;Provide a Solution Name&lt;/strong&gt; box that appears in the Command Palette, specify a solution name.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;From the Select Module Template drop-down list that appears in the Command Palette, specify &lt;strong&gt;Python Module&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Provide a Module Name&lt;/strong&gt; box that appears in the Command Palette, specify a name for the module.&lt;/p&gt;

&lt;p&gt;The module name specified is reflected within the template and is considered as the module name in IoT Edge. Here, we have specified the name &lt;code&gt;PythonModule&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The module name of IoT Edge can also be modified individually before building the images.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Provide Docker Image Repository&lt;/strong&gt; box that appears in the Command Palette, specify the address of the Container Registry login server.&lt;/p&gt;

&lt;p&gt;By default &lt;code&gt;localhost:5000&lt;/code&gt; appears.&lt;/p&gt;

&lt;p&gt;To obtain the login server information, open Azure Portal and navigate to the Container registry that you created in previous step. On the left pane, under the &lt;strong&gt;Settings&lt;/strong&gt; section, select &lt;strong&gt;Access keys&lt;/strong&gt;. The login server information is displayed on the right.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Ensure to save this information as it is required at a later stage.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxb4gvmmpa559klfi7z04.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxb4gvmmpa559klfi7z04.png" alt="10_AccessKeys" width="800" height="294"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1qpdq7uatso1azrofrht.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1qpdq7uatso1azrofrht.png" alt="13_AccessKeys" width="800" height="350"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Copy the Login server information &lt;code&gt;&amp;lt;registry_name&amp;gt;.azurecr.io&lt;/code&gt; and paste it in the Command Palette in the format &lt;code&gt;&amp;lt;registry_name&amp;gt;.azurecr.io/&amp;lt;module_name&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzg7goakcl3r4unxb1lfa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzg7goakcl3r4unxb1lfa.png" alt="11_ModuleName" width="635" height="103"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The project template is created with the folder structure as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjpxynm9yc5bnoo1neea2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjpxynm9yc5bnoo1neea2.png" alt="12_ProjectFolderStructure" width="305" height="524"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Adding registry credentials
&lt;/h3&gt;

&lt;p&gt;Follow these steps to add the registry credentials:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;To add the registry credentials, on the left pane, select the file explorer and open the &lt;code&gt;.env&lt;/code&gt; file under the PythonModule folder.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;.env
CONTAINER_REGISTRY_USERNAME_&amp;lt;registry name&amp;gt;&lt;span class="o"&gt;=&lt;/span&gt;
CONTAINER_REGISTRY_PASSWORD_&amp;lt;registry name&amp;gt;&lt;span class="o"&gt;=&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;In the &lt;code&gt;CONTAINER_REGISTRY_USERNAME_&amp;lt;registry name&amp;gt;&lt;/code&gt; and &lt;code&gt;CONTAINER_REGISTRY_PASSWORD_&amp;lt;registry name&amp;gt;&lt;/code&gt; fields, specify the username and password, i.e.: the Access keys of the Container Registry.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;.env

CONTAINER_REGISTRY_USERNAME_&amp;lt;registry name&amp;gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;username&amp;gt;
CONTAINER_REGISTRY_PASSWORD_&amp;lt;registry name&amp;gt;&lt;span class="o"&gt;=&lt;/span&gt;&amp;lt;password or password2&amp;gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F28vsz4ro7oqn6wl5p2wt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F28vsz4ro7oqn6wl5p2wt.png" alt="13_AccessKeys" width="800" height="350"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The password provided can be either password or password2.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Selecting target architecture
&lt;/h3&gt;

&lt;p&gt;Follow these steps to select the target architecture:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Click the current architecture at the bottom of the Visual Studio Code window.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Select Azure IoT Edge Solution Default Platform&lt;/strong&gt; box appears in the Command Palette.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4b5dk5jhlisdca2myxnm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4b5dk5jhlisdca2myxnm.png" alt="14_targetArchitecture" width="616" height="166"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Since we are using the &lt;code&gt;armhf&lt;/code&gt; architecture, select &lt;code&gt;arm32v7&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The current architecture changes to &lt;code&gt;arm32v7&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If the current architecture is not displayed at the bottom of the window, type &lt;code&gt;Azure IoT Edge: Set Default Target Platform for Edge Solution&lt;/code&gt; and select the same.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftexo7rtb3kvy35jktfb4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftexo7rtb3kvy35jktfb4.png" alt="14_1_targetArchitecture" width="614" height="117"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Updating module with custom code
&lt;/h3&gt;

&lt;p&gt;Rewrite the contents of &lt;code&gt;main.py&lt;/code&gt; and &lt;code&gt;deployment.template.json&lt;/code&gt; by following the steps in &lt;a href="https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-python-module?view=iotedge-1.4#update-the-module-with-custom-code" rel="noopener noreferrer"&gt;Update Modules with Custom Code&lt;/a&gt;, and save the file.&lt;/p&gt;

&lt;p&gt;The Python module routes temperature values to the IoT Hub only if the value exceeds the defined threshold.&lt;/p&gt;

&lt;h3&gt;
  
  
  Building and pushing the module
&lt;/h3&gt;

&lt;p&gt;Follow these steps to build the created module and push the image to Container Registry:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;From the menu bar, select &lt;strong&gt;View&lt;/strong&gt; &amp;gt; &lt;strong&gt;Terminal&lt;/strong&gt; to display the terminal pane.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxclpp20mi6oguxwf26p7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxclpp20mi6oguxwf26p7.png" alt="15_Terminal" width="489" height="623"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the following command in the terminal to log in to the Container Registry.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;docker login &lt;span class="nt"&gt;-u&lt;/span&gt; &amp;lt;username&amp;gt; &lt;span class="nt"&gt;-p&lt;/span&gt; &amp;lt;password or password2&amp;gt; &amp;lt;login server&amp;gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If the required proxy settings are not configured then you will not be able to log into the Container Registry.&lt;br&gt;
For details about proxy settings, refer to Proxy settings.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the left pane, select File Explorer, right-click &lt;code&gt;deployment.template.json&lt;/code&gt;, and select &lt;strong&gt;Build and Push IoT Edge Solution&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The module is built and if there are no errors the image is pushed to the Container Registry.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F79qgeula3cyzx6f1upbs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F79qgeula3cyzx6f1upbs.png" alt="16_BuildandPush" width="469" height="563"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To verify that the images are pushed to the Container Registry, perform these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Azure Portal.&lt;/li&gt;
&lt;li&gt;Navigate to the Container Registry.&lt;/li&gt;
&lt;li&gt;On the left pane, click &lt;strong&gt;Repositories&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The repositories page appears, displaying a list of images.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Verify that your image is present in this list.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2g1hhfvfv5246bk38lhi.png" alt="17_imageList" width="800" height="393"&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;h3&gt;
  
  
  Deploying Simulated Temperature Sensor module
&lt;/h3&gt;

&lt;p&gt;The Simulated Temperature Sensor module generates sample temperature readings periodically which increase in value over time. This module is readily available for deployment in Azure Marketplace.&lt;/p&gt;

&lt;p&gt;We will deploy this module and route the generated temperature values as input to the Python module.&lt;/p&gt;

&lt;p&gt;Follow these steps to deploy the Simulated Temperature Sensor:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;Azure Portal&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Navigate to the IoT Hub that you created.&lt;/li&gt;
&lt;li&gt;From the left pane, under the &lt;strong&gt;Device management&lt;/strong&gt; section, click &lt;strong&gt;IoT Edge&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the right pane, click the device ID of the target device on which you want to deploy the module.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F77xoh44djkfhq1ncmpeq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F77xoh44djkfhq1ncmpeq.png" alt="SetModules" width="794" height="161"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Set modules&lt;/strong&gt; tab.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Set modules on device&lt;/em&gt; page appears.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6r4swp145qpsvvylyc3h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6r4swp145qpsvvylyc3h.png" alt="addmoduleMarketplace" width="800" height="372"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;IoT Edge Modules&lt;/strong&gt; section, click the &lt;strong&gt;Add&lt;/strong&gt; drop-down menu, and select &lt;strong&gt;Marketplace Module&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;IoT Edge Module Marketplace&lt;/em&gt; page appears.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6o24u6rntuyjv3ygrdlc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6o24u6rntuyjv3ygrdlc.png" alt="marketplace" width="625" height="522"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the search box, type &lt;code&gt;simulated temperature sensor&lt;/code&gt; and select the same from the search results.&lt;/p&gt;

&lt;p&gt;The module is added to the IoT Edge Modules section with the Desired Status as &lt;code&gt;running&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyw4vw6ly7wgpe4e2vwve.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyw4vw6ly7wgpe4e2vwve.png" alt="modulerunning" width="800" height="199"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click the &lt;strong&gt;Review + create&lt;/strong&gt; tab.&lt;/p&gt;

&lt;p&gt;The deployment settings in the standard JSON format is displayed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the upper-left corner of the page, ensure that the message &lt;code&gt;Validation passed&lt;/code&gt; is displayed and then click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F51k2v0zs1ed063rcui93.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F51k2v0zs1ed063rcui93.png" alt="SetModules" width="800" height="406"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The device details page appears, displaying the deployment status of the Simulated Temperature Sensor on the &lt;strong&gt;Modules&lt;/strong&gt; tab.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If the Edge device is in an environment that requires proxies to connect to the internet, the telemetry sent to IoT Hub may be blocked and not delivered even when the module is correctly deployed and working.&lt;br&gt;
In such cases, you must configure the Proxy settings for &lt;code&gt;$edgeHub&lt;/code&gt; module. For more information about the proxy settings refer to &lt;a href="https://learn.microsoft.com/en-us/azure/iot-edge/how-to-configure-proxy-support?view=iotedge-2018-06#azure-portal" rel="noopener noreferrer"&gt;Configure proxy support&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Deploying Python module
&lt;/h3&gt;

&lt;p&gt;After pushing the images to the Container Registry, we must deploy it on the Edge device.&lt;/p&gt;

&lt;p&gt;Follow these steps to deploy the images from Azure Portal:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;Azure Portal&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Navigate to the IoT Hub that you created.&lt;/li&gt;
&lt;li&gt;From the left pane, under the &lt;strong&gt;Device management&lt;/strong&gt; section, click &lt;strong&gt;IoT Edge&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;On the right pane, click the device ID of the target device on which you want to deploy the module.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Set modules&lt;/strong&gt; tab.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm7x5ahkb2i2eqzcuflty.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm7x5ahkb2i2eqzcuflty.png" alt="18_SetModules" width="800" height="227"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Modules&lt;/strong&gt; tab, specify the details mentioned in the following table.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting items of module&lt;/th&gt;
&lt;th&gt;Information to be entered&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;NAME&lt;/td&gt;
&lt;td&gt;Registry name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ADDRESS&lt;/td&gt;
&lt;td&gt;Login server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;USERNAME&lt;/td&gt;
&lt;td&gt;User name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;PASSWORD&lt;/td&gt;
&lt;td&gt;Password or password2&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm9zy8gx9nxz7fxn96hdf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm9zy8gx9nxz7fxn96hdf.png" alt="19_Modules" width="800" height="216"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To obtain the Registry name, Login Server details, username and password, refer to step 7 in Creating a new project.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To configure the settings of the IoT Edge module, click &lt;strong&gt;+Add&lt;/strong&gt; and then select &lt;strong&gt;IoT Edge Module&lt;/strong&gt; from the drop-down list.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjvdr2ax46g8mhr1yu85o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjvdr2ax46g8mhr1yu85o.png" alt="20_IoTEdgeModule" width="800" height="164"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the parameters of the IoT Edge module as described in the following table and click &lt;strong&gt;Add&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting item of module&lt;/th&gt;
&lt;th&gt;Information to be entered&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;IoT Edge Module Name&lt;/td&gt;
&lt;td&gt;The module name&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Image URI&lt;/td&gt;
&lt;td&gt;Image URI  obtained from the repository of Container Registry. For information about how to obtain the image URI, refer to Image URI.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Restart Policy&lt;/td&gt;
&lt;td&gt;Always (retain default settings)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Desired Status&lt;/td&gt;
&lt;td&gt;Running (retain default settings)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click the &lt;strong&gt;Routes&lt;/strong&gt; tab and configure the details as described in the following table.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;NAME&lt;/th&gt;
&lt;th&gt;VALUE&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;PythonModuleToIoTHub&lt;/td&gt;
&lt;td&gt;FROM /messages/modules/PythonModule/outputs/* INTO $upstream&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sensorToPythonModule&lt;/td&gt;
&lt;td&gt;FROM /messages/modules/SimulatedTemperatureSensor/outputs/temperatureOutput INTO BrokeredEndpoint(‘/modules/PythonModule/inputs/input1’)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F70z1hwov672xuc06kt9g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F70z1hwov672xuc06kt9g.png" alt="22_SetModules" width="800" height="233"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Review + create&lt;/strong&gt; and verify the configuration information.&lt;/p&gt;

&lt;p&gt;In the upper-left corner of the screen, the message "Validation passed" is displayed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9nmta6z378c5uv4ukn11.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9nmta6z378c5uv4ukn11.png" alt="23_reviewCreate1" width="800" height="523"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdte7dtc66ymq5gva7num.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdte7dtc66ymq5gva7num.png" alt="24_reviewCreate2" width="624" height="230"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5fvpg1qfe8s1gxchszv8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5fvpg1qfe8s1gxchszv8.png" alt="25_reviewCreate3" width="624" height="325"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After verifying the configuration information, in the lower-left corner of the page, click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Device settings&lt;/em&gt; page appears, and the module list is displayed. It usually takes some time to complete the deployment.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F01ptvi7bas6in2qqslwa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F01ptvi7bas6in2qqslwa.png" alt="26_ModuleList" width="800" height="501"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Refresh&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The Module list is updated and you can see the module that you deployed to the Edge device added to the Modules list.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Verifying module operation
&lt;/h3&gt;

&lt;p&gt;After viewing the telemetry messages received from the Edge device in the IoT Hub, we can confirm that the deployed module is working.&lt;/p&gt;

&lt;p&gt;In this section, we describe how you can verify module operation by using &lt;strong&gt;Visual Studio Code&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Follow these steps to verify the reception of telemetry messages at the IoT Hub:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Open the project created in Creating a new project in Visual Studio Code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Felbun52101x7i6w36b17.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Felbun52101x7i6w36b17.png" alt="27_StartMonitoring" width="498" height="569"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the left pane, right-click your Azure IoT Device, and select &lt;code&gt;Start Monitoring Built-in Event Endpoint&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The messages received at the IoT Hub are displayed in the &lt;strong&gt;OUTPUT&lt;/strong&gt; tab.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvwi5tihyahkrrtafbcao.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvwi5tihyahkrrtafbcao.png" alt="28_receivedOutput" width="800" height="355"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To stop receiving messages, in the lower-left corner of the window, click &lt;strong&gt;Stop Monitoring built-in event endpoint&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzcgon9k8m804ikt61xx5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzcgon9k8m804ikt61xx5.png" alt="29_StopMonitoring" width="618" height="125"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: The maximum number of messages that can be sent in the case of the Simulated Temperature Sensor is 500. If you want to send more messages, you must restart the module by running the following command in the terminal:&lt;/p&gt;


&lt;pre class="highlight shell"&gt;&lt;code&gt;      &lt;span class="nb"&gt;sudo &lt;/span&gt;iotedge restart SimulatedTemperatureSensor
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;You can restart the other module by replacing &lt;code&gt;SimulatedTemperatureSensor&lt;/code&gt; with the required module ID.&lt;/p&gt;


&lt;pre class="highlight shell"&gt;&lt;code&gt;      &lt;span class="nb"&gt;sudo &lt;/span&gt;iotedge restart &amp;lt;Module ID&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Editing Module Twin
&lt;/h2&gt;

&lt;p&gt;By editing the module twin, the features of the sample module used can be edited without having to build or deploy the module again.&lt;br&gt;
In this example, let us edit the module twin of the deployed Python module to change the threshold value of the temperature of the machine that notifies IoT Hub.&lt;/p&gt;

&lt;p&gt;Follow these steps to edit the module twin from Azure Portal:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;Azure Portal&lt;/a&gt; and navigate to the IoT Hub that you created.&lt;/li&gt;
&lt;li&gt;From the &lt;strong&gt;Device management&lt;/strong&gt; category, display the IoT Edge device.&lt;/li&gt;
&lt;li&gt;Click the device ID of the target device.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Set modules&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From the list of IoT Edge modules, select the Python module that you deployed.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Update IoT Edge Module&lt;/em&gt;  page appears.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click the &lt;strong&gt;Module Twin Settings&lt;/strong&gt; tab.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the editor, enter the &lt;code&gt;TemperatureThreshold&lt;/code&gt; details in JSON format.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the lower-left corner of the screen, click &lt;strong&gt;Apply&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The following example shows how to set the threshold value of the machine temperature to 40 degrees.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff87ws3hy4jvhm3xfghii.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff87ws3hy4jvhm3xfghii.png" alt="33_editTwin" width="675" height="376"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Review + Create&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The verification page appears, displaying the configured deployment in standard JSON format. You can view the updated temperature threshold here.&lt;/p&gt;

&lt;p&gt;After confirming the deployment configuration and checking for the "Validation passed" message in the upper-left corner of the screen, click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fixj1k6a8psg9w8ptuez7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fixj1k6a8psg9w8ptuez7.png" alt="34_ReviewEditModule" width="800" height="311"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When you view the data generated by following the same procedure as Verifying module operation, you can see that the new threshold value has come into effect.&lt;/p&gt;

&lt;p&gt;For example, if you changed the temperature threshold from 30 to 40, you will see that the Python module stops sending messages until the generated temperature values start exceeding 40℃. Subsequently, on the &lt;strong&gt;OUTPUT&lt;/strong&gt; tab of Visual Studio Code, the messages are displayed only when the temperature values exceed 40℃.&lt;/p&gt;
&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;As you have seen, the messages sent by the Edge device are received at the IoT Hub. Additionally, updates to the Twin Module in Azure Portal are reflected in the Edge device.&lt;/p&gt;

&lt;p&gt;In our future articles, we will explore how to collect data using a Python module in Azure IoT Edge and send it to an IoT Hub.&lt;/p&gt;
&lt;h2&gt;
  
  
  Appendix
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Image URI
&lt;/h3&gt;

&lt;p&gt;To obtain the image URI, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to the images stored in the container registry as shown in step 4 of Build and Push modules.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select the ID of the module you want to deploy.&lt;/p&gt;

&lt;p&gt;The repository details are displayed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From the Docker pull command box, the content displayed after &lt;code&gt;docker pull&lt;/code&gt; is the image URI.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F60kjnkwk3dhco9jbuf8a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F60kjnkwk3dhco9jbuf8a.png" alt="34_DockerPull" width="800" height="311"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The image URI is in the format  &lt;code&gt;&amp;lt;registry name&amp;gt;.azurecr.io/&amp;lt;module name&amp;gt;:&amp;lt;tag&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For example in the following image, the URI is &lt;code&gt;&amp;lt;registry name&amp;gt;.azurecr.io/pythonmodule:0.0.1-arm32v7&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fils3hy3swpli6f33yjhf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fils3hy3swpli6f33yjhf.png" alt="21_AddIoTEdgeModule" width="624" height="333"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Proxy settings
&lt;/h3&gt;

&lt;p&gt;If you are using a proxy server in your environment then you must configure the proxy settings for Visual Studio Code and Docker Desktop.&lt;/p&gt;

&lt;p&gt;The proxy settings described in this section are an example of what was used for this demonstration. Depending on your environment, you must configure the proxy settings as necessary.&lt;/p&gt;
&lt;h4&gt;
  
  
  Visual Studio Code
&lt;/h4&gt;

&lt;p&gt;Proxy settings for Visual Studio Code are required when logging in from Visual Studio Code to Azure.&lt;/p&gt;

&lt;p&gt;Follow these steps to configure the proxy settings in Visual Studio Code.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Visual Studio Code.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From the menu bar, select &lt;strong&gt;File &amp;gt; User settings &amp;gt; Settings&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Settings&lt;/em&gt; page is displayed.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To display the proxy settings, in the search box, type &lt;code&gt;proxy&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;Http:Proxy&lt;/code&gt; search result is displayed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frtd3989f6jjar13fb506.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frtd3989f6jjar13fb506.png" alt="35_VSCodeProxy" width="800" height="269"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Http:Proxy&lt;/strong&gt; box, specify the proxy URL based on your environment. For example, &lt;code&gt;http://username:password@example.com:port/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The proxy information is saved in the settings file in the following location.&lt;br&gt;
&lt;code&gt;C:\Users\username\AppData\Roaming\Code\User\settings.json&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;For environment details, contact your network administrator.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;
  
  
  Docker
&lt;/h4&gt;

&lt;p&gt;Proxy settings for Docker are required when logging in to Container Registry from the Visual Studio Code Terminal and pushing images.&lt;/p&gt;

&lt;p&gt;For more information about configuring proxy settings in Docker, refer to the &lt;a href="https://docs.docker.com/network/proxy/" rel="noopener noreferrer"&gt;Docker official document&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Follow these steps to configure the proxy settings:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Use any editor to open the &lt;code&gt;config.json&lt;/code&gt; file from the following folder location. &lt;code&gt;C:\Users\username\.docker&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If the file does not exist, create it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Specify the proxy information in &lt;code&gt;config.json&lt;/code&gt; by following the procedure mentioned in &lt;a href="https://docs.docker.com/network/proxy/#configure-the-docker-client" rel="noopener noreferrer"&gt;Configure the Docker Client&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If &lt;code&gt;config.json&lt;/code&gt; is already created, there is a possibility that settings other than Proxy settings are specified in the file. In such cases, specify the configuration such that the label name is the same as the already existing labels.&lt;/p&gt;

&lt;p&gt;The following shows the &lt;code&gt;httpProxy&lt;/code&gt; and &lt;code&gt;httpsProxy&lt;/code&gt; configurations used in this demonstration.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="o"&gt;{&lt;/span&gt;
        &lt;span class="s2"&gt;"HttpHeaders"&lt;/span&gt;:
        &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"User-Agent"&lt;/span&gt;:&lt;span class="s2"&gt;"Docker-Client/19.03.13 (windows)"&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;,
        &lt;span class="s2"&gt;"auths"&lt;/span&gt;:
        &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"&amp;lt;registry name 1&amp;gt;.azurecr.io"&lt;/span&gt;:&lt;span class="o"&gt;{}&lt;/span&gt;,
            &lt;span class="s2"&gt;"https://index.docker.io/v1/"&lt;/span&gt;:&lt;span class="o"&gt;{}&lt;/span&gt;,
            &lt;span class="s2"&gt;"&amp;lt;registry name 2&amp;gt;.azurecr.io"&lt;/span&gt;:&lt;span class="o"&gt;{}&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;,
        &lt;span class="s2"&gt;"credStore"&lt;/span&gt;:&lt;span class="s2"&gt;"desktop"&lt;/span&gt;,
        &lt;span class="s2"&gt;"credsStore"&lt;/span&gt;:&lt;span class="s2"&gt;"desktop"&lt;/span&gt;,
        &lt;span class="s2"&gt;"proxies"&lt;/span&gt;:
        &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"default"&lt;/span&gt;:     
            &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="s2"&gt;"httpProxy"&lt;/span&gt;:&lt;span class="s2"&gt;"http://username:password@example.com:port/"&lt;/span&gt;,
                &lt;span class="s2"&gt;"httpsProxy"&lt;/span&gt;:&lt;span class="s2"&gt;"http://username:password@example.com:port/"&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;,
        &lt;span class="s2"&gt;"stackOrchestrator"&lt;/span&gt;:&lt;span class="s2"&gt;"swarm"&lt;/span&gt;
    &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;As you can see, some of the configurations already existed. Here, we have added the &lt;code&gt;proxies&lt;/code&gt; configuration.&lt;/p&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;To configure the proxy settings in Docker Desktop, perform these steps:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fizw35p2ypgaxgo41z2b3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fizw35p2ypgaxgo41z2b3.png" alt="36_docker" width="624" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;On the toolbar, click the arrow to open the tool tray&lt;/li&gt;
&lt;li&gt;Right-click the Docker Desktop icon and select &lt;strong&gt;Settings&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Expand &lt;strong&gt;Resources&lt;/strong&gt; and select &lt;strong&gt;PROXIES&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Web Server (HTTP)&lt;/strong&gt; box, specify the proxy URL.&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Secure Web Server (HTTPS)&lt;/strong&gt; box, specify the proxy URL.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Apply &amp;amp; Restart&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;p&gt;The proxy settings are configured.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.yokogawa.com/solutions/products-and-services/control/control-devices/real-time-os-based-machine-controllers/#Overview" rel="noopener noreferrer"&gt;Real-time OS controller e-RT3 Plus F3RP70-2L&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://devicecatalog.azure.com/" rel="noopener noreferrer"&gt;Azure Certified Device catalog&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-develop-for-linux?view=iotedge-1.4" rel="noopener noreferrer"&gt;Tutorial: Develop IoT Edge module for Linux device&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-python-module?view=iotedge-1.4" rel="noopener noreferrer"&gt;Tutorial: Develop and deploy Python IoT Edge module for Linux device&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.docker.com/network/proxy/" rel="noopener noreferrer"&gt;Configure Docker to use a proxy server&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>Installing AWS IoT Greengrass V2 in Ubuntu</title>
      <dc:creator>Yokogawa-BrigitteZacharia</dc:creator>
      <pubDate>Thu, 25 Aug 2022 12:45:03 +0000</pubDate>
      <link>https://dev.to/yokogawa-yts_india/-installing-aws-iot-greengrass-v2-in-ubuntu-4ej</link>
      <guid>https://dev.to/yokogawa-yts_india/-installing-aws-iot-greengrass-v2-in-ubuntu-4ej</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;This article describes the steps to install the latest version of Greengrass, called Greengrass V2, which was released in December 2020. Greengrass V2 supports new features such as open-source edge runtime, improved modularity, command-line interface, and improved fleet development features. This enables you to develop, deploy, and manage IoT applications locally on your Edge device.&lt;/p&gt;

&lt;p&gt;For details about installing Greengrass V1, refer to this &lt;a href="https://dev.to/yokogawa-yts_india/installing-aws-iot-greengrass-on-e-rt3-plus-j1l"&gt;article&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Environment
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Supported devices (OS)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.yokogawa.com/solutions/products-platforms/control-system/ert3-embedded-controller/#Overview" rel="noopener noreferrer"&gt;e-RT3 Plus F3RP70-2L&lt;/a&gt;（Ubuntu 18.04 32-bit) Edge controller of Yokogawa.&lt;/li&gt;
&lt;li&gt;Raspberry Pi 4 Model B （Ubuntu Server 20.04 32-bit）&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code&gt;armhf&lt;/code&gt; architecture package runs on these devices.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;To install AWS IoT Greengrass V2 you must complete the fllowing steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install jdk packages on the Edge device&lt;/li&gt;
&lt;li&gt;Configure AWS authentication settings&lt;/li&gt;
&lt;li&gt;Register IoT Core device on AWS and install core software in Edge device&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Installing jdk packages on the Edge device
&lt;/h3&gt;

&lt;p&gt;Run the following commands to install the required packages on the Edge device.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;unzip default-jdk
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If the Edge device is in proxy environment, configuring &lt;a href="https://dev.to/yokogawa-yts_india/send-telemetry-data-from-e-rt3-plus-to-azure-iot-hub-41i#proxy-settings"&gt;proxy settings&lt;/a&gt; is mandatory.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Configuring AWS authentication settings
&lt;/h3&gt;

&lt;p&gt;Configure AWS authentication settings in the environment variables of Edge device. For details, refer to the &lt;a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/quick-installation.html#provide-installer-aws-credentials" rel="noopener noreferrer"&gt;AWS authentication settings&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Registering IoT Core device on AWS and installing core software in Edge device
&lt;/h3&gt;

&lt;p&gt;Follow these steps to register an IoT Core device on AWS:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;On the AWS IoT page, select &lt;strong&gt;Greengrass devices&lt;/strong&gt;, and click &lt;strong&gt;Set up one core&lt;/strong&gt; device.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgtlg1fnsazn42j3epjgh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgtlg1fnsazn42j3epjgh.png" alt="01_AWS_IOT" width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Core device name&lt;/strong&gt; box, specify the name of the core device.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyfqiqkqeemvo7y3filvc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyfqiqkqeemvo7y3filvc.png" alt="02_RegisterGreenGrassDevice" width="800" height="226"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Under &lt;strong&gt;Thing group&lt;/strong&gt;, select &lt;strong&gt;Enter a new group name&lt;/strong&gt;, and specify the name of the thing group in the &lt;strong&gt;Thing group name&lt;/strong&gt; box.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9u6lwt53qbxh1ihguznt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9u6lwt53qbxh1ihguznt.png" alt="03_ConnectRemoteSystem.png" width="800" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If you want to add your core device to an existing thing group, select &lt;strong&gt;Select an existing group&lt;/strong&gt;, and specify the name of the thing group  in the &lt;strong&gt;Thing group name&lt;/strong&gt; box.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Download and install the core software in Edge device. Run the commands &lt;strong&gt;1&lt;/strong&gt; and &lt;strong&gt;2&lt;/strong&gt; in order in the Edge device to download and install the core software.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fagvztw0wpfx3x0nd45g3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fagvztw0wpfx3x0nd45g3.png" alt="04_DownloadandInstall" width="800" height="526"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If the Edge device is in proxy environment, refer to Installing core software in proxy environment.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After the installation is complete, click &lt;strong&gt;View core devices&lt;/strong&gt;.&lt;br&gt;
If the core device you created is displayed, registration and installation is successful. (It may take some time for the device to get displayed.)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F302fy62i6xk24z6aza4t.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F302fy62i6xk24z6aza4t.png" alt="05_ViewcoreDevices" width="800" height="228"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Appendix
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Installing core software in proxy environment
&lt;/h3&gt;

&lt;p&gt;If you want to operate your Edge device in a proxy environment, configuring proxy settings is mandatory. The settings may differ based on the operating environment. You can follow the following steps as a reference to configure proxy settings that are specific to your environment.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a core software settings file called &lt;code&gt;config.yaml&lt;/code&gt; and configure the proxy settings as follows:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;config.yaml
services:
    aws.greengrass.Nucleus:
        configuration:
            mqtt:
                port: 443
            greengrassDataPlanePort: 443
            networkProxy:
                proxy:
                    url: &lt;span class="s2"&gt;"http://username:password@xxx.com:port/"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In step 4 of the Registering IoT Core device on AWS procedure, in command &lt;strong&gt;2&lt;/strong&gt;, delete &lt;code&gt;--deploy-dev-tools true&lt;/code&gt; and add &lt;code&gt;--init-config (path/to/config.yaml)&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Modified command example:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; java &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;-Droot&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"/greengrass/v2"&lt;/span&gt; &lt;span class="nt"&gt;-Dlog&lt;/span&gt;.store&lt;span class="o"&gt;=&lt;/span&gt;FILE &lt;span class="nt"&gt;-jar&lt;/span&gt; ./GreengrassCore/lib/Greengrass.jar &lt;span class="nt"&gt;--aws-region&lt;/span&gt; ap-northeast-1 &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--thing-name&lt;/span&gt; SampleCore &lt;span class="nt"&gt;--thing-group-name&lt;/span&gt; SampleCoreGroup &lt;span class="nt"&gt;--component-default-user&lt;/span&gt; ggc_user:ggc_group &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--provision&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt; &lt;span class="nt"&gt;--setup-system-service&lt;/span&gt; &lt;span class="nb"&gt;true&lt;/span&gt; &lt;span class="nt"&gt;--init-config&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;path/to/config.yaml&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: In a proxy environment, the option &lt;code&gt;--deploy-dev-tools true&lt;/code&gt; is deleted as it will lead to deployment failure. If you want to deploy the CLI component manually, refer to Deploying Greengrass CLI.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Deploying Greengrass CLI
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-cli-component.html" rel="noopener noreferrer"&gt;Greengrass CLI&lt;/a&gt; is the command-line interface (CLI) that enables you to develop and debug an application locally in the Edge device. If you have not included the &lt;code&gt;--deploy-dev-tools true&lt;/code&gt; option when installing the AWS Core software, the Greengrass CLI (aws.greengrass.Cli) component is not deployed.&lt;/p&gt;

&lt;p&gt;To deploy the Greengrass CLI component manually, perform these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;On the left pane, select &lt;strong&gt;Greengrass devices &amp;gt; Components&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmyhwyx28zj396fmuwzze.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmyhwyx28zj396fmuwzze.png" alt="06_GreengrassCLI_components" width="800" height="347"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the Public components tab, select &lt;strong&gt;aws.greengrass.cli&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;aws.greengrass.cli&lt;/em&gt; page appears.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Deploy&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb02y8ykb0quf5341kewm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb02y8ykb0quf5341kewm.png" alt="07_GreengrassCLI_deploy" width="800" height="377"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Create new deployment&lt;/strong&gt; and click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fov804qjz6ggzjnhh3j97.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fov804qjz6ggzjnhh3j97.png" alt="08_GreengrassCLI_createDeployment" width="800" height="184"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the &lt;em&gt;Specify target&lt;/em&gt; page, perform these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the Deployment information section, specify a name to identify the deployment.&lt;/li&gt;
&lt;li&gt;In the Deployment target section, select &lt;strong&gt;Core device&lt;/strong&gt; as the Target type, and then specify the target name in the &lt;strong&gt;Target name&lt;/strong&gt; box.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4r9x236ebz4ahtoqzxg3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4r9x236ebz4ahtoqzxg3.png" alt="09_GreengrassCLI_specifyTarget" width="800" height="636"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;From the Public components list, select the &lt;strong&gt;aws.greengrass.Cli&lt;/strong&gt; check box and click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe69fi188tunmypq5dld4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe69fi188tunmypq5dld4.png" alt="10_GreengrassCLI_PublicComponents" width="787" height="455"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Verify the component and advanced deployment configurations, and click &lt;strong&gt;Deploy&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flglf04bkn51dnjpn3qo5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flglf04bkn51dnjpn3qo5.png" alt="11_GreengrassCLI_FinalDeploy" width="797" height="649"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Deployment&lt;/em&gt; page appears, displaying the deployment status as "Completed"&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3k6kxnyk2uspi7j2y3pq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3k6kxnyk2uspi7j2y3pq.png" alt="12_GreengrassCLI_FinalDeployResult" width="800" height="320"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Run the following command in the Edge device.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;username@ubuntu:~&lt;span class="nv"&gt;$ &lt;/span&gt;/greengrass/v2/bin/greengrass-cli &lt;span class="nt"&gt;--version&lt;/span&gt;    
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;If the following output is generated, Greengrass CLI is deployed successfully.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;Greengrass CLI Version: 2.1.0     
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;/ol&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.yokogawa.com/solutions/products-platforms/control-system/ert3-embedded-controller/#Overview" rel="noopener noreferrer"&gt;AI Platform for industries | Yokogawa Electric Corp.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-cli-component.html" rel="noopener noreferrer"&gt;Greengrass - AWS IoT Greengrass&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>aws</category>
      <category>ubuntu</category>
      <category>ert3plus</category>
      <category>raspberrypi</category>
    </item>
    <item>
      <title>Transmitting messages between AWS IoT Core and Edge device</title>
      <dc:creator>Yokogawa-BrigitteZacharia</dc:creator>
      <pubDate>Thu, 18 Aug 2022 06:29:42 +0000</pubDate>
      <link>https://dev.to/yokogawa-yts_india/transmitting-messages-between-aws-iot-core-and-edge-device-570b</link>
      <guid>https://dev.to/yokogawa-yts_india/transmitting-messages-between-aws-iot-core-and-edge-device-570b</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this article, we describe how to register an Edge device in AWS IoT Core and transmit messages between an Edge device and AWS IoT Core. You can easily send messages without having to install runtime in the Edge device.&lt;/p&gt;

&lt;p&gt;For details about installing AWS IoT Greengrass(V1) on an Edge device and connecting it to AWS, refer to &lt;a href="https://dev.to/yokogawa-yts_india/installing-aws-iot-greengrass-on-e-rt3-plus-j1l"&gt;this article&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Environment
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Supported devices (OS)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;e-RT3 Plus F3RP70-2L（Ubuntu 18.04 32-bit）&lt;/li&gt;
&lt;li&gt;Raspberry Pi 4 Model B （Ubuntu Server 20.04 32-bit）&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code&gt;armhf&lt;/code&gt; architecture package runs on these devices.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;You must configure the following settings to transmit messages between AWS and the Edge device:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configure AWS settings&lt;/li&gt;
&lt;li&gt;Configure Edge device settings&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Configuring AWS settings
&lt;/h2&gt;

&lt;p&gt;Configuring AWS settings involves the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating Edge device policy&lt;/li&gt;
&lt;li&gt;Registering Edge device&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Creating Edge device policy
&lt;/h3&gt;

&lt;p&gt;To allow sending and receiving messages between the Edge device and AWS, we must create an Edge device policy.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Navigate to the &lt;em&gt;Services&lt;/em&gt; page in AWS Console, and select &lt;strong&gt;Internet of Things&lt;/strong&gt; on the left pane.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffr6o76clrkxsizf4zhzo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffr6o76clrkxsizf4zhzo.png" alt="01_AWSConsole_Services" width="800" height="576"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the right pane, under &lt;strong&gt;Internet of Things&lt;/strong&gt;, select &lt;strong&gt;IoT Core&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;AWS IoT&lt;/em&gt; page appears.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F34h0joptzkumrjihdzhm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F34h0joptzkumrjihdzhm.png" alt="02_AWS_IOT" width="800" height="519"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the left pane, select &lt;strong&gt;Security &amp;gt; Policies&lt;/strong&gt;, and then click &lt;strong&gt;Create Policy&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Create Policy&lt;/em&gt; page appears.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmjt4wjnmeocjiybsghu1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmjt4wjnmeocjiybsghu1.png" alt="03_CreatePolicy" width="800" height="811"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the &lt;strong&gt;Policy name&lt;/strong&gt; box, type the name of the policy you want to create for the IoT device.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the &lt;strong&gt;Policy statements&lt;/strong&gt; tab, click &lt;strong&gt;JSON&lt;/strong&gt;, and then enter the following JSON code to define the policy.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"2012-10-17"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Statement"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"iot:Publish"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"iot:Receive"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:iot:&amp;lt;region&amp;gt;:&amp;lt;account&amp;gt;:topic/test/topic"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"iot:Subscribe"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:iot:&amp;lt;region&amp;gt;:&amp;lt;account&amp;gt;:topicfilter/test/topic"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Effect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Allow"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Action"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"iot:Connect"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"Resource"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
                &lt;/span&gt;&lt;span class="s2"&gt;"arn:aws:iot:&amp;lt;region&amp;gt;:&amp;lt;account&amp;gt;:client/test-*"&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;In the code, replace &amp;lt;account&amp;gt; and &amp;lt;region&amp;gt; with your account and region names respectively.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; The region name is displayed in the upper-right corner of the AWS page.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxg7ry55b9rlpak6kxec3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxg7ry55b9rlpak6kxec3.png" alt="10_Region" width="591" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To obtain the account name, refer to this &lt;a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/console_account-alias.html" rel="noopener noreferrer"&gt;procedure&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Create&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The policy for the IoT device is created.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Registering Edge device
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;On the left pane of the &lt;em&gt;AWS IoT&lt;/em&gt; page, select &lt;strong&gt;All devices &amp;gt; Things&lt;/strong&gt;, and then click &lt;strong&gt;Create things&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ac9m3pv4gsp8x7s41sc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5ac9m3pv4gsp8x7s41sc.png" alt="04_CreateThings" width="800" height="319"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a &lt;strong&gt;Thing&lt;/strong&gt; with the following settings.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting item&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;No. of things to be created&lt;/td&gt;
&lt;td&gt;Create one thing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Name of the thing&lt;/td&gt;
&lt;td&gt;Any (In this example, “testdevice”)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Device license&lt;/td&gt;
&lt;td&gt;Automatically creates new license&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select the policy you created in the previous section, and click &lt;strong&gt;Create things&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F874w2nscz5ptk8oim0e1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F874w2nscz5ptk8oim0e1.png" alt="05_policyCreateThigns" width="800" height="440"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Download the following files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Device certificate&lt;/li&gt;
&lt;li&gt;Public key file&lt;/li&gt;
&lt;li&gt;Private key file&lt;/li&gt;
&lt;li&gt;Root CA certificate for Amazon trust services endpoint&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbmakolby083oevir1862.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbmakolby083oevir1862.png" alt="06_Download" width="800" height="627"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: These files are required to enable message transmission between the Edge device and AWS IoT core. Therefore, you must save these files locally on your computer for further usage.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Done&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The Edge device is registered as an IoT device on AWS.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Configuring Edge device settings
&lt;/h2&gt;

&lt;p&gt;Configuring the Edge device settings involves the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install required packages&lt;/li&gt;
&lt;li&gt;Set up virtual environment&lt;/li&gt;
&lt;li&gt;Install SDK&lt;/li&gt;
&lt;li&gt;Prepare sample program&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Installing required packages
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Run the following commands to install the required packages:&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;cmake python3-dev python3-venv
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In case of Raspberry Pi, SDK installation is not possible with the default compiler. Therefore, you must run the following commands to install the gcc package.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;build-essential
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;gcc-8
&lt;/code&gt;&lt;/pre&gt;


&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If the Edge device is under proxy environment, configuring &lt;a href="https://dev.to/yokogawa-yts_india/send-telemetry-data-from-e-rt3-plus-to-azure-iot-hub-41i#proxy-settings"&gt;proxy settings&lt;/a&gt; is mandatory.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Setting up virtual environment
&lt;/h3&gt;

&lt;p&gt;Run the following commands to create a virtual environment.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; venv venv
&lt;span class="nb"&gt;source &lt;/span&gt;venv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Installing SDK
&lt;/h3&gt;

&lt;p&gt;Run the following commands to install the SDK.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;For e-RT3&lt;/strong&gt;&lt;br&gt;
Install &lt;code&gt;awsiotsdk&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;venv&lt;span class="o"&gt;)&lt;/span&gt; username@ubuntu:~&lt;span class="nv"&gt;$ &lt;/span&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install &lt;/span&gt;wheel
&lt;span class="o"&gt;(&lt;/span&gt;venv&lt;span class="o"&gt;)&lt;/span&gt; username@ubuntu:~&lt;span class="nv"&gt;$ &lt;/span&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install &lt;/span&gt;awsiotsdk
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;For Raspberry Pi&lt;/strong&gt;&lt;br&gt;
Specify the compiler and install &lt;code&gt;awsiotsdk&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;venv&lt;span class="o"&gt;)&lt;/span&gt; username@ubuntu:~&lt;span class="nv"&gt;$ &lt;/span&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install &lt;/span&gt;wheel
&lt;span class="o"&gt;(&lt;/span&gt;venv&lt;span class="o"&gt;)&lt;/span&gt; username@ubuntu:~&lt;span class="nv"&gt;$ CC&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/path/to/gcc-8 python3 &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install &lt;/span&gt;awsiotsdk
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: gcc-8 path can be verified by runnning the following command.&lt;br&gt;
&lt;code&gt;username@ubuntu:~$ which gcc-8&lt;/code&gt;&lt;br&gt;
&lt;code&gt;/usr/bin/gcc-8&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If encoding-related error occurs during installation, specify the locale and run the following command.&lt;br&gt;
Example:&lt;br&gt;
&lt;code&gt;(venv) username@ubuntu:~$ LC_CTYPE=C.UTF-8 python3 -m pip install awsiotsdk&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Preparing sample program
&lt;/h3&gt;

&lt;p&gt;Save the AWS SDK2 sample program, &lt;a href="https://github.com/aws/aws-iot-device-sdk-python-v2/blob/v1.7.1/samples/pubsub.py" rel="noopener noreferrer"&gt;pubsub.py&lt;/a&gt;, in the Edge device. The license is saved &lt;a href="https://github.com/aws/aws-iot-device-sdk-python-v2/blob/v1.7.1/LICENSE" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: This article uses v1.7.1 of the code.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Place the certificates and the key files that you downloaded while registering the Edge device in the same directory where the sample program is placed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Message transmission
&lt;/h2&gt;

&lt;p&gt;To enable transmission of messages, run the following command to start the sample program in the Edge device:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;venv&lt;span class="o"&gt;)&lt;/span&gt; username@ubuntu:~&lt;span class="nv"&gt;$ &lt;/span&gt;python3 pubsub.py &lt;span class="nt"&gt;--endpoint&lt;/span&gt; xxx.amazonaws.com &lt;span class="nt"&gt;--root-ca&lt;/span&gt; AmazonRootCA1.pem &lt;span class="nt"&gt;--cert&lt;/span&gt; xxx-certificate.pem.crt &lt;span class="nt"&gt;--key&lt;/span&gt; xxx-private.pem.key 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the arguments, specify the Root CA certificate, license, and key files that you downloaded while registering the Edge device. In addition, specify the endpoint in the command.&lt;/p&gt;

&lt;p&gt;To obtain the endpoint, on the &lt;em&gt;AWS IoT&lt;/em&gt; page, select &lt;strong&gt;Settings&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The endpoint is displayed in the &lt;em&gt;Device data endpoint&lt;/em&gt; section.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnhoc1ywz7f1w8x70jpu9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnhoc1ywz7f1w8x70jpu9.png" alt="07_Settings" width="800" height="464"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If the Edge device is under proxy environment configuring proxy settings is mandatory.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The following output indicates that message is sent successfully.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Connecting to xxx.amazonaws.com with client ID &lt;span class="s1"&gt;'test-xxx'&lt;/span&gt;...
Connected!
Subscribing to topic &lt;span class="s1"&gt;'test/topic'&lt;/span&gt;...
Subscribed with QoS.AT_LEAST_ONCE
Sending 10 message&lt;span class="o"&gt;(&lt;/span&gt;s&lt;span class="o"&gt;)&lt;/span&gt;
Publishing message to topic &lt;span class="s1"&gt;'test/topic'&lt;/span&gt;: Hello World! &lt;span class="o"&gt;[&lt;/span&gt;1]
Received message from topic &lt;span class="s1"&gt;'test/topic'&lt;/span&gt;: b&lt;span class="s1"&gt;'"Hello World! [1]"'&lt;/span&gt;
Publishing message to topic &lt;span class="s1"&gt;'test/topic'&lt;/span&gt;: Hello World! &lt;span class="o"&gt;[&lt;/span&gt;2]
Received message from topic &lt;span class="s1"&gt;'test/topic'&lt;/span&gt;: b&lt;span class="s1"&gt;'"Hello World! [2]"'&lt;/span&gt;
Publishing message to topic &lt;span class="s1"&gt;'test/topic'&lt;/span&gt;: Hello World! &lt;span class="o"&gt;[&lt;/span&gt;3]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In addition to publishing the message in ‘test/topic’ topic, this program subscribes to the ‘test/topic’ topic and stops after sending and receiving messages ten times.&lt;/p&gt;

&lt;h3&gt;
  
  
  Verifying D2C message transmission
&lt;/h3&gt;

&lt;p&gt;Follow these steps to verify if the message from the Edge device has reached the Cloud:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;On the &lt;em&gt;AWS IoT&lt;/em&gt; page, on the left pane, select &lt;strong&gt;MQTT test client&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3o2va3bm8itgq6zzef7v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3o2va3bm8itgq6zzef7v.png" alt="08_MQTT" width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the &lt;strong&gt;Subscribe to topic&lt;/strong&gt; tab, in the &lt;strong&gt;Topic filter&lt;/strong&gt; box, type the name of the topic for which the message was sent from the Edge device.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Subscribe&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You are subscribed to the specified topic.&lt;/p&gt;

&lt;p&gt;If the message is received, it is displayed at the bottom of the screen.&lt;/p&gt;

&lt;h3&gt;
  
  
  Verifying C2D message transmission
&lt;/h3&gt;

&lt;p&gt;Follow these steps to send and verify C2D message transmission:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;In the Edge device, run the following command to start the pubsub.py program without publishing the message.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;venv&lt;span class="o"&gt;)&lt;/span&gt; username@ubuntu:~&lt;span class="nv"&gt;$ &lt;/span&gt;python3 pubsub.py &lt;span class="nt"&gt;--endpoint&lt;/span&gt; xxx.amazonaws.com &lt;span class="nt"&gt;--root-ca&lt;/span&gt; AmazonRootCA1.pem &lt;span class="nt"&gt;--cert&lt;/span&gt; xxx-certificate.pem.crt &lt;span class="nt"&gt;--key&lt;/span&gt; xxx-private.pem.key &lt;span class="nt"&gt;--message&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To send the message from cloud to the Edge device, click the &lt;strong&gt;Publish to a topic&lt;/strong&gt; tab.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8deuq1sdd1ls7obmz7h0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8deuq1sdd1ls7obmz7h0.png" alt="09_sendMsg" width="800" height="333"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the &lt;strong&gt;Topic name&lt;/strong&gt; box, type &lt;code&gt;test/topic&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Message payload&lt;/strong&gt; box, specify the message to be sent.&lt;br&gt;
For example,&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="s2"&gt;"message"&lt;/span&gt;:&lt;span class="s2"&gt;"Hello from AWS IoT console"&lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Publish&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the following output is generated in the Edge device, the C2D message is transmitted successfully. The program stops after sending ten messages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```bash
Received message from topic 'test/topic': b'{\n "message": "This is a message from AWS"\n}'
```
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Appendix
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Configuring proxy settings
&lt;/h3&gt;

&lt;p&gt;If the Edge device is in proxy environment, run the &lt;code&gt;pubsub.py&lt;/code&gt; program by using the following command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;venv&lt;span class="o"&gt;)&lt;/span&gt; username@ubuntu:~&lt;span class="nv"&gt;$ &lt;/span&gt;python3 pubsub.py &lt;span class="nt"&gt;--endpoint&lt;/span&gt; xxx.amazonaws.com &lt;span class="nt"&gt;--root-ca&lt;/span&gt; AmazonRootCA1.pem &lt;span class="nt"&gt;--cert&lt;/span&gt; xxx-certificate.pem.crt &lt;span class="nt"&gt;--key&lt;/span&gt; xxx-private.pem.key &lt;span class="nt"&gt;--proxy-host&lt;/span&gt; &lt;span class="s2"&gt;"proxy.example.com"&lt;/span&gt; &lt;span class="nt"&gt;--proxy-port&lt;/span&gt; xx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If user name and password are required, specify the same in the program as follows:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before modification&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pubsub.py
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;args.proxy_host&lt;span class="o"&gt;)&lt;/span&gt;:
proxy_options &lt;span class="o"&gt;=&lt;/span&gt; http.HttpProxyOptions&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;host_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;args.proxy_host, &lt;span class="nv"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;args.proxy_port&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;After modification&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pubsub.py
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;args.proxy_host&lt;span class="o"&gt;)&lt;/span&gt;:
proxy_options &lt;span class="o"&gt;=&lt;/span&gt; http.HttpProxyOptions&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;host_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;args.proxy_host, &lt;span class="nv"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;args.proxy_port, auth_type &lt;span class="o"&gt;=&lt;/span&gt; http.HttpProxyAuthenticationType.Basic, &lt;span class="nv"&gt;auth_username&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;username&amp;gt;"&lt;/span&gt;, &lt;span class="nv"&gt;auth_password&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&amp;lt;password&amp;gt;"&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.yokogawa.com/solutions/products-platforms/control-system/ert3-embedded-controller/#Overview" rel="noopener noreferrer"&gt;AI platform for industries | Yokogawa Electric Corp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/aws/aws-iot-device-sdk-python-v2" rel="noopener noreferrer"&gt;GitHub - aws/aws-iot-device-sdk-python-v2: Next generation AWS IoT Client SDK for Python using the AWS Common Runtime&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>aws</category>
      <category>ert3p</category>
      <category>python</category>
      <category>raspberrypi</category>
    </item>
    <item>
      <title>Cross compiling C/C++ programs for Ubuntu installed on Edge devices</title>
      <dc:creator>Yokogawa-BrigitteZacharia</dc:creator>
      <pubDate>Thu, 04 Aug 2022 08:33:00 +0000</pubDate>
      <link>https://dev.to/yokogawa-yts_india/cross-compiling-cc-programs-for-ubuntu-installed-on-edge-devices-1ajn</link>
      <guid>https://dev.to/yokogawa-yts_india/cross-compiling-cc-programs-for-ubuntu-installed-on-edge-devices-1ajn</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Developing a large-scale program on an Edge device can take a considerable amount of time. To avoid this, in this document, we introduce a method for cross compiling C/C++ for a device on which Ubuntu is installed.&lt;/p&gt;

&lt;p&gt;This enables you to develop a program using the Windows Subsystem for Linux (WSL) and deploy the program on Edge devices.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo7e4rlwx8ai0b4sc5wk2.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo7e4rlwx8ai0b4sc5wk2.jpeg" alt="01" width="800" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Environment
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Supported device (OS)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;e-RT3 Plus F3RP70-2L (Ubuntu 18.04 32-bit): An Edge controller from Yokogawa.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;armhf&lt;/code&gt; architecture package runs on this device.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Windows version&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Windows 10 64-bit version 1909&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Software version&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Visual Studio Professional 2019 version 16.9.6&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;Before you start building a cross-compile platform, you must install the &lt;code&gt;libc6&lt;/code&gt; package on e-RT3 Plus.&lt;/p&gt;

&lt;p&gt;Run the following commands to install the package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;libc6-dbg
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: In some cases, you may need to  configure the &lt;a href="https://dev.to/yokogawa-yts_india/send-telemetry-data-from-e-rt3-plus-to-azure-iot-hub-41i#enabling-sudo-user"&gt;sudo&lt;/a&gt; and &lt;a href="https://dev.to/yokogawa-yts_india/send-telemetry-data-from-e-rt3-plus-to-azure-iot-hub-41i#proxy-settings"&gt;proxy&lt;/a&gt; settings.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  WSL preparation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Installing WSL
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Install WSL by following the steps described in the &lt;a href="https://docs.microsoft.com/en-us/windows/wsl/install" rel="noopener noreferrer"&gt;Microsoft official procedure&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Download Ubuntu 18.04 LTS from &lt;a href="https://apps.microsoft.com/store/detail/ubuntu-1804-on-windows/9N9TNGVNDL3Q?hl=en-in&amp;amp;gl=IN" rel="noopener noreferrer"&gt;Microsoft Store&lt;/a&gt;.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxobwzxc31cb19vy1m5br.jpg" alt="02_WindowsStore" width="800" height="428"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Configuring WSL settings
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Start WSL and login.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the following commands to install the required packages.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update

&lt;span class="c"&gt;# Install the build environment for armhf&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;crossbuild-essential-armhf

&lt;span class="c"&gt;# Install other required packages&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;make rsync zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You can verify that the installation is successful by running the following commands.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;arm-linux-gnueabihf-gcc &lt;span class="nt"&gt;--version&lt;/span&gt;
arm-linux-gnueabihf-gcc &lt;span class="o"&gt;(&lt;/span&gt;Ubuntu/Linaro 7.5.0-3ubuntu1~18.04&lt;span class="o"&gt;)&lt;/span&gt; 7.5.0
Copyright &lt;span class="o"&gt;(&lt;/span&gt;C&lt;span class="o"&gt;)&lt;/span&gt; 2017 Free Software Foundation, Inc.
This is free software&lt;span class="p"&gt;;&lt;/span&gt; see the &lt;span class="nb"&gt;source &lt;/span&gt;&lt;span class="k"&gt;for &lt;/span&gt;copying conditions. There is NO
warranty&lt;span class="p"&gt;;&lt;/span&gt; not even &lt;span class="k"&gt;for &lt;/span&gt;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

&lt;span class="nv"&gt;$ &lt;/span&gt;arm-linux-gnueabihf-g++ &lt;span class="nt"&gt;--version&lt;/span&gt;
arm-linux-gnueabihf-g++ &lt;span class="o"&gt;(&lt;/span&gt;Ubuntu/Linaro 7.5.0-3ubuntu1~18.04&lt;span class="o"&gt;)&lt;/span&gt; 7.5.0
Copyright &lt;span class="o"&gt;(&lt;/span&gt;C&lt;span class="o"&gt;)&lt;/span&gt; 2017 Free Software Foundation, Inc.
This is free software&lt;span class="p"&gt;;&lt;/span&gt; see the &lt;span class="nb"&gt;source &lt;/span&gt;&lt;span class="k"&gt;for &lt;/span&gt;copying conditions. There is NO
warranty&lt;span class="p"&gt;;&lt;/span&gt; not even &lt;span class="k"&gt;for &lt;/span&gt;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If the computer is in an environment that requires proxies to connect to the internet, you must configure the &lt;a href="https://dev.to/yokogawa-yts_india/send-telemetry-data-from-e-rt3-plus-to-azure-iot-hub-41i#proxy-settings"&gt;proxy settings&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Installing Visual Studio
&lt;/h2&gt;

&lt;p&gt;The steps to install Visual Studio are described in the &lt;a href="https://dev.to/yokogawa-yts_india/using-visual-studio-to-set-up-a-cc-remote-development-environment-hk1"&gt;previous article&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: You need not download IntelliSense to execute the steps that are described in this article.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Creating and debugging projects
&lt;/h2&gt;

&lt;p&gt;Creating and debugging a project involves the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating a project&lt;/li&gt;
&lt;li&gt;Configuring project settings&lt;/li&gt;
&lt;li&gt;Building and debugging the project&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Creating a project
&lt;/h3&gt;

&lt;p&gt;Follow these steps to create a project:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Start Visual Studio and create a new project.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Specify the project type as &lt;strong&gt;C++&lt;/strong&gt; and &lt;strong&gt;Linux&lt;/strong&gt;, select &lt;strong&gt;Console Application&lt;/strong&gt;, and create a project by specifying the project name.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcag1v99vshm65c7hvept.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcag1v99vshm65c7hvept.jpg" alt="03_CreateVSProject" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuring project settings
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;From the menu bar, click &lt;strong&gt;Project &amp;gt; Properties&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For more information about configuring the project settings for a Linux WSL subsystem, refer to the &lt;a href="https://devblogs.microsoft.com/cppblog/c-with-visual-studio-2019-and-windows-subsystem-for-linux-wsl/" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgbjgpl3exmv91pxpe1pg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgbjgpl3exmv91pxpe1pg.jpg" alt="04_ConfigurePjtSettings" width="278" height="355"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;From the Configuration drop-down list, select &lt;strong&gt;Debug&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;From the Platform drop-down list, select &lt;strong&gt;x64&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the left pane, select &lt;strong&gt;General&lt;/strong&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the right pane, under the &lt;strong&gt;Platform Toolset&lt;/strong&gt; section, from the &lt;strong&gt;Platform Toolset&lt;/strong&gt; drop-down list, select &lt;strong&gt;GCC for Windows Subsystem for Linux&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Apply&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkntxe0vfsaeycd5xz97k.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkntxe0vfsaeycd5xz97k.jpg" alt="05_PlatformToolSelection" width="635" height="440"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the left pane, click &lt;strong&gt;Debugging&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frfv766tokhquxcs48bzv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frfv766tokhquxcs48bzv.jpg" alt="06_RemoteDebuggingMAchine" width="635" height="439"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;From the &lt;strong&gt;Remote Debug Machine&lt;/strong&gt; drop-down list, select the added device.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the left pane, select &lt;strong&gt;C/C++&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the right pane, under the &lt;strong&gt;General&lt;/strong&gt; section,  in the &lt;strong&gt;C Compiler&lt;/strong&gt; and &lt;strong&gt;C++ Compiler&lt;/strong&gt; boxes, type &lt;code&gt;arm-linux-gnueabihf-g++&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj66dxu7jiv66u7eqsfg0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj66dxu7jiv66u7eqsfg0.jpg" alt="07_cCompiler" width="636" height="440"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the left pane, select &lt;strong&gt;Linker&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the right pane, under the &lt;strong&gt;General&lt;/strong&gt; section, in the &lt;strong&gt;Linker&lt;/strong&gt; box, type &lt;code&gt;arm-linux-gnueabihf-g++&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkkrotr1bcddwro0hqnm0.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkkrotr1bcddwro0hqnm0.jpg" alt="08_Linker" width="635" height="441"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Apply&lt;/strong&gt;.&lt;br&gt;
The project settings are configured.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Building and debugging the project
&lt;/h3&gt;

&lt;p&gt;Follow these steps to build and debug the project:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;From the &lt;strong&gt;Debug&lt;/strong&gt; drop-down list, select &lt;strong&gt;x64&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpecka4mbuaehfxf6ck58.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpecka4mbuaehfxf6ck58.jpg" alt="09_platform" width="652" height="214"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Place a break point anywhere in the source code.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Build and run the program.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If the program stops at the break point, it indicates that the project is created successfully.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8uvl8t9coy7pnb034d1h.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8uvl8t9coy7pnb034d1h.jpg" alt="10_breakpoint" width="652" height="214"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The output is displayed in the Linux console window.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2jzrrce2oxhrp1bkkbf.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm2jzrrce2oxhrp1bkkbf.jpg" alt="11_outputProg" width="736" height="270"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Appendix
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Accessing WSL files
&lt;/h3&gt;

&lt;p&gt;WSL files are saved in the current Linux directory. To navigate to the directory, type &lt;a href="https://dev.to\wsl$"&gt;&lt;code&gt;\\wsl$&lt;/code&gt;&lt;/a&gt; in the address bar of Windows Explorer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnmo3pcu6u3r2cbyh9jkl.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnmo3pcu6u3r2cbyh9jkl.jpg" alt="12_WSLubuntu" width="628" height="258"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Build project without debugging
&lt;/h3&gt;

&lt;p&gt;You can build only the project without debugging it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;From the menu bar, select &lt;strong&gt;Build &amp;gt; {project-name}&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foy8rd2keeta21771rbya.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foy8rd2keeta21771rbya.jpg" alt="13_BuildPjtOnly" width="349" height="310"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The output file is saved in the following location:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;Solution directory&amp;gt;\&amp;lt;Project directory&amp;gt;\bin\&amp;lt;Platform&amp;gt;\&amp;lt;Configuration&amp;gt;\&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6dkoinmkjvmowt65cj8k.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6dkoinmkjvmowt65cj8k.jpg" alt="14_outputFile" width="726" height="186"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Using device-specific libraries
&lt;/h3&gt;

&lt;p&gt;When you build a program using device-specific libraries, you must include the library and header files in the project.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create the &lt;code&gt;inc&lt;/code&gt; and &lt;code&gt;lib&lt;/code&gt; folders in the project directory to store the header and library files respectively.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffk3y61jawacbsqz64vwh.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffk3y61jawacbsqz64vwh.jpg" alt="15_inc_lib" width="702" height="264"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open the project properties in Visual Studio.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the left pane, select &lt;strong&gt;C/C++ &amp;gt; General&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the right pane, in the &lt;strong&gt;Additional Include Directories&lt;/strong&gt; box, specify the &lt;code&gt;inc&lt;/code&gt; folder location.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9924rwebug6buas7w124.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9924rwebug6buas7w124.jpg" alt="16_AddnlIncludeDir" width="638" height="440"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the left pane, select &lt;strong&gt;Linker &amp;gt; General&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Additional Library Directories&lt;/strong&gt; box, specify the &lt;code&gt;lib&lt;/code&gt; folder location.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhii13k92j72twgra21s2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhii13k92j72twgra21s2.jpg" alt="17_AdditionalLibDirectories" width="637" height="441"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Library Dependent File&lt;/strong&gt;, specify the name of the library. For example, in case of &lt;code&gt;libfoo.so&lt;/code&gt;, type &lt;code&gt;foo&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuuwg8b9ergef9fdlipnv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuuwg8b9ergef9fdlipnv.jpg" alt="18_foo" width="635" height="437"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Apply&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.yokogawa.com/solutions/products-platforms/control-system/ert3-embedded-controller/#Overview" rel="noopener noreferrer"&gt;AI Platform for Industries | Yokogawa Electric Corp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://devblogs.microsoft.com/cppblog/c-with-visual-studio-2019-and-windows-subsystem-for-linux-wsl/" rel="noopener noreferrer"&gt;C++ with Visual Studio 2019 and Windows Subsystem for Linux (WSL) | C++ Team Blog&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>cpp</category>
      <category>ubuntu</category>
      <category>ert3plus</category>
      <category>wsl</category>
    </item>
    <item>
      <title>Using Visual Studio to set up a C/C++ remote development environment</title>
      <dc:creator>Yokogawa-BrigitteZacharia</dc:creator>
      <pubDate>Wed, 03 Aug 2022 05:35:53 +0000</pubDate>
      <link>https://dev.to/yokogawa-yts_india/using-visual-studio-to-set-up-a-cc-remote-development-environment-hk1</link>
      <guid>https://dev.to/yokogawa-yts_india/using-visual-studio-to-set-up-a-cc-remote-development-environment-hk1</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In the previous articles, we have demonstrated a number of programs, mostly written in Python, that run on an Edge device. However, there are times when we need to write programs in C/C++. It is easy to set up a C/C++ remote development environment on an Edge device such as e-RT3 Plus or Raspberry Pi. In this article, we demonstrate how to set up the C/C++ environment on an Ubuntu installed Edge device using Visual Studio.&lt;/p&gt;

&lt;h2&gt;
  
  
  Environment
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Supported devices (OS)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;e-RT3 Plus F3RP70-2L (Ubuntu 18.04 32-bit)
Edge controller of Yokogawa.&lt;/li&gt;
&lt;li&gt;Raspberry Pi 4 Model B (Ubuntu Server 20.04 32-bit）&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code&gt;armhf&lt;/code&gt; architecture package runs on these devices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Software requirements&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Visual Studio Professional 2022 version 17.2.6&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;The first step towards setting up a Visual Studio environment on the device is to install the &lt;code&gt;gdbserver&lt;/code&gt; package. To install the &lt;code&gt;gdbserver&lt;/code&gt; package on the device, run the following commands.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;g++ make gdb gdbserver zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: By default, this package is installed on e-RT3 Plus.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Installing Visual Studio
&lt;/h2&gt;

&lt;p&gt;Follow these steps to install Visual Studio:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install the tool set required to set up the Linux environment.&lt;/p&gt;

&lt;p&gt;Open Visual Studio Installer and install &lt;strong&gt;Linux and embedded development with C++&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkv3a156cz5hjpp9fvqba.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkv3a156cz5hjpp9fvqba.png" alt="01_Install_Linux_dev" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For more information about Linux development with C++ in Visual Studio 2022, refer to the &lt;a href="https://docs.microsoft.com/en-us/cpp/linux/?view=msvc-170" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the settings for connecting Visual Studio and the device by performing these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start Visual Studio.&lt;/li&gt;
&lt;li&gt;Open &lt;strong&gt;Tools&lt;/strong&gt; &lt;strong&gt;&amp;gt;&lt;/strong&gt; &lt;strong&gt;Options&lt;/strong&gt; &lt;strong&gt;&amp;gt;&lt;/strong&gt; &lt;strong&gt;Cross Platform&lt;/strong&gt; &lt;strong&gt;&amp;gt;&lt;/strong&gt; &lt;strong&gt;Connection Manager&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Add&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fol8bjatxpb4l4iiwnqsl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fol8bjatxpb4l4iiwnqsl.png" alt="02_VisualStudio_config" width="744" height="434"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter the following details and click &lt;strong&gt;Connect&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Items&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Host name&lt;/td&gt;
&lt;td&gt;IP address of device&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Port&lt;/td&gt;
&lt;td&gt;22&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;User name&lt;/td&gt;
&lt;td&gt;User name for device&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Authentication type&lt;/td&gt;
&lt;td&gt;Password&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Password&lt;/td&gt;
&lt;td&gt;User password&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx16oq0gipux4qpxzdf6n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx16oq0gipux4qpxzdf6n.png" alt="03_Connect_remoteSys" width="466" height="431"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;To download the header to be used in IntelliSense, click &lt;strong&gt;Connection Manager&lt;/strong&gt; &lt;strong&gt;&amp;gt;&lt;/strong&gt; &lt;strong&gt;Remote Header IntelliSense Manager&lt;/strong&gt;, select the device that you added, and then click &lt;strong&gt;Download&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fws575qm6o1egcni9n5jq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fws575qm6o1egcni9n5jq.png" alt="04_DownloadHeaders" width="744" height="434"&gt;&lt;/a&gt;&lt;/p&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;h2&gt;
  
  
  Creating and debugging a project
&lt;/h2&gt;

&lt;p&gt;Creating and debugging a project involves the following steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating a project&lt;/li&gt;
&lt;li&gt;Configuring project settings&lt;/li&gt;
&lt;li&gt;Building and debugging a project&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Creating a project
&lt;/h3&gt;

&lt;p&gt;Follow these steps to create a project:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start Visual Studio and create a new project.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Specify the project type as &lt;strong&gt;C++&lt;/strong&gt; and &lt;strong&gt;Linux&lt;/strong&gt;, select &lt;strong&gt;Console Application&lt;/strong&gt;, and create a project by specifying the project name.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftekwgo4p6vpfgcim0asi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftekwgo4p6vpfgcim0asi.png" alt="05_CreateNewPjt" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Configuring project settings
&lt;/h3&gt;

&lt;p&gt;Follow these steps to configure project settings:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;From the menu bar, select &lt;strong&gt;Project&lt;/strong&gt; &lt;strong&gt;&amp;gt;&lt;/strong&gt; &lt;strong&gt;{project-name} Properties&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fozf8ch9sf1ea6yc8rav7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fozf8ch9sf1ea6yc8rav7.png" alt="06_Select_PjTProperties" width="487" height="426"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;From the Configuration drop-down list, select &lt;strong&gt;Debug&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;From the Platform drop-down list,  select &lt;strong&gt;ARM&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnkvrdxbzc826o7u921au.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnkvrdxbzc826o7u921au.PNG" alt="07_ConfigureProperties" width="788" height="547"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the left pane, select &lt;strong&gt;General&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the right pane, from the &lt;strong&gt;Remote Build Machine&lt;/strong&gt; drop-down list, select the added device.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Apply&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the left pane, select &lt;strong&gt;Debugging&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvjvx3zl7o1ry5utg7kgs.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvjvx3zl7o1ry5utg7kgs.PNG" alt="08_ConfigureDebugProperties" width="784" height="541"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;From the &lt;strong&gt;Remote Debug Machine&lt;/strong&gt; drop-down list, select the added device.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;From the &lt;strong&gt;Debugging Mode&lt;/strong&gt; drop-down list, select &lt;code&gt;gdbserver&lt;/code&gt;, and then click &lt;strong&gt;Apply&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Building and debugging a project
&lt;/h3&gt;

&lt;p&gt;Follow these steps to build and debug a project:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;After selecting &lt;strong&gt;Debug&lt;/strong&gt; for Configuration and &lt;strong&gt;ARM&lt;/strong&gt; for Platform, place a break point anywhere in the source code to build and run the program.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwzpuuhkx2gv8wkv155tz.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwzpuuhkx2gv8wkv155tz.PNG" alt="09_CreateSampleCode" width="672" height="223"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If the program stops at the break point, it indicates that the project is created successfully.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsh4zmc3cfvnbs7wqi7cw.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsh4zmc3cfvnbs7wqi7cw.PNG" alt="10_SampleCodeBreakpoint" width="568" height="230"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The output is displayed in the Linux console window.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbulgj100nlq5xwmpke3y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbulgj100nlq5xwmpke3y.png" alt="11_SampleCodeOutput" width="800" height="171"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Appendix
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Adding source files
&lt;/h3&gt;

&lt;p&gt;Follow these steps to add source files:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Right-click the project icon, and select &lt;strong&gt;Add&lt;/strong&gt; &lt;strong&gt;&amp;gt;&lt;/strong&gt; &lt;strong&gt;New Item&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;Add New Item&lt;/em&gt; dialog box appears.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1taywifhcto8l5izis78.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1taywifhcto8l5izis78.png" alt="12_Addnew" width="800" height="660"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Specify the file name, select the file type and then click &lt;strong&gt;Add&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpjyetklvkupposjhusyv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpjyetklvkupposjhusyv.png" alt="13_ItemName" width="800" height="555"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Library links
&lt;/h3&gt;

&lt;p&gt;Follow these steps to add library links:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the Project properties.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the left pane, select &lt;strong&gt;Configuration Properties&lt;/strong&gt; &lt;strong&gt;&amp;gt;&lt;/strong&gt; &lt;strong&gt;Linker&lt;/strong&gt; &lt;strong&gt;&amp;gt;&lt;/strong&gt; &lt;strong&gt;Input&lt;/strong&gt; &lt;strong&gt;&amp;gt;&lt;/strong&gt; &lt;strong&gt;Library dependencies&lt;/strong&gt;, and then click &lt;strong&gt;Edit&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8q1m3x2kybow54z25le.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8q1m3x2kybow54z25le.png" alt="14_AddLink" width="784" height="540"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter the name of the library to be added. &lt;/p&gt;

&lt;p&gt;The following image shows the scenario when &lt;code&gt;libm&lt;/code&gt; is added.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fammmuiyg7q4a9df9ocjb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fammmuiyg7q4a9df9ocjb.png" alt="15_LibraryName" width="403" height="354"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Adding Include path
&lt;/h3&gt;

&lt;p&gt;If you are using a header file that is available in a location other than the default location, you must configure the Include path settings.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;From the Project Properties, navigate to &lt;strong&gt;C/C++&lt;/strong&gt; &lt;strong&gt;&amp;gt;&lt;/strong&gt; &lt;strong&gt;General&lt;/strong&gt; &lt;strong&gt;&amp;gt;&lt;/strong&gt; &lt;strong&gt;Additional Include directories&lt;/strong&gt;, and then click &lt;strong&gt;Edit&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fafesod3iosaiof2nr3oh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fafesod3iosaiof2nr3oh.png" alt="16_Includepath" width="784" height="539"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Specify the directory path on device that includes the header file and click &lt;strong&gt;OK&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy72ohd4otkt1nshyjcr0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy72ohd4otkt1nshyjcr0.png" alt="17_Addpath" width="403" height="354"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.yokogawa.com/solutions/products-platforms/control-system/ert3-embedded-controller/#Overview" rel="noopener noreferrer"&gt;AI platform for industries | Yokogawa Electric Corporation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.microsoft.com/en-us/cpp/linux/?view=msvc-170" rel="noopener noreferrer"&gt;Linux development with C++&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>cpp</category>
      <category>ubuntu</category>
      <category>ert3plus</category>
      <category>raspberrypi</category>
    </item>
    <item>
      <title>Communicating over Modbus TCP with Node-RED and storing data in InfluxDB</title>
      <dc:creator>Yokogawa-BrigitteZacharia</dc:creator>
      <pubDate>Wed, 20 Jul 2022 05:19:53 +0000</pubDate>
      <link>https://dev.to/yokogawa-yts_india/communicating-over-modbus-tcp-with-node-red-and-storing-data-in-influxdb-54m8</link>
      <guid>https://dev.to/yokogawa-yts_india/communicating-over-modbus-tcp-with-node-red-and-storing-data-in-influxdb-54m8</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In the &lt;a href="https://dev.to/yokogawa-yts_india/using-python-to-store-collected-data-in-influxdb-and-visualizing-data-in-grafana-694"&gt;previous article&lt;/a&gt;, we learnt how to establish Modbus communication using Python and store the data in InfluxDB. &lt;br&gt;
This is the last article of the 3-part series, where we explore how to establish Modbus communication using Node-RED and store the data in InfluxDB. As Node-RED contains a flow-based editor, it enables visual programming to connect and configure various nodes to establish Modbus  communication easily.&lt;/p&gt;
&lt;h2&gt;
  
  
  System positioning
&lt;/h2&gt;

&lt;p&gt;The following figure shows the setup required to establish Modbus connection with e-RT3 Plus.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwinpmld1vi55qnkdiy65.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwinpmld1vi55qnkdiy65.jpg" alt="SystemPositioning" width="624" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The flow involves 2 events:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Data collection&lt;/p&gt;

&lt;p&gt;Edge device collects data from the external device over Modbus TCP using Node-RED.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Data storage&lt;/p&gt;

&lt;p&gt;Edge device stores the collected data in InfluxDB.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Supported devices
&lt;/h2&gt;

&lt;p&gt;This example can be performed on the following devices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;e-RT3 Plus F3RP70-2L1 (Ubuntu 18.04 32-bit)&lt;/li&gt;
&lt;li&gt;Raspberry Pi 4 Model B (Ubuntu Server 20.04 32-bit)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code&gt;armhf&lt;/code&gt; architecture package runs on these devices.&lt;/p&gt;
&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;To get started, you must follow these steps to retrieve and store data in the Edge device over Modbus TCP communication.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Installing Node.js and Node-RED&lt;/li&gt;
&lt;li&gt;Installing custom nodes on Node-RED&lt;/li&gt;
&lt;li&gt;Configuring InfluxDB settings&lt;/li&gt;
&lt;li&gt;Configuring Modbus server&lt;/li&gt;
&lt;li&gt;Creating data collection flow&lt;/li&gt;
&lt;li&gt;Creating data storage flow&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Installing Node.js and Node-RED
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If the Edge device is in proxy environment, configuring proxy settings for &lt;a href="https://dev.to/yokogawa-yts_india/send-telemetry-data-from-e-rt3-plus-to-azure-iot-hub-41i#proxy-settings"&gt;Linux&lt;/a&gt; and npm is mandatory.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Follow these steps to install Node.js and Node-RED on the Edge device:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;To install Node.js run the following command.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://deb.nodesource.com/setup_14.x | &lt;span class="nb"&gt;sudo&lt;/span&gt; &lt;span class="nt"&gt;-E&lt;/span&gt; bash - 
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; nodejs
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;You can verify installation of Node.js by using the following command.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;node &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;If Node. js is installed successfully then the version of the Node will be displayed as shown below.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;v14.17.1
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Run the following command and install Node-RED.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; &lt;span class="nt"&gt;--unsafe-perm&lt;/span&gt; node-red
&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;If the command is executed successfully, the following output is displayed.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;+ node-red@2.2.0
added 286 packages from 375 contributors &lt;span class="k"&gt;in &lt;/span&gt;142.031s
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;/ol&gt;

&lt;h3&gt;
  
  
  Installing custom nodes on Node-RED
&lt;/h3&gt;

&lt;p&gt;To communicate via Modbus TCP protocol, the following custom nodes must be installed on Node-RED:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;node-red-contrib-influxdb&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;node-red-contrib-modbus&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Follow these steps to install the custom nodes on Node-RED:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Run the following command in the Edge device and start Node-RED.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node-red
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After starting Node-RED, in the address bar of your Internet browser, specify the following URL, &lt;code&gt;&amp;lt;IP_ADDRESS_OF_EDGE_DEVICE&amp;gt;:1880&lt;/code&gt; and open Node-RED.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the upper-right corner of the screen, click the &lt;strong&gt;Menu&lt;/strong&gt; icon and select &lt;strong&gt;Manage palette&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg0bt3l7sdzubw3lhs7e2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg0bt3l7sdzubw3lhs7e2.jpg" alt="Menu_palette" width="397" height="781"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;User Settings&lt;/em&gt; dialog box appears.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;On the &lt;strong&gt;Install&lt;/strong&gt; tab, in the search box, type &lt;code&gt;node-red-contrib-influxdb&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The search results appear.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs4j6wehrepordao3tkho.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs4j6wehrepordao3tkho.jpg" alt="node-red-contrib-influxdb-install" width="800" height="735"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click &lt;strong&gt;Install&lt;/strong&gt; to  install the corresponding node.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Perform steps 4-5 to install the &lt;code&gt;node-red-contrib-modbus node&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fykmc34kxr71o8wgfy2xd.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fykmc34kxr71o8wgfy2xd.jpg" alt="node-red-contrib-modbus" width="800" height="746"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Configuring InfluxDB settings
&lt;/h3&gt;

&lt;p&gt;You can follow the steps described in this &lt;a href="https://dev.to/yokogawa-yts_india/using-python-to-store-collected-data-in-influxdb-and-visualizing-data-in-grafana-694#installing-influxdb"&gt;article&lt;/a&gt; to install InfluxDB. (Installation of Python package is not required.) And then, follow the steps described in this &lt;a href="https://dev.to/yokogawa-yts_india/using-python-to-store-collected-data-in-influxdb-and-visualizing-data-in-grafana-694#configuring-the-database"&gt;section&lt;/a&gt; to create a database with its name as &lt;code&gt;noderedDB&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuring Modbus server
&lt;/h3&gt;

&lt;p&gt;In this article, we will start the Modbus server on the computer to simulate a device such as a sensor that sends data to the Edge device. To do so, start the program described in this &lt;a href="https://dev.to/yokogawa-yts_india/using-python-to-store-collected-data-in-influxdb-and-visualizing-data-in-grafana-694#configuring-modbus-server"&gt;link&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Creating data collection flow
&lt;/h3&gt;

&lt;p&gt;Let us create a flow to collect data from the Modbus server every 5 seconds. In this example, we collect two time-series data values stored in the holding register of the server.&lt;/p&gt;

&lt;p&gt;Follow these steps to create the data collection flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;From the left menu, drag-and-drop &lt;strong&gt;Modbus-Read&lt;/strong&gt; node and double-click it to configure its properties.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh9ftxgw9cadm4xbh1rpg.jpg" alt="modbus-read-node-edit" width="800" height="830"&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the properties of the node as follows.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting name&lt;/th&gt;
&lt;th&gt;Setting value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Name&lt;/td&gt;
&lt;td&gt;read_holding_register&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;FC&lt;/td&gt;
&lt;td&gt;FC 3: Read Holding Registers&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Address&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Quantity&lt;/td&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Poll Rate&lt;/td&gt;
&lt;td&gt;5 seconds&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Next to the &lt;strong&gt;Server&lt;/strong&gt; box, click the &lt;strong&gt;Edit&lt;/strong&gt; icon.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7lbzdhcwxrk84plm4nc4.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7lbzdhcwxrk84plm4nc4.jpg" alt="modbus-read-server-edit" width="632" height="846"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the properties of the Modbus server as follows and then click &lt;strong&gt;Add&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting name&lt;/th&gt;
&lt;th&gt;Setting value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Name&lt;/td&gt;
&lt;td&gt;serverPC&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Type&lt;/td&gt;
&lt;td&gt;TCP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Host&lt;/td&gt;
&lt;td&gt;IP address of the computer on which Modbus server is running&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Port&lt;/td&gt;
&lt;td&gt;5020&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After configuring the settings, click &lt;strong&gt;Done&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To check if the data is collected successfully, perform these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Drag-and-drop the &lt;strong&gt;debug&lt;/strong&gt; node.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8d1xq878o18po2umkfs2.jpg" alt="flow-debug-read-holding-register_live" width="800" height="281"&gt;
&lt;/li&gt;
&lt;li&gt;Connect the debug node to the upper connection of the  &lt;strong&gt;read_holding_register&lt;/strong&gt;, and then click &lt;strong&gt;Deploy&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click the &lt;strong&gt;debug&lt;/strong&gt; tab on the right pane.
If the collected data is displayed as shown in the image below, it is successful.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhdlkg5yux2lynxq7e13y.jpg" alt="flow-debug-read-holding-register-debug" width="392" height="430"&gt;
&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;h3&gt;
  
  
  Creating data storage flow
&lt;/h3&gt;

&lt;p&gt;Now that we are able to collect data through the Modbus server, we proceed to configure a data storage flow to store the collected data in InfluxDB.&lt;/p&gt;

&lt;p&gt;Follow these steps to create the data storage flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;From the left menu, drag-and-drop the &lt;strong&gt;function&lt;/strong&gt; node and double-click it to configure its properties.
&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fybzyyof74grbv8kgvyij.jpg" alt="function-node-code" width="800" height="801"&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select the &lt;strong&gt;On Message&lt;/strong&gt; tab and write the following program to process the array of collected data into the standard JSON format.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;const data &lt;span class="o"&gt;=&lt;/span&gt; msg.payload
payload &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;span class="s2"&gt;"holding_register_2"&lt;/span&gt;: data[0],
&lt;span class="s2"&gt;"holding_register_3"&lt;/span&gt;: data[1]
&lt;span class="o"&gt;}&lt;/span&gt;
msg[&lt;span class="s2"&gt;"payload"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; payload
&lt;span class="k"&gt;return &lt;/span&gt;msg&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Done&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Drag-and-drop the &lt;strong&gt;influxdb out&lt;/strong&gt; node to store data in InfluxDB and double-click it to configure its settings.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feaf0qecdhbhbny772l6m.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feaf0qecdhbhbny772l6m.jpg" alt="influxdb-out-node-edit" width="646" height="848"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the properties of the node as follows.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting name&lt;/th&gt;
&lt;th&gt;Setting value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Name&lt;/td&gt;
&lt;td&gt;To_noderedDB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Measurement&lt;/td&gt;
&lt;td&gt;nodered_measurement&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Next to the &lt;strong&gt;Server&lt;/strong&gt; box, click the &lt;strong&gt;Edit&lt;/strong&gt; icon.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1exu7t88eowg4g2yu982.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1exu7t88eowg4g2yu982.jpg" alt="influxdb-out-server-edit" width="638" height="846"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the properties of the InfluxDB server as follows and then click &lt;strong&gt;Add&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting name&lt;/th&gt;
&lt;th&gt;Setting value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Name&lt;/td&gt;
&lt;td&gt;noderedDB&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Host&lt;/td&gt;
&lt;td&gt;localhost&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Port&lt;/td&gt;
&lt;td&gt;8086&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database&lt;/td&gt;
&lt;td&gt;noderedDB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After configuring the settings, and click &lt;strong&gt;Done&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Connect the nodes as shown below and click &lt;strong&gt;Deploy&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgft5g4sq86oq46colt59.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgft5g4sq86oq46colt59.jpg" alt="Final-Flow" width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After waiting for a while, run the following commands in the Edge device and verify the contents of the database:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Launch InfluxDB.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;influx 
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;The following output is displayed if InfluxDB is launched successfully.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Connected to http://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.10
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the following command to select the &lt;code&gt;noderedDB&lt;/code&gt; database.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; USE noderedDB
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;If the database selection is successful, the following output is displayed.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Using database noderedDB
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the following command to view the stored data.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM &lt;span class="s2"&gt;"nodered_measurement"&lt;/span&gt; LIMIT 3
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Storage is successful if data is stored as shown below.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;name: nodered_measurement
&lt;span class="nb"&gt;time &lt;/span&gt;holding_register_2 holding_register_3
&lt;span class="nt"&gt;----&lt;/span&gt; &lt;span class="nt"&gt;------------------&lt;/span&gt; &lt;span class="nt"&gt;------------------&lt;/span&gt;
1643782593448526154 93 24
1643782598683263519 99 22
1643782603803351763 100 20
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;As demonstrated in the article, it is possible to create visual data applications with minimal programs. In conjunction with Node-RED and InfluxDB, e-RT3 Plus is able to collect and store data from external data sources by using Modbus TCP communication.&lt;br&gt;
You can learn more about visualizing the collected data on Grafana from our &lt;a href="https://dev.to/yokogawa-yts_india/using-python-to-store-collected-data-in-influxdb-and-visualizing-data-in-grafana-694"&gt;previous article&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Additional information
&lt;/h2&gt;
&lt;h3&gt;
  
  
  npm proxy settings
&lt;/h3&gt;

&lt;p&gt;If the device is in proxy environment, run the following command to configure the proxy settings of npm.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;npm &lt;span class="nt"&gt;-g&lt;/span&gt; config &lt;span class="nb"&gt;set &lt;/span&gt;proxy http://&lt;span class="o"&gt;{&lt;/span&gt;username&lt;span class="o"&gt;}&lt;/span&gt;:&lt;span class="o"&gt;{&lt;/span&gt;password&lt;span class="o"&gt;}&lt;/span&gt;@&lt;span class="o"&gt;{&lt;/span&gt;proxy-server-url&lt;span class="o"&gt;}&lt;/span&gt;:&lt;span class="o"&gt;{&lt;/span&gt;port&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;npm &lt;span class="nt"&gt;-g&lt;/span&gt; config &lt;span class="nb"&gt;set &lt;/span&gt;https-proxy https://&lt;span class="o"&gt;{&lt;/span&gt;username&lt;span class="o"&gt;}&lt;/span&gt;:&lt;span class="o"&gt;{&lt;/span&gt;password&lt;span class="o"&gt;}&lt;/span&gt;@&lt;span class="o"&gt;{&lt;/span&gt;proxy-server-url&lt;span class="o"&gt;}&lt;/span&gt;:&lt;span class="o"&gt;{&lt;/span&gt;port&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.yokogawa.com/solutions/products-platforms/control-system/ert3-embedded-controller/#Overview" rel="noopener noreferrer"&gt;AI platform for industries | Yokogawa Electric Corporation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/nodesource/distributions/blob/master/README.md" rel="noopener noreferrer"&gt;distributions/README.md at master · nodesource/distributions · GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nodered.org/docs/getting-started/local" rel="noopener noreferrer"&gt;Running Node-RED locally&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>modbus</category>
      <category>nodered</category>
      <category>influxdb</category>
      <category>ert3plus</category>
    </item>
    <item>
      <title>Using Python to store collected data in InfluxDB and visualizing data in Grafana</title>
      <dc:creator>Yokogawa-BrigitteZacharia</dc:creator>
      <pubDate>Thu, 07 Jul 2022 09:04:06 +0000</pubDate>
      <link>https://dev.to/yokogawa-yts_india/using-python-to-store-collected-data-in-influxdb-and-visualizing-data-in-grafana-694</link>
      <guid>https://dev.to/yokogawa-yts_india/using-python-to-store-collected-data-in-influxdb-and-visualizing-data-in-grafana-694</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In the &lt;a href="https://dev.to/yokogawa-yts_india/modbus-tcp-communication-with-edge-devices-in-python-3hgd"&gt;previous article&lt;/a&gt;, we learnt how to collect data with Modbus TCP communication using Python. This is the 2nd article of the 3-part series, where we explore how to store collected data in InfluxDB and visualize the data in Grafana.&lt;/p&gt;

&lt;h2&gt;
  
  
  Supported devices
&lt;/h2&gt;

&lt;p&gt;The steps in this demonstration can be performed on the following devices.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;e-RT3 Plus F3RP70-2L1 (Ubuntu 18.04 32-bit)&lt;/li&gt;
&lt;li&gt;Raspberry Pi 4 Model B (Ubuntu Server 20.04 32-bit)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The &lt;code&gt;armhf&lt;/code&gt; architecture packages run on these devices.&lt;/p&gt;

&lt;h2&gt;
  
  
  System positioning
&lt;/h2&gt;

&lt;p&gt;The following figure shows the setup required to collect, store, and visualize data on the Edge device over the Modbus TCP communication.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd9e2h847cq771cm971yz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd9e2h847cq771cm971yz.jpg" alt="SystemPositioning_ModbusGrafana" width="593" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The flow involves four events:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Data collection&lt;/p&gt;

&lt;p&gt;Data is collected from an external device by using Modbus TCP communication.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Data storage&lt;/p&gt;

&lt;p&gt;The collected data is stored in Influx DB on the Edge device.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Visualization&lt;/p&gt;

&lt;p&gt;The data stored in InfluxDB is visualized using Grafana.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Monitoring&lt;/p&gt;

&lt;p&gt;The results are monitored in a computer by accessing Grafana in the Edge device.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;To achieve the objective of this article, you must install Grafana and InfluxDB on the Edge device.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installing Grafana
&lt;/h3&gt;

&lt;p&gt;Follow these steps to install Grafana on the Edge device.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install the required packages.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; apt-transport-https
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; software-properties-common wget
wget &lt;span class="nt"&gt;-q&lt;/span&gt; &lt;span class="nt"&gt;-O&lt;/span&gt; - https://packages.grafana.com/gpg.key | &lt;span class="nb"&gt;sudo &lt;/span&gt;apt-key add -
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add repositories and install Grafana.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"deb https://packages.grafana.com/oss/deb stable main"&lt;/span&gt; | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; /etc/apt/sources.list.d/grafana.list
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;grafana
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;For more information on installing Grafana, refer to &lt;a href="https://grafana.com/docs/grafana/latest/installation/debian/" rel="noopener noreferrer"&gt;Install on Debian/Ubuntu | Grafana Labs&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Start the service and verify the status.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl daemon-reload
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start grafana-server
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status grafana-server
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;If the program is executed successfully, the following output is displayed.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;*&lt;/span&gt; grafana-server.service - Grafana instance
Loaded: loaded &lt;span class="o"&gt;(&lt;/span&gt;/usr/lib/systemd/system/grafana-server.service&lt;span class="p"&gt;;&lt;/span&gt; disabled&lt;span class="p"&gt;;&lt;/span&gt; ven
Active: active &lt;span class="o"&gt;(&lt;/span&gt;running&lt;span class="o"&gt;)&lt;/span&gt; since Fri 2021-12-24 07:38:20 UTC&lt;span class="p"&gt;;&lt;/span&gt; 14s ago
Docs: http://docs.grafana.org
Main PID: 2756 &lt;span class="o"&gt;(&lt;/span&gt;grafana-server&lt;span class="o"&gt;)&lt;/span&gt;
Tasks: 12 &lt;span class="o"&gt;(&lt;/span&gt;limit: 2366&lt;span class="o"&gt;)&lt;/span&gt;
CGroup: /system.slice/grafana-server.service
&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nt"&gt;-2756&lt;/span&gt; /usr/sbin/grafana-server &lt;span class="nt"&gt;--config&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/etc/grafana/grafana.ini &lt;span class="nt"&gt;--p&lt;/span&gt;
Dec 24 07:38:32 ubuntu grafana-server[2756]: &lt;span class="nv"&gt;t&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2021-12-24T07:38:32+0000 &lt;span class="nv"&gt;lvl&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;info
Dec 24 07:38:32 ubuntu grafana-server[2756]: &lt;span class="nv"&gt;t&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2021-12-24T07:38:32+0000 &lt;span class="nv"&gt;lvl&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;info
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: If the Edge device is in a proxy environment, &lt;a href="https://dev.to/yokogawa-yts_india/send-telemetry-data-from-e-rt3-plus-to-azure-iot-hub-41i#proxy-settings"&gt;configuring proxy settings&lt;/a&gt; is mandatory.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Installing InfluxDB
&lt;/h3&gt;

&lt;p&gt;Follow these steps to install InfluxDB on an Edge device.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Install the package that is used to operate InfluxDB from Python.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install &lt;/span&gt;influxdb
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Add repositories and install InfluxDB.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-s&lt;/span&gt; https://repos.influxdata.com/influxdb.key | gpg &lt;span class="nt"&gt;--dearmor&lt;/span&gt; | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/apt/trusted.gpg.d/influxdb.gpg
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;DISTRIB_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;lsb_release &lt;span class="nt"&gt;-si&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;DISTRIB_CODENAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;lsb_release &lt;span class="nt"&gt;-sc&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"deb [signed-by=/etc/apt/trusted.gpg.d/influxdb.gpg] https://repos.influxdata.com/&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;DISTRIB_ID&lt;/span&gt;&lt;span class="p"&gt;,,&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;DISTRIB_CODENAME&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; stable"&lt;/span&gt; | &lt;span class="nb"&gt;sudo tee&lt;/span&gt; /etc/apt/sources.list.d/influxdb.list
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;influxdb
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Start the service and verify the status.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl unmask influxdb.service
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start influxdb
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status influxdb
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;If the program is executed successfully, the following output is displayed.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;*&lt;/span&gt; influxdb.service - InfluxDB is an open-source, distributed, &lt;span class="nb"&gt;time &lt;/span&gt;series databa
Loaded: loaded &lt;span class="o"&gt;(&lt;/span&gt;/lib/systemd/system/influxdb.service&lt;span class="p"&gt;;&lt;/span&gt; enabled&lt;span class="p"&gt;;&lt;/span&gt; vendor preset:
Active: active &lt;span class="o"&gt;(&lt;/span&gt;running&lt;span class="o"&gt;)&lt;/span&gt; since Fri 2021-12-24 07:51:02 UTC&lt;span class="p"&gt;;&lt;/span&gt; 6s ago
Docs: https://docs.influxdata.com/influxdb/Process: 4191 &lt;span class="nv"&gt;ExecStart&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/usr/lib/influxdb/scripts/influxd-systemd-start.sh &lt;span class="o"&gt;(&lt;/span&gt;co
Main PID: 4192 &lt;span class="o"&gt;(&lt;/span&gt;influxd&lt;span class="o"&gt;)&lt;/span&gt;
Tasks: 9 &lt;span class="o"&gt;(&lt;/span&gt;limit: 2366&lt;span class="o"&gt;)&lt;/span&gt;
CGroup: /system.slice/influxdb.service &lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="nt"&gt;-4192&lt;/span&gt; /usr/bin/influxd &lt;span class="nt"&gt;-config&lt;/span&gt; /etc/influxdb/influxdb.conf&lt;span class="sb"&gt;`&lt;/span&gt;
Dec 24 07:51:01 ubuntu influxd-systemd-start.sh[4191]: &lt;span class="nv"&gt;ts&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2021-12-24T07:51:01.75
Dec 24 07:51:01 ubuntu influxd-systemd-start.sh[4191]: &lt;span class="nv"&gt;ts&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;2021-12-24T07:51:01.75
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;For more information about installing InfluxDB, refer to the &lt;a href="https://docs.influxdata.com/influxdb/v1.8/introduction/install/" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Data Collection
&lt;/h2&gt;

&lt;p&gt;Collect data from the device with a Python program that uses PyModbus. In this example, start the Modbus server on the computer instead of the device.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: For more details about data collection using PyModubs, refer to the &lt;a href="https://dev.to/yokogawa-yts_india/modbus-tcp-communication-with-edge-devices-in-python-3hgd"&gt;previous article&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Configuring Modbus server
&lt;/h3&gt;

&lt;p&gt;Follow these steps to configure Modbus server:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Start the Modbus server on the computer.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;To rewrite the values periodically, modify the program &lt;a href="https://github.com/riptideio/pymodbus/blob/v2.5.2/examples/common/updating_server.py" rel="noopener noreferrer"&gt;updating_server.py&lt;/a&gt; (You can access the license &lt;a href="https://github.com/riptideio/pymodbus/blob/v2.5.2/LICENSE" rel="noopener noreferrer"&gt;here&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;In this example, we store two time-series data values in the holding register and Boolean data in the coil.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Modify the following code in the &lt;code&gt;updating_write&lt;/code&gt; function.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;import random
def updating_writer&lt;span class="o"&gt;(&lt;/span&gt;a&lt;span class="o"&gt;)&lt;/span&gt;:
context &lt;span class="o"&gt;=&lt;/span&gt; a[0]
slave_id &lt;span class="o"&gt;=&lt;/span&gt; 0x00

&lt;span class="c"&gt;# Write to coil 1&lt;/span&gt;
fx &lt;span class="o"&gt;=&lt;/span&gt; 1
address &lt;span class="o"&gt;=&lt;/span&gt; 0x01
values &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;bool&lt;span class="o"&gt;(&lt;/span&gt;random.getrandbits&lt;span class="o"&gt;(&lt;/span&gt;1&lt;span class="o"&gt;))]&lt;/span&gt;
log.debug&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"coil1: "&lt;/span&gt; + str&lt;span class="o"&gt;(&lt;/span&gt;bool&lt;span class="o"&gt;(&lt;/span&gt;random.getrandbits&lt;span class="o"&gt;(&lt;/span&gt;1&lt;span class="o"&gt;))))&lt;/span&gt;
context[slave_id].setValues&lt;span class="o"&gt;(&lt;/span&gt;fx, address, values&lt;span class="o"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# Writing to holding register 2&lt;/span&gt;
fx &lt;span class="o"&gt;=&lt;/span&gt; 3
address &lt;span class="o"&gt;=&lt;/span&gt; 0x02
values &lt;span class="o"&gt;=&lt;/span&gt; context[slave_id].getValues&lt;span class="o"&gt;(&lt;/span&gt;fx, address, &lt;span class="nv"&gt;count&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1&lt;span class="o"&gt;)&lt;/span&gt;
values[0] +&lt;span class="o"&gt;=&lt;/span&gt; random.randint&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;-10&lt;/span&gt;, 10&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;values[0] &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 100:
values[0] &lt;span class="o"&gt;=&lt;/span&gt; 100
&lt;span class="k"&gt;elif &lt;/span&gt;values[0] &amp;lt; 0:
values[0] &lt;span class="o"&gt;=&lt;/span&gt; 0
log.debug&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"holding2: "&lt;/span&gt; + str&lt;span class="o"&gt;(&lt;/span&gt;values[0]&lt;span class="o"&gt;))&lt;/span&gt;
context[slave_id].setValues&lt;span class="o"&gt;(&lt;/span&gt;fx, address, values&lt;span class="o"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# Writing to holding register 3&lt;/span&gt;
fx &lt;span class="o"&gt;=&lt;/span&gt; 3
address &lt;span class="o"&gt;=&lt;/span&gt; 0x03
values &lt;span class="o"&gt;=&lt;/span&gt; context[slave_id].getValues&lt;span class="o"&gt;(&lt;/span&gt;fx, address, &lt;span class="nv"&gt;count&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1&lt;span class="o"&gt;)&lt;/span&gt;
values[0] +&lt;span class="o"&gt;=&lt;/span&gt; random.randint&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;-5&lt;/span&gt;, 5&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;values[0] &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; 50:
values[0] &lt;span class="o"&gt;=&lt;/span&gt; 50
&lt;span class="k"&gt;elif &lt;/span&gt;values[0] &amp;lt; 0:
values[0] &lt;span class="o"&gt;=&lt;/span&gt; 0
log.debug&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"holding3: "&lt;/span&gt; + str&lt;span class="o"&gt;(&lt;/span&gt;values[0]&lt;span class="o"&gt;))&lt;/span&gt;
context[slave_id].setValues&lt;span class="o"&gt;(&lt;/span&gt;fx, address, values&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Rewrite the following code at the end of the &lt;a href="https://github.com/riptideio/pymodbus/blob/v2.5.2/examples/common/updating_server.py" rel="noopener noreferrer"&gt;updating_server.py&lt;/a&gt; program.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Before change&lt;/span&gt;
StartTcpServer&lt;span class="o"&gt;(&lt;/span&gt;context, &lt;span class="nv"&gt;identity&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;identity, &lt;span class="nv"&gt;address&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt;&lt;span class="s2"&gt;"localhost"&lt;/span&gt;, 5020&lt;span class="o"&gt;))&lt;/span&gt;
&lt;span class="c"&gt;# After change&lt;/span&gt;
StartTcpServer&lt;span class="o"&gt;(&lt;/span&gt;context, &lt;span class="nv"&gt;identity&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;identity, &lt;span class="nv"&gt;address&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;, 5020&lt;span class="o"&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;Install the following package and start the program.&lt;br&gt;
&lt;/p&gt;

&lt;pre class="highlight shell"&gt;&lt;code&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; pip &lt;span class="nb"&gt;install &lt;/span&gt;twisted pymodbus
python updating_server.py
&lt;/code&gt;&lt;/pre&gt;




&lt;/li&gt;

&lt;/ol&gt;

&lt;h3&gt;
  
  
  Data collection in Edge device
&lt;/h3&gt;

&lt;p&gt;Follow these steps to collect data in the Edge device:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Run the following &lt;code&gt;client.py&lt;/code&gt; program in the Edge device to collect the server data every 5 seconds.&lt;/p&gt;

&lt;p&gt;Ensure that you replace the  with the IP address of the computer on which the Modbus server is running.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;client.py

&lt;span class="c"&gt;#!/usr/bin/env python&lt;/span&gt;
from pymodbus.client.sync import ModbusTcpClient as ModbusClient
import &lt;span class="nb"&gt;time&lt;/span&gt;

&lt;span class="c"&gt;# Connect to Modbus server&lt;/span&gt;
mbclient &lt;span class="o"&gt;=&lt;/span&gt; ModbusClient&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'&amp;lt;IP_ADDRESS_OF_SERVER_PC&amp;gt;'&lt;/span&gt;, &lt;span class="nv"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;5020&lt;span class="o"&gt;)&lt;/span&gt;
mbclient.connect&lt;span class="o"&gt;()&lt;/span&gt;
&lt;span class="k"&gt;while &lt;/span&gt;True:
try:
    &lt;span class="c"&gt;# Read value of coil 1&lt;/span&gt;
    rr &lt;span class="o"&gt;=&lt;/span&gt; mbclient.read_coils&lt;span class="o"&gt;(&lt;/span&gt;1, 1&lt;span class="o"&gt;)&lt;/span&gt;
    co1 &lt;span class="o"&gt;=&lt;/span&gt; rr.bits[0]

    &lt;span class="c"&gt;# Read values from holding registers 2 and 3&lt;/span&gt;
    rr &lt;span class="o"&gt;=&lt;/span&gt; mbclient.read_holding_registers&lt;span class="o"&gt;(&lt;/span&gt;2, 2&lt;span class="o"&gt;)&lt;/span&gt;
    hr2 &lt;span class="o"&gt;=&lt;/span&gt; rr.registers[0]
    hr3 &lt;span class="o"&gt;=&lt;/span&gt; rr.registers[1]

    print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"coil1: {0}, holding2: {1}, holding3: {2}"&lt;/span&gt;.format&lt;span class="o"&gt;(&lt;/span&gt;co1, hr2, hr3&lt;span class="o"&gt;))&lt;/span&gt;

    &lt;span class="c"&gt;#Sleep for 5 seconds&lt;/span&gt;
    time.sleep&lt;span class="o"&gt;(&lt;/span&gt;5&lt;span class="o"&gt;)&lt;/span&gt;

except KeyboardInterrupt:
    &lt;span class="c"&gt;# disconnect&lt;/span&gt;
    mbclient.close&lt;span class="o"&gt;()&lt;/span&gt;
    &lt;span class="nb"&gt;break

&lt;/span&gt;except Exception as e:
    print&lt;span class="o"&gt;(&lt;/span&gt;e&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;If the program is executed successfully, the following output is displayed.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;username@ubuntu:~&lt;span class="nv"&gt;$ &lt;/span&gt;python3 client.py
coil1: False, holding2: 89, holding3: 12
coil1: True, holding2: 85, holding3: 13
coil1: True, holding2: 78, holding3: 14
...
&lt;span class="c"&gt;# Close with Ctrl+C&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Although this program enables easier collection of periodic data, the period in which the data is collected is not accurate. If you want to collect data in more accurate periods, check other methods of data collection.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Data storage
&lt;/h2&gt;

&lt;p&gt;Store the data that is collected from Edge device in InfluxDB.&lt;/p&gt;

&lt;h3&gt;
  
  
  Configuring the database
&lt;/h3&gt;

&lt;p&gt;Follow these steps to configure the database:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Start InfluxDB&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start influxdb
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a database with the name as &lt;code&gt;sampleDB&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;username@ubuntu:~&lt;span class="nv"&gt;$ &lt;/span&gt;influx
Connected to http://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.10
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; CREATE DATABASE sampleDB
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;exit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Storage in database
&lt;/h3&gt;

&lt;p&gt;Follow these steps to store the collected data in the database that you created.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Refer to the &lt;a href="https://influxdb-python.readthedocs.io/en/latest/examples.html" rel="noopener noreferrer"&gt;InfluxDB sample program&lt;/a&gt; and add the code to store data to the &lt;code&gt;client.py&lt;/code&gt; program that was created in the step Data collection in Edge device.&lt;/p&gt;

&lt;p&gt;After adding, the code is updated as follows.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;client.py

&lt;span class="c"&gt;#!/usr/bin/env python&lt;/span&gt;
from pymodbus.client.sync import ModbusTcpClient as ModbusClient
from influxdb import InfluxDBClient
from datetime import datetime
import &lt;span class="nb"&gt;time&lt;/span&gt;

&lt;span class="c"&gt;# Connect to Modbus server&lt;/span&gt;
mbclient &lt;span class="o"&gt;=&lt;/span&gt; ModbusClient&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'&amp;lt;IP_ADDRESS_OF_SERVER_PC&amp;gt;'&lt;/span&gt;, &lt;span class="nv"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;5020&lt;span class="o"&gt;)&lt;/span&gt;
mbclient.connect&lt;span class="o"&gt;()&lt;/span&gt;

&lt;span class="c"&gt;# Connect to database&lt;/span&gt;
dbclient &lt;span class="o"&gt;=&lt;/span&gt; InfluxDBClient&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;host&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'localhost'&lt;/span&gt;, &lt;span class="nv"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;8086, &lt;span class="nv"&gt;database&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'sampleDB'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;while &lt;/span&gt;True:
try:
    &lt;span class="c"&gt;# Read value from coil 1&lt;/span&gt;
    rr &lt;span class="o"&gt;=&lt;/span&gt; mbclient.read_coils&lt;span class="o"&gt;(&lt;/span&gt;1, 1&lt;span class="o"&gt;)&lt;/span&gt;
    co1 &lt;span class="o"&gt;=&lt;/span&gt; rr.bits[0]

    &lt;span class="c"&gt;# Read values from holding registers 2 and 3&lt;/span&gt;
    rr &lt;span class="o"&gt;=&lt;/span&gt; mbclient.read_holding_registers&lt;span class="o"&gt;(&lt;/span&gt;2, 2&lt;span class="o"&gt;)&lt;/span&gt;
    hr2 &lt;span class="o"&gt;=&lt;/span&gt; rr.registers[0]
    hr3 &lt;span class="o"&gt;=&lt;/span&gt; rr.registers[1]

    print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"coil1: {0}, holding2: {1}, holding3: {2}"&lt;/span&gt;.format&lt;span class="o"&gt;(&lt;/span&gt;co1, hr2, hr3&lt;span class="o"&gt;))&lt;/span&gt;

    &lt;span class="c"&gt;# Write to database&lt;/span&gt;
    json_body &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;
        &lt;span class="o"&gt;{&lt;/span&gt;
            &lt;span class="s2"&gt;"measurement"&lt;/span&gt;: &lt;span class="s2"&gt;"sample_measurement"&lt;/span&gt;,
            &lt;span class="s2"&gt;"time"&lt;/span&gt;: datetime.utcnow&lt;span class="o"&gt;()&lt;/span&gt;,
            &lt;span class="s2"&gt;"fields"&lt;/span&gt;: &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="s2"&gt;"coil_1"&lt;/span&gt;: co1,
                &lt;span class="s2"&gt;"holding_register_2"&lt;/span&gt;: hr2,
                &lt;span class="s2"&gt;"holding_register_3"&lt;/span&gt;: hr3
                &lt;span class="o"&gt;}&lt;/span&gt;
        &lt;span class="o"&gt;}&lt;/span&gt;
    &lt;span class="o"&gt;]&lt;/span&gt;

    print&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Write points: {0}"&lt;/span&gt;.format&lt;span class="o"&gt;(&lt;/span&gt;json_body&lt;span class="o"&gt;))&lt;/span&gt;
    dbclient.write_points&lt;span class="o"&gt;(&lt;/span&gt;json_body&lt;span class="o"&gt;)&lt;/span&gt;

    &lt;span class="c"&gt;# Skip for 5 seconds&lt;/span&gt;
    time.sleep&lt;span class="o"&gt;(&lt;/span&gt;5&lt;span class="o"&gt;)&lt;/span&gt;
    except KeyboardInterrupt:

    &lt;span class="c"&gt;#Disconnect&lt;/span&gt;
    mbclient.close&lt;span class="o"&gt;()&lt;/span&gt;
    dbclient.close&lt;span class="o"&gt;()&lt;/span&gt;
    &lt;span class="nb"&gt;break

    &lt;/span&gt;except Exception as e:
    print&lt;span class="o"&gt;(&lt;/span&gt;e&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: Data is written to the SD card everytime data is stored in the database. If you want to reduce the frequency with which data is written to the SD card, use an appropriate storage medium such as RAM disk or network disk, and specify them as storage destinations in the InfluxDB settings.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Start the program and wait for a few seconds.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 client.py
&lt;span class="c"&gt;# Close with Ctrl+C&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the following commands in the Edge device and display the contents of the table.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Launch InfluxDB.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;~/modbus&lt;span class="nv"&gt;$ &lt;/span&gt;influx
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;The following output is displayed if InfluxDB is launched successfully.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Connected to http://localhost:8086 version 1.8.10
InfluxDB shell version: 1.8.10
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the following command to select the &lt;code&gt;sampleDB&lt;/code&gt; database.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; USE sampleDB
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;If the database selection is successful, the following output is displayed.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Using database sampleDB
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run the following command to view the stored data.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; SELECT &lt;span class="k"&gt;*&lt;/span&gt; FROM &lt;span class="s2"&gt;"sample_measurement"&lt;/span&gt; LIMIT 3
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Storage is successful if data is stored as shown below.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;name: sample_measurement
&lt;span class="nb"&gt;time &lt;/span&gt;coil_1 holding_register_2 
olding_register_3
&lt;span class="nt"&gt;----&lt;/span&gt; &lt;span class="nt"&gt;------&lt;/span&gt; &lt;span class="nt"&gt;------------------&lt;/span&gt; &lt;span class="nt"&gt;------------------&lt;/span&gt;
1641876882000000000 &lt;span class="nb"&gt;false &lt;/span&gt;23 13
1641876887000000000 &lt;span class="nb"&gt;false &lt;/span&gt;16 14
1641876892000000000 &lt;span class="nb"&gt;true &lt;/span&gt;15 13
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;h2&gt;
  
  
  Visualization and monitoring
&lt;/h2&gt;

&lt;p&gt;Use Grafana to visualize the data that is stored in InfluxDB.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Run the following command in Edge device and start Grafana.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start grafana-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the address bar of your Internet browser, specify the following URL:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;IP address of the device&amp;gt;:3000&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe69tv4d1gfcn2v3aq9nt.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe69tv4d1gfcn2v3aq9nt.jpg" alt="GrafanaLogin" width="800" height="752"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;In the &lt;strong&gt;Username&lt;/strong&gt; and &lt;strong&gt;Password&lt;/strong&gt; boxes, type &lt;code&gt;admin&lt;/code&gt;, and click &lt;strong&gt;Log in&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Both the username and password has been configured to admin. You can change them as necessary.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Database registration
&lt;/h3&gt;

&lt;p&gt;Follow these steps to register the &lt;code&gt;sampleDB&lt;/code&gt; database that was created in the step Configuring the database, in Grafana.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;On the left pane, click the gear icon, navigate to &lt;strong&gt;Configuration &amp;gt; Data Sources&lt;/strong&gt;, and then click &lt;strong&gt;Add data source&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw1j9is7e39ungrvp3q45.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw1j9is7e39ungrvp3q45.jpg" alt="AddDataSource_grafana" width="800" height="469"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select InfluxDB.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7gc4piadbk8469hbl4lu.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7gc4piadbk8469hbl4lu.jpg" alt="Image description" width="800" height="161"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The settings page appears.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Enter the following details and click &lt;strong&gt;Save &amp;amp; test&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Setting name&lt;/th&gt;
&lt;th&gt;Setting value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;URL&lt;/td&gt;
&lt;td&gt;&lt;a href="http://localhost:8086/" rel="noopener noreferrer"&gt;http://localhost:8086/&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Database&lt;/td&gt;
&lt;td&gt;sampleDB&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyex4x9pcoymk4rtnb9h7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyex4x9pcoymk4rtnb9h7.jpg" alt="URL" width="800" height="251"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvco9zyt3e4fstshj02pw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvco9zyt3e4fstshj02pw.jpg" alt="SaveandTest" width="800" height="658"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Visualizing time-series data
&lt;/h3&gt;

&lt;p&gt;In this example, we show you how to create a dashboard and display the collected time-series data in graphs such that:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Values of holding register 2 are displayed in line graphs as raw data&lt;/li&gt;
&lt;li&gt;Values of holding register 3 are displayed as the average of values every minute&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Follow these steps to create the dashboard:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;On the left pane, click the &lt;strong&gt;+&lt;/strong&gt; icon, select &lt;strong&gt;Create &amp;gt; Dashboard&lt;/strong&gt;, and then click &lt;strong&gt;Add a new panel&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu6gr4cnichb3tsl3g4cp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu6gr4cnichb3tsl3g4cp.jpg" alt="NewDashboard" width="800" height="396"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Configure the graph settings for the holding register 2 as shown in the screen below, and click &lt;strong&gt;Apply&lt;/strong&gt;.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw1zs4n4xdshcptx5q99t.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw1zs4n4xdshcptx5q99t.jpg" alt="GraphSettings" width="800" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: You can click the &lt;strong&gt;Edit&lt;/strong&gt; icon and enter following query to configure query settings.&lt;br&gt;
&lt;code&gt;SELECT "holding_register_2" FROM "sample_measurement" WHERE $timeFilter&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Repeat steps 1-2 to create a bar graph for holding register 3 (holding_register_3) and configure the settings as shown in the image below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmp2m15dcax95zliq5kux.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmp2m15dcax95zliq5kux.jpg" alt="HoldingRegister3_graph" width="800" height="448"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: You can also configure the query settings with the following query command.&lt;br&gt;
&lt;code&gt;SELECT mean("holding_register_3") FROM "sample_measurement" WHERE $timeFilter GROUP BY time(1m)&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Visualizing Boolean data
&lt;/h3&gt;

&lt;p&gt;Follow these steps to display the latest status of coil 1.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Add panel&lt;/strong&gt; to add a panel.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Select &lt;strong&gt;Stat&lt;/strong&gt; from the right-side menu and configure the settings as shown in the image below.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7cdhrsc8myczuh061sxy.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7cdhrsc8myczuh061sxy.jpg" alt="False" width="800" height="472"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: You can also configure query settings with the following query command.&lt;br&gt;
&lt;code&gt;SELECT "coil_1" FROM "sample_measurement" WHERE $timeFilter&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;When all the operations are completed, the following screen is displayed.&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx9lvoz5iwlmqyv5lr49x.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx9lvoz5iwlmqyv5lr49x.jpg" alt="True" width="800" height="343"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click &lt;strong&gt;Save dashboard&lt;/strong&gt; to save the dashboard.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This article described how to collect data through Modbus communication using Python, store the data in InfluxDB, and visualize data in Grafana on the Edge device.&lt;/p&gt;

&lt;p&gt;This article is useful when you want to visualize data locally, without having to save the data in external systems.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://www.yokogawa.com/solutions/products-platforms/control-system/ert3-embedded-controller/#Overview" rel="noopener noreferrer"&gt;AI platform for industries | Yokogawa Electric Corporation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://grafana.com/docs/grafana/latest/installation/debian/" rel="noopener noreferrer"&gt;Install on Debian/Ubuntu | Grafana Labs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.influxdata.com/influxdb/v1.8/introduction/install/" rel="noopener noreferrer"&gt;Install InfluxDB OSS | InfluxDB OSS 1.8 Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/riptideio/pymodbus" rel="noopener noreferrer"&gt;GitHub - riptideio/pymodbus: A full modbus protocol written in python&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>ert3plus</category>
      <category>modbus</category>
      <category>influxdbgrafana</category>
      <category>python</category>
    </item>
  </channel>
</rss>
