Arduino Forum

Community => Products and Services => Topic started by: martinius96 on Nov 22, 2019, 08:48 pm

Title: OPC-UA - (ESP8266, ESP32, Arduino + Ethernet)
Post by: martinius96 on Nov 22, 2019, 08:48 pm
I introduced OPC-UA architecture in more detail in the last published article. Today, I would like to extend the original article to include information and insights in the actual implementation. The implementation includes standard client -> server communication, using various types of clients.

As for servers, they work on standard HTTP protocol 80, they differ mainly in operating modes, and they can operate on an existing LAN network as STATION, or they can broadcast their own encrypted WiFi network - AP mode - under WPA / WPA2 - PSK (Only applies to ESP8266 and ESP32).

To demonstrate such an OPC-UA architecture, I have chosen up to three platforms that can be combined into this architecture. These are the WiFi chips ESP8266 and ESP32, which provide WiFi connectivity and for Ethernet representative Arduino with the most famous Ethernet modules Wiznet W5100, W5500.
(https://i.imgur.com/j4XtFpS.jpg)
In my own implementation, I tried to create a full-fledged OPC-UA sensor system. The webserver receives data from the client - the ADC value of the converter, and distributes this data to other clients, so called. Subscribers who ask for this information by appropriate request. The system is very interesting as it can be implemented also in sensory networks, automation.

All data in the system is accessible in real time. The data is not stored, running on the webserver in its RAM memory. Webserver is also used for human interaction, as it is possible to connect to it from the browser, while it is possible to browse the data or control outputs via HTML page and its elements. The HTML page can also incorporate a simple SCADA visualization with the possibility of control through this visualization.

In implementation I used simple examples for HTTP webserver for each microprocessor architecture. I later extended the examples for the expected "requirements" (their form) to specific GET subpages. By implementing for all platforms, I managed to build a simple communication network that is multiplatform. I.e. If the Arduino webserver is equipped with an Ethernet shield, we can use the ESP8266 or ESP32 development boards as clients, as well as vice versa with a webserver on ESP platforms.

A simple block diagram represents the proposed architecture:

(https://i.imgur.com/heQ24T0.jpg)
Server queries:

OPC-UA (Two ESP8266 and Windows Client communication)
https://www.youtube.com/watch?v=pxey3PC_u8s (https://www.youtube.com/watch?v=pxey3PC_u8s)
Title: Re: OPC-UA - (ESP8266, ESP32, Arduino + Ethernet)
Post by: martinius96 on Apr 07, 2020, 11:27 pm
Previous post is outdated...
Updated info below:
There is new concept for Web-service OPC-UA architecture that I am using.
Supported platforms:

Block schematics of my OPC-UA solution:
(https://i.imgur.com/P4wa5WS.jpg)
Webservers are now implemented only in STATION modes.
Payload is based on XML (SOAP) datas, from where webserver / client is parsing them.
Datas are sent under HTTP POST method only (NO GET MORE).
Locations (webpages) at webserver:



Types of clients implemented in the project:


Publish Client UDP is no longer supported.
Datas that user see (root page - /) with received datas throught /body
(https://i.imgur.com/V4Ulv8D.png)
Webserver response to Subscriber client (Publisher is sending same XML document in payload [with new values and so on])
(https://i.imgur.com/qg07edU.png)

Codes for Webservers, and Webclients are fully compatible (working funcionality is same). Webclients can communicate only with OPC-UA webservers in that webaplication. They are not able to connect to PLC or some type of industrial OPC-UA server. They are not using TCP (binary) OPC-UA protocol! This is based on web-service OPC-UA (another architecture). Implementations are using in-built webserver, they are not using Async webservers and so on. This solution is the most lightweight as can be.

You can donate project for more examples, advanced implementations with using certificates, HTTPS connection, and so on (I am doing it for free at late evenings...): https://www.paypal.me/chlebovec (https://www.paypal.me/chlebovec)

Source codes are available under MIT LICENSE (https://github.com/martinius96/OPC-UA-Arduino-ESP8266-ESP32/blob/master/LICENSE) at my Github repository: https://github.com/martinius96/OPC-UA-Arduino-ESP8266-ESP32/ (https://github.com/martinius96/OPC-UA-Arduino-ESP8266-ESP32/)

More info about Web-service OPC-UA at my webpage: https://arduino.php5.sk/opc-ua-esp8266.php?lang=en (https://arduino.php5.sk/opc-ua-esp8266.php?lang=en)

NOT LONGER AVAILABLE