Skip to content

etm/opcua-smart

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OPC-UA Ruby Bindings (open62541)

The development of OPC UA applications takes currently a lot of effort. This is caused by the large possibilities of the OPC UA specification. With this implementation we want to define some conventions, which shoud make the technology more useable.

Table of Contents

  1. Modelling Style
  2. COPYING
  3. Installation from Repositories
  4. Installation from Source
  5. Examples
    1. Server
      1. Create Server and Namespace
      2. Create ObjectTypes 1.Add Variable 2.Add Object 3.Add Method
      3. Manifest Objects
      4. Find Nodes in the Addressspace
      5. Loop for getting Real Life Data
    2. Client

Modelling Style

The idea of the opcua-smart library is to simplify the OPC UA application generation. Since OPC UA has more than 1500 pages of basic specifications, and the number is still growing, we decided to make some simplification.

This is done by some constraints regarding the modeling functionality of OPC UA. This library deliberately does not offer all functions of OPC UA to simplify the creation of applications.

COPYING

Copyright (C) 2019-* Jürgen "eTM" Mangler [email protected]. opcua-smart is freely distributable according to the terms of the GNU Lesser General Public License 3.0 (see the file 'COPYING'). This code is distributed without any warranty. See the file 'COPYING' for details.

Installation from Repositories (Simple)

Tested for for Ubuntu >= 21.04 and Fedora >= 33.

# Debian/Ubuntu
sudo add-apt-repository ppa:open62541-team/ppa
sudo apt-get update
sudo apt-get install build-essential libopen62541-1-dev
# Fedora/Redhat
sudo dnf install @buildsys-build @development-tools open62541-devel

After that as user

gem install --user opcua

Installation from Source (Advanced)

If open62541 is not included in your distribution, then you can compile and install from source (e.g. if you are running on an old LTS version of ubuntu).

# Debian/Ubuntu
sudo apt install build-essential cmake-curses-gui libmbedtls-dev libxml2-dev libxslt-dev libz-dev libssl-dev libicu-dev
# Fedora/Redhat
sudo dnf install @buildsys-build @development-tools cmake libxml2-devel libxslt-devel zlib-devel libicu-devel mbedtls-devel

Dependency: https://github.com/open62541/open62541 > 1.1 (master branch as of 2020-06-04)

git clone https://github.com/open62541/open62541.git
cd open62541
mkdir build && cd build
cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_ENABLE_AMALGAMATION=ON -DUA_ENABLE_ENCRYPTION=ON -DUA_ENABLE_ENCRYPTION_MBEDTLS=ON ..
make
sudo make install
gem install --user rake opcua

If you get errors during compilation, please file an issue in github. Maybe the API open62541 API changed (constant improvements are happening).

If the installation works correctly, but examples are still complaining about missing lib62541.so, try this:

sudo echo "/usr/local/lib" >> /etc/ld.so.conf.d/local.conf # add to libs path
sudo echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local.conf # add to libs path
sudo ldconfig # update libs
sudo ldconfig -p | grep libopen62541