Small, simple but efficient open source OPC UA Server

In the previous post , i have described a way to build an OPC UA application on ESP32 development board. But for non coder users, it may be hard to adapt and use it easily. So i have implemented a configuration tool and made some changes in the firmware to make it more user friendly.

Before starting to tell you about how to use, i would like to rephrase that this is just a simple OPC UA server without any standardization certificates, so i strongly do not suggest to use it in production or in critical applications, it is completely users responsibility.

Alright so, opcua-server consists of two applications one is the firmware running on ESP32 and the other is the “Server Configurator”. After flashing firmware to the board, Server Configurator is intended to be used to configure the, connection type, IP of the OPC UA server and Wi-Fi credentials if you want to connect over Wi-Fi. Currently, static IP can only be set for ethernet connection.

Prerequisites

  • Hardware : Development is based on ESP32-EVB but any ESP32 board consisting of ethernet (not tested PoE boards) is expected to work. ESP32-EVB has also nice looking enclosure.
ESP32-EVB
ESP32-EVB with enclosure
  • If you want to build and flash to the board then it is required to have esp-idf cloned with submodules to your local.
  • If you are going to build “Server Configurator” from source, then you will need Python with these packages installed. This is not needed for released “Server Configurator”.

Flashing firmware to ESP32

Released packages contain firmware binaries to flash. You can directly download and flash to your development board, unfortunately flasher tool of Espressif systems is only supported in Windows.

You can download the flasher tool from Espressif’s tools page here;

Flasher tool from Espressif

Provisioning with Server Configrator

“Server Configurator” tool can be downloaded as zip file from projects releases. There are two executables depending on your operating system, download the zip according for your OS.

After you are successfully connected to the AP you should run the “Server Configurator”, set the Security to “AES-CTR” and enter the password as “abcd1234” (this can be changed statically).

Server Configurator
Server Configurator after a successful connection

You can set the connection type as “Wi-Fi” or “Ethernet”, as I said, static IP address can only be set for ethernet connection for now, click download to set the configuration in the server. After a successful download, download button will turn into green and its text will change as “Success”.

Server Configurator Download
Server Configurator after a successful download

Here we go, after you are successfully downloaded to device, OPC UA server will fire up and you will be able to connect over with a client of you choice. Please note that if you haven’t set a static IP address, you got to check for the IP of the ESP32 over your router. I would suggest to assign a IP address to the MAC address of your board from DHCP settings. So, you would not need to check it after each configuration.

Connected to server over UA Expert client

If you are using Linux or still want to build it from source then you got to follow the steps in here.

Resources

1 – https://github.com/cmbahadir/opcua-esp32

2 – https://github.com/cmbahadir/opcua-server

3 thoughts on “Small, simple but efficient open source OPC UA Server

  1. Olá, parabéns pelo tópico, muito bem explicado.
    Gostaria de saber se é possível fazer com que o ESP-32 se comunique como cliente, pois eu já possuo um outro dispositivo que é server, e gostaria de se conectar a ele com o ESP-32 como cliente.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s