How to Use ThingsPro Gateway to Publish Processed Edge Data to the AWS IoT Cloud. 1 Background Requirements Overview...

Similar documents
How to Build an IoT Application with Moxa's ThingsPro and AWS IoT Service

How to Upload Device Data to a Remote Database Using the Log Upload Function

How to Build a Real-Time IIoT Application with Moxa's ThingsPro and Cirrus Link's Sparkplug

Getting Started with the Google Cloud SDK on ThingsPro 2.0 to Publish Modbus Data and Subscribe to Cloud Services

ThingsPro Version 2 User s Manual

Using a RESTful API to Connect to Remote I/Os

ThingsPro Software User s Manual

ThingsPro Software User s Manual

ThingsPro Software User s Manual

ThingsPro Software Suite Version 2 User s Manual

Connecting the iologik 2000 to a SolarWinds NPM

Building a Future-Proof Data- Processing Solution with Intelligent IoT Gateways. Johnny T.L. Fang Product Manager

1. System Topology Required Equipment and Components Hardware Equipment Software Equipment... 6

2013 Moxa Inc Released on Sep 15, 2013

1. System Topology Required Equipment and Components PcVue SCADA Modbus Slave MGate 5109 Setting...

Moving Your Application on the Raspberry Pi to the UC-8100-LX Computer. 1 Background Requirement Overview System Environment...

Boost Your IIoT Development. An intelligent platform for data acquisition and device management

3 Major Considerations to Bring Industrial IoT to Reality Péter Bóna, CEO, Com-Forth Kft. Budapest, 15th May 2018

1 Application Description System Topology Hardware and Software Requirements About KingSCADA

EtherNet/IP Configuration for a Moxa MGate 5105-MB-EIP and an Allen-Bradley CompactLogix L32E. Copyright 2013 Moxa Inc Released on July 15, 2013

How to Use the TIA Portal to Set a Siemens PLC and the MGate 5103

MX-AOPC UA Server User s Manual

How to Configure the MGate 5114 with IEC SCADA. 1 System Topology Protocol Simulators... 4

How OPC UA Software Enhances Big Data Integrity for IIoT SCADA Systems. Charles Chen Product Manager

IIoT Edge Gateway Application Guidebook

MX-AOPC UA Server User s Manual

iologik E2200 Series Smart Ethernet remote I/O with Click&GO Logic Introduction Remote I/O PC-Free Alarm and Control Intelligence

Replacing the AB 1761-NET-ENI with the MGate EIP3000 to perform an EIP-to-DF1 conversion

Arm-Based Linux IIoT Gateway Application Guidebook

How to Upgrade or Recover the Firmware of the UC-7400 Series Embedded Computers

Using NI LabVIEW with iologik E2210 servers

OnRISC. IoT Manual. Vision Systems GmbH. Edition: October 2017

iologik 4000 Series User s Manual

cmt-g01 with OPC UA Server and Modbus Gateway

WHITE PAPER. How to Select a Cellular RTU for Water and Wastewater Applications. Charles Chen Product Manager Moxa Inc.

iologik 4000 Series User s Manual

New Technology Automates Arduous Modbus Routing Setup in Gateways. Dr. Sean Chen Product Manager

Enabling Mobility in Network Monitoring. Yiwei Chen Moxa Product Manager

iologic E1200 Series Remote Ethernet I/O with 2-port Ethernet Switch Introduction Industrial I/O

WebNMS IoT Cloud Gate Deployment Guide

AWS IoT Overview. July 2016 Thomas Jones, Partner Solutions Architect

HARTING OPC-UA Gateway for MICA User Manual

Connect Different Protocols It s Quick, Easy, and Reliable

Moxa Inc. Moxa Americas Moxa China Shanghai Office Beijing Office Moxa Europe Shenzhen Office Moxa Asia-Pacific

iologik E4200 User s Manual

ElasterStack 3.2 User Administration Guide - Advanced Zone

IoT Starter Kit Part 3: Connect to the cloud AWS IoT. 1 Local network

iologik E1261W-T User s Manual

Libelium-AWS Development Kit. Quick Start Guide

Contents. Technical Information

Five Key Considerations When Implementing Secure Remote Access to Your IIoT Machines. Blanch Huang Product Manager

iologik E1200 Series Ethernet remote I/O with 2-port Ethernet switch Introduction Remote I/O

Methods for Embedding Video Streams in SCADA Systems

SMG-1100/6100 User s Manual

iologik E1200 Series Ethernet remote I/O with 2-port Ethernet switch Introduction Remote I/O Daisy-Chained Ethernet I/O Connection

Wiring & Configuration for AE Solaron Inverters

Getting Started with Octoblu

Introduction to RTU Controllers

iologik Active Ethernet Modular I/O User s Manual

UWP 3.0 WEB APP INSTRUCTION MANUAL. Sep. 18

iologik E1200 Series User s Manual

Industrial Automation Tech Note 52

E2000 Series Active Remote I/O

Flexy Industrial IoT Router & Data gateway. Unlock your remote data. Think Flexy!

YWireless-RX65N Smart Home Gateway Getting Started Guide

iologik E1200H Series

How can you implement this through a script that a scheduling daemon runs daily on the application servers?

CPM. Quick Start Guide V2.4.0

Swift Web Applications on the AWS Cloud

iologik E4200 User s Manual

IoT Gateway PTC Inc. All Rights Reserved.

iologik R1200 Series User s Manual

Service Portal User Guide

iologik R1200 Series User s Manual

FAQs. Business (CIP 2.2) AWS Market Place Troubleshooting and FAQ Guide

Tech note. E*4080 IP Gateway Amazon Web Services MQTT Quick Start

Getting Started with AWS IoT

Features and Benefits. Certifications

Features and Benefits. Certifications

Oracle 1Z Oracle Cloud Solutions Infrastructure Architect Associate.

iologik E1200 Series User s Manual

iologik 2500 Series Quick Installation Guide

MGate EIP 3000 Series to connect RSLinx with the. Allen-Bradley SLC 500/Micrologix family

iologik 2500 HSPA/GPRS/WLAN Series

Advanced Architecture Design for Cloud-Based Disaster Recovery WHITE PAPER

DOWNLOAD OR READ : WEB 20 GOOGLE APP ENGINE PDF EBOOK EPUB MOBI

UA-5000 Series User Manual

Industrial Automation Tech Note 51

Using LCS Help. In This Section

Understanding the V4.09 Firmware Upgrade for 2500P-ACP1

IT and Instrumentation for industry. Modular RTU Controller: IoPAC 8000 Series. Cellular RTU Controller: iologik W5300 Series

MW100 Setting for Data Communications via Modbus Protocol. Connect to Ethernet. Enter Ethernet settings. Enter Server Settings

User manuals, product updates, and other information are available on the GE Customer Care support website,

Using NI LabVIEW with iologik E2210 servers

Ethernet Convergence in Mobile Oil and Gas Applications. Mike Werning Field Application Engineer, Moxa Americas

XCONNECT 2018 GATEWAY USER MANUAL

One Gateway That Can Do It All

based on a previously created custom model an entirely new model

S u p p l e m e n t TQS3 MODBUS. Description of product modification with MODBUS RTU. 31. March 2008 w w w. p a p o u c h.

Arm Mbed Edge. Shiv Ramamurthi Arm. Arm Tech Symposia Arm Limited

Transcription:

Processed Edge Data to the AWS IoT Cloud Miles Wang Contents Application Engineer miles.wang@moxa.com 1 Background... 2 2 Requirements... 2 3 Overview... 2 3.1 Creating Custom Tags/Registers... 2 3.2 Setting Up a Modbus TCP Device... 3 3.3 Running a Program to Read and Publish Data from the Device to the AWS IoT Cloud... 5 3.4 Enabling the AWS IoT Client in the ThingsPro Gateway... 9 3.5 Checking the Data on AWS IoT... 10 4 Additional Reading... 12 Copyright 2017 Moxa Inc. Released on August 31, 2017 About Moxa Moxa is a leading provider of edge connectivity, industrial computing, and network infrastructure solutions for enabling connectivity for the Industrial Internet of Things. With over 30 years of industry experience, Moxa has connected more than 50 million devices worldwide and has a distribution and service network that reaches customers in more than 70 countries. Moxa delivers lasting business value by empowering industry with reliable networks and sincere service for industrial communications infrastructures. Information about Moxa s solutions is available at www.moxa.com. You may also contact Moxa by email at info@moxa.com. How to Contact Moxa Tel: +886-2-8919-1230 Fax: +886-2-8919-1231

1 Background Moxa s ThingsPro Gateway provides a convenient way to acquire device data through Modbus RTU or Modbus/TCP protocol. In addition, you can create your own data tags and automatically transmit processed data to a remote IoT cloud using the ThingsPro Gateway software. 2 Requirements ThingsPro Gateway software installed on an eligible Moxa device (e.g., UC-8112-LX) AWS IoT user account 3 Overview In this tech note, we explain how you can take advantage of the Custom Equipment Management function in ThingsPro Gateway to read temperature values from a device via Modbus/TCP protocol and publish the current temperature, the highest temperature, and lowest temperature values to the AWS IoT cloud using the following steps: Creating Custom Tags/Registers Setting Up a Modbus TCP Device Running a Program to Read and Publish Data from the Device to the AWS IoT Cloud Enabling the AWS IoT Client in the ThingsPro Gateway Checking the Data on AWS IoT 3.1 Creating Custom Tags/Registers To create the custom tags required for this project, do the following: 1. Connect to the ThingsPro Gateway homepage using the Chrome browser. 2. In the main menu, click MODBUS & Logging and select the EQUIPMENT TEMPLATE tab. 3. In the Custom Equipment Management section, click to open the Edit Custom Equipment page 4. Fill in a name of custom equipment ( iologik-temperature-sensor in this example) 5. Add three custom tags current-temp, max-temp, and min-temp as shown in Figure 1. Copyright 2017 Moxa Inc. Page 2 of 12

Note: The custom tags created here are used in the example code in Section 3.3. Figure 1 6. Click SAVE 3.2 Setting Up a Modbus TCP Device 1. In the main menu, click MODBUS & Logging and select the MODBUS DEVICE tab. 2. Click on the MODBUS/TCP tab. 3. Click to open Edit TCP Interface Settings page. 4. Specify the Interface Name, Host IP, Port, Interval, and Response Timeout values for the TCP interface. The Host IP is the IP address of Modbus TCP Server. In this example, a temperature sensor is connected to an iologik E1260, which allows a Modbus client in the ThingsPro Gateway to pull temperature values via the Modbus TCP protocol at time intervals specified in the Interval field (unit: millisecond). See Figure 2 for an example configuration. Copyright 2017 Moxa Inc. Page 3 of 12

Figure 2 5. Click SAVE A new item, my_iologik-e1260 is created in TCP List. Figure 3 Copyright 2017 Moxa Inc. Page 4 of 12

6. Click corresponding to the my_iologik-e1260 device to open the Edit Device page. 7. In the Template field, select the built-in template iologik-e1260 8. Specify the Device Name (iologik-ai0 in this example). Note: The device name, iologik-ai0, specified here has been used to read the Modbus TCP values in the example code in Section 3.3. Figure 4 3.3 Running a Program to Read and Publish Data from the Device to the AWS IoT Cloud We have created an example Python program to read Modbus TCP temperature value every five seconds and publish the value of a user-defined tag (max-temp) value to ThingsPro Gateway s MQTT server if the current temperature value is higher than the maximum value it has recorded. ThingsPro Gateway will then publish this maximum temperature value to AWS IoT cloud. A similar approach is used to transmit the minimum temperature to the AWS IoT cloud. Copyright 2017 Moxa Inc. Page 5 of 12

To run the example program, do the following: 1. Copy and save the sample code given below in the /home/moxa/usertag-example.py file on the UC-8112-LX computer. Note: At the beginning of the example code, you must call the Moxa proprietary library libmxidaf_py to import the modules Modbus, TagV2, Tag, Time and Value to enable your program to read Modbus data from the ThingsPro Gateway. For more detailed information on the data acquisition API, refer to ThingsPro Programmer s Guide. ------------------------------------------------------------------- usertag-example.py ------------------------------------------------------------------- #!/usr/bin/env python import time from libmxidaf_py import Modbus, TagV2, Tag, Time, Value modbus = Modbus.instance() tagv2_tmin = TagV2.instance() tagv2_tmax = TagV2.instance() tagv2_t = TagV2.instance() global tmin, tmax tmin=50 # minimum temperature tmax=0 # maximum temperature def update_tmin(): global tmin if (tag.value().as_float()<tmin): tmin=tag.value().as_float() # update user tag "min-temp" at = Time.now() Copyright 2017 Moxa Inc. Page 6 of 12

tagv2_tmin.publish( "iologik-temperature-sensor", "min-temp", Tag( tag.value(), at, "C") ) print 'tmin: ' print (tmin) def update_tmax(): global tmax if (tag.value().as_float()>tmax): tmax=tag.value().as_float() # update user tag "max-temp" at = Time.now() tagv2_tmax.publish( "iologik-temperature-sensor", "max-temp", Tag( tag.value(), at, "C") ) print 'tmax: ' print (tmax) Copyright 2017 Moxa Inc. Page 7 of 12

def update_t(): # update user tag "current-temp" at = Time.now() tagv2_t.publish( "iologik-temperature-sensor", "current-temp", Tag( tag.value(), at, "C") ) print (tag.value().as_float()) while (True): tag = modbus.read("iologik-ai0", "rtdi0") # A temperature sensor is connected to iologik AI0. The tag name rtdi0 is pre-defined in template iologik-e1260 in EQUIPMENT TEMPLATE to read temperature value. update_tmin() update_tmax() update_t() time.sleep(5) 2. Log in to the UC-8112-LX via the serial console or SSH. 3. Create an executable Python script using the command: moxa@moxa:~$ chmod +x usertag-example.py 4. Run the Python program using the following command: moxa@moxa:~$./usertag-example.py Copyright 2017 Moxa Inc. Page 8 of 12

3.4 Enabling the AWS IoT Client in the ThingsPro Gateway Follow the instructions in the ThingsPro Software Suite User s Manual to configure the AWS IoT client on the ThingsPro Gateway. The AWS IoT Client configuration window can be accessed from the main menu and is listed under the Applications section. Make sure you enable the AWS IoT on ThingsPro Gateway as per the example shown in as shown in Figure 5. Figure 5 Copyright 2017 Moxa Inc. Page 9 of 12

3.5 Checking the Data on AWS IoT You can subscribe the topic of your interest on the AWS IoT Console. In order to subscribe to the data acquired in the example illustrated in this document, type the topic, $aws/things/uc-8112_demo/shadow/update/iologik-temperature-sensor/# in the Subscription topic field on the MQTT client page and click Subscribe to topic, as shown in Figure 6. Note: The strings marked in red in the subscription topic will vary based on the AWS IoT Thing Shadow for your device. Figure 6 Once you subscribe to the topic, you will be able to view the max-temp, min-temp, and current-temp data on the AWS IoT console as shown in Figure 7, Figure 8, and Figure 9. Figure 7: User tag data (max-temp) Copyright 2017 Moxa Inc. Page 10 of 12

Figure 8: User tag data (min-temp) Figure 9: User tag data (current-temp) Copyright 2017 Moxa Inc. Page 11 of 12

3.5.1 Deploying Your Custom Program on ThingsPro Gateways Once you have completed developing your own program development, follow the instructions given in the previous sections of this document to create the required custom tags. You can then run your program permanently using the User Programs function provided in the ThingsPro Gateway. Refer to chapter Managing User Programs in the ThingsPro Software Suite User s Manual for details. If you want to deploy this program to a group of ThingsPro Gateways located at different field sites, you can export the settings from the ThingsPro Gateway which has the right configuration by using ThingsPro Device Enablement Utility and use the Restore function provided by the ThingsPro Server to push the configuration to the ThingsPro Gateways in the group. Refer to the chapter Restoring the Configuration Setting for a Device Group in the ThingsPro Software Suite User s Manual for details. 4 Additional Reading ThingsPro Programmer s Guide https://www.moxa.com/support/downloadfile.aspx?type=support&id=14768 Latest version of the ThingsPro Software Suite User s Manual available at: https://www.moxa.com/support/sarch_result.aspx?prod_id=5151&type_id=7&type=doc Copyright 2017 Moxa Inc. Page 12 of 12