Talk2M The IIoT cloud developer platform

Jean-Paul CORMANN [email protected]

May 2016 – V1.1 eWON Flexy

• eWON Flexy = the IIoT router developer platform

• IOserver • Data collection • Alarm notification • Custom web pages / Reporting • Basic scripting • ETK (& Java IOserver) • …

=> Data available on the eWON Customer requests/needs

• I want to access my data remotely. • I need an application to monitor the data of all my remote devices. • The application should run on my PC but also on my tablet, , … • Transform the raw data in some nice looking KPI • And in some cases, it would be great if I could interact with my devices on the remote side. As a developer…

• You know how to: • Develop nice front end applications • Put data into a database • Transform raw data into KPI • etc.

• But how to get the remote data into my application, into my database ? Collect remote data (push method) What is the pain?

• Hosting a public Internet server • Requires IT skills and infrastructure: - Server facing the Internet - Public IP - Firewall - SSL certificate for secure connections What is the pain?

• Manage data synchronization • Only send new data! • Handle duplicated history samples, etc.

• Remote control ? • How to interact with a device on remote side Talk2M The IIoT cloud developer platform Talk2M Talk2M Remote access solution • eCatcher • Talk2M VPN client and configuration tool • Establishes a VPN tunnel between your PC and the remote LAN • Allows remote maintenance of any device connected to eWON (Ethernet, serial, MPI, USB)

• M2Web • is the HTTPS web portal to Talk2M. • Allows connecting to Web Server of your eWON and local devices (PLC, HMI, Camera) • Works on any platforms (PC, Tablets, Phone…)

Let’s connect our eWON to Talk2M … Talk2M APIs (developer platform) • Talk2M APIs : • RESTful API • Requests performed using HTTPS • Answers received in straightforward Json-based format ⇒Supports all usual programming languages & platforms

• Requirements : • Developer ID (ex: 61d88c56-6976-4d3e-ad4e-a79dde788010) - to identify the developer

• Talk2M account login (Talk2M account name, user, password) - to grant access to the customer’s remote devices (= eWONs) 2 types of Talk2M API: DMWeb & M2Web

• DMWeb API • To synchronize historical data of eWONs: - Historical logging - Historical alarms • Easy and straightforward way to retrieve new field data

• M2Web API • To access the web server of : - eWON - Any Ethernet devices connected to the eWON. • Easy way to interact with your device (read / write) Talk2M DataMailbox (DMWeb API) Talk2M DataMailbox

• Temporary storage for tags and alarms history • eWON pushes the data to the DataMailbox of the account • Easy and straightforward way to retrieve new historical data • Remember your old mailbox managed by your ISP Talk2M DataMailbox Benefits

• No need to host a public Internet server • Only outgoing https requests to get the data

• DMWeb: A super-easy data synchronization protocol • In one call, retrieve the new data

• Push – Pull Method: • Everyone (each eWON & your application) synchronizes at their own pace • No need of permanent connection Talk2M DataMailbox DMWeb API

• Goal: Download data from the DataMailbox Server

• HTTPS-based • Base URL : https://data.talk2M.com/ • Credentials : t2maccount, t2musername, t2mpassword, devid • Methods: - getewons, getewon - getdata: retrieve historical data using criteria (date, tag, ewon) - delete, clean - syncdata: download all NEW historical data without duplicates DMWeb API syncdata

syncdata ? create Transaction

Historical Data + transaction Id = 1234 …

syncdata ? create Transaction & last Transaction Id = 1234

New Data + transaction Id = 4567 + more data available Data Mailbox Server syncdata ? create Transaction & last Transaction Id = 4567 … Example

https://data.talk2m.com/syncdata?t2maccount=myaccount&t2musername=myname &t2mpassword=mypassword&t2mdevid=61ddac56-6976-4d3e-ad4e-a79dde788010 &createTransaction&lastTransactionId=4567

ZIP Show Time… DataMailbox Viewer

• Development tool: • for demo purposes • to easily generate the URL for the API requests • displays the result of the request

The software is available on developer.ewon.biz.

Let’s check on an existing DataMailbox … eWON configuration

1. Create Tags to acquire data from the field • Embedded IO-Servers for standard protocols

• Basic Scripting or Java EDK for custom protocols

2. Enable historical logging of tags • Store on value changes or on time interval

3. Configure the push data to the DataMailbox • Setup the Talk2M connection (using wizard) • Define URL: ewondata.talk2m.com • Define upload interval • Define Tag filter (only export important data)

Let’s check the result inside the DataMailbox … Use case

• Use case with a SCADA/Historian software • Ignition: SCADA by

• Ignition contains/allows: • Internal scripting engine (python script language) • HTTPS requests • Json decoder

• Using the DMWeb API “syncdata” retrieve data from the DataMailbox and insert it into Ignition Tag historian DMWeb API Summary Talk2M DataMailbox = Data Collection + Easy

• DataMailbox: We do NOT store customer data • The Data Mailbox is a temporary buffer • This is why we call it a mailbox remember your old mailbox managed by your ISP • Implemented as a circular buffer with a maximum retention of 10 days - Data older that 10 days are automatically deleted - Use DMWeb API Delete method to delete data after synchronization

• Use cases • Historians • Business Intelligence solutions • Reporting tools M2Web API M2Web API

• The M2Web API allows you to access the web server of : • eWON • Any devices connected to an eWON. M2Web APIs Syntax

• Base URL : https://m2web.talk2M.com/t2mapi/...

• Example of parameters & methods: • t2mapi/getaccountinfo • t2mapi/getewons?[&pool=...] • t2mapi/getewon?name=... • t2mapi/wakeup?name=... • t2mapi/sendoffline?name=... • t2mapi/get//? • t2mapi/get//proxy//? Example

https://m2web.talk2m.com/t2mapi/getewons?t2maccount=myaccount &t2musername=myname&t2mpassword=mypassword&t2mdeveloperid =61ddac56-6dde-4d3e-ad4e-a79dde788010 M2Web APIs & eWON

How can I act on my eWON through the M2Web API ?

• M2Web APIs allow the access of any eWON’s web resources. • eWON provides many web forms that give the possibility to : • Get eWON files, tag values, alarms history, user files,… through Export Block Descriptors • Write Tag values (Memory Tags as well as PLC Tags) • Acknowledge alarms • Execute a script • … See « Web Reference Guide » on our support website Export Block Descriptor

• Export Block Descriptor = string defining data to export from eWON

• EBD Syntax = successive parameters having following structure : $xxYY Where xx is the parameter name YY is the parameter value

• EBD examples: • $dtIV $ftH => realtime values in text format • $dtHT $ftT $st_h2 $et_m0 => historical of last 2 hours • $dtUF $uf/myfile.xyz => export a file of the /usr directory

• There are mainly 3 kind of parameter to define : • The type of data to export (Instant value, Logs, Historical logging,…) • The format of the export (binary, text, HTML) • In case of timestamped data, the timeframe to export. M2Web API & eWON Example Get Instantaneous Tag values through M2Web API

eWON Web Form to execute an EBD: The EBD to export realtime data (tags): http://10.0.0.53/rcgi.bin/ $dtIV$ftT ParamForm?AST_Param=

Execute an EBD when locally connected to eWON : http://10.0.0.53/rcgi.bin/ParamForm?AST_Param=$dtIV$ftT

Execute an EBD through the M2Web API : https://m2web.talk2m.com/t2mapi/get/eWONName/rcgi.bin/ParamForm?AST_Par am=$dtIV$ftT &t2maccount=MyTalk2MAccount &t2musername=MyTalk2MUser &t2mpassword=MyTalk2MPassword &t2mdeveloperid=61ddac64-6ade-493e-ad4e-a79dde788010 &t2mdeviceusername=eWON_Username &t2mdevicepassword=eWON_Password .NET Library

• A .NET library is available to ease the job of .NET developers. It exposes the M2WebAPI features through a .NET object model, including the communication with the eWON. .NET Library Example

var m2web = new M2Web { Talk2MDevId = "TODO: YOU-GUID-COMES-HERE", AccountName = "TODO: YOUR ACCOUNT NAME COMES HERE", Username = "TODO: YOUR USERNAME NAME COMES HERE", Password = "TODO: YOUR PASSWORD NAME COMES HERE", };

Console.WriteLine("Retrieving list of eWONs..."); m2web.LoadEwons();

Console.WriteLine("Online eWONs:"); var onlineEwons = m2web.Ewons.Where(ewon => ewon.Status == EwonStatus.Online); foreach (var ewon in onlineEwons) Console.WriteLine(ewon.Name + (!string.IsNullOrEmpty(ewon.Description) ? " ("+ewon.Description+")" : ""));

Console.WriteLine("Strike to continue..."); Show Time… eWON configuration

• Setup the Talk2M connection (using wizard). • Nothing further to configure. Web forms are already existing on the eWON.

Let’s check this on our eWON, using a for demonstration …

Example 1 : Display the eWON-list of my Talk2M account

Example 2 : using EBD retrieve instant values

Example 3 : using EBD retrieve a /usr file

Example 4 : access device behind eWON Small monitoring app

• Goal: Using M2Web API, we turn on/off the light on our demo Rack

• Developed using C#.NET and console output to demonstrate / interact with the user. M2Web API Summary

• To access the web server of : • eWON • an Ethernet device connected to the eWON.

• Use cases • Monitoring Mobile Apps • Remote Control Applications • Remote Management of eWON Almost over… We hope we could convince you that…

eWON Flexy = your IIoT router developer platform

Talk2M = your IIoT cloud developer platform Where to start from…

• Flexthink starter KIT

• Developer web site: https://developer.ewon.biz/

• Developer forum: https://techforum.ewon.biz/ • Exchange info • Ask eWON and Talk2M related developer questions Thank you!