quasar

quasar is a framework for rapidly developing OPC UA (Open Platform Communications Unified Architecture) servers. It provides tools and abstractions to simplify the process of creating industrial-grade OPC UA servers, which are widely used for secure, reliable data exchange in industrial automation and IoT applications. The quick opcua server generation framework.

For quick start-up, see our YouTube tutorial

Primary contact: quasar-developers@cern.ch

Versions

Changelog

Credits

This framework was developed through the collaborative efforts of the following:

  • Paris Moschovakos (paris.moschovakos@cern.ch):
    • quasar lead

    • Embedded and ARM64

    • quasar.docs.cern.ch

    • UaObjects, Cacophony

    • quasar Sanitizers

    • mule (SNMP optional module)

  • Piotr Nikiel (piotr.nikiel@cern.ch, piotr@nikiel.info):
    • Framework’s concept and architecture and code-generation

    • Address Space, Device and Configuration generation (XSLTs, design files, scripts, Jinja2-based rewrite)

    • CMake-based build system

    • RPM generation for Linux

    • Documentation and screencasts

    • Build configurations for Raspberry Pi, Zynq and MSVC10 on Wine

    • Yocto and PetaLinux support

    • CalculatedVariables, Cacophony, UaObjects…

    • quasar lead from its ground zero (2014) until Sep 2022

  • Stefan Schlenker (stefan.schlenker@cern.ch)
    • Use cases, ideas, optional modules mechanism

  • Benjamin Farnham (benjamin.farnham@cern.ch):
    • LogIt logging engine

    • Meta module

    • Use cases & ideas

  • Damian Abalo Miron (damian.abalo@cern.ch)
    • Windows compatibility and MSVC10 support

    • Python-based scripts and tools

  • Ingo Berg (external contributor not affiliated with CERN)
    • muParser formula parser and evaluation engine, used by the CalculatedVariables and shipped with quasar. (muParser’s webpage)

  • Viatcheslav “Slava” Filimonov (viatcheslav.filimonov@cern.ch):
    • XML Configuration (inspiration)

    • Calculation engine (inspiration)

    • Node manager

  • Cristian-Valeriu Soare
    • Embedded python module (PyEmbed)

  • Giordon Holtsberg Stark
    • quasar with Yocto on a “big” Zynq SoCs: ideas, consulting, development, testing

Installation and Dependencies

Note: we have specific instructions for the following operating systems:

For remaining systems (other distros of Linux, other Unix, embedded Linux: PetaLinux, Yocto)

Mandatory:

  • C++ compiler with C++11 support (gcc 11.x is the minimum)

  • OPCUA protocol stacks / toolkits (either of them is needed): - see More info on alternative backends.

  • Boost development libraries. (In principle, boost-regex, boost-devel, boost-thread and boost-program-options should be sufficient).

  • Python3 (3.6 is what we use at minimum) and some libraries (Jinja2, colorama, lxml, pygit2)

  • cmake3, version 3.10 + (for older versions you could try older quasar versions)

  • kdiff3 for occasional merges.

Quick setup hints for AlmaLinux 9 (the most standard way)

  1. Install latest epel realease

    sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm

  2. Install packages from AlmaLinux 9 default repos:

    sudo dnf install git patch python3-colorama python3-jinja2 python3-lxml cmake3 gcc-c++ boost-devel graphviz ninja-build xsd xerces-c-devel libxml2-devel openssl-devel doxygen astyle

  3. Download UaExpert for an universal test&dev tool for OPC UA.

Quick setup hints for Ubuntu 24.04 LTS

  1. Deploy from standard Ubuntu repos

    sudo apt install cmake g++ libboost-all-dev libxml2-utils astyle xsdcxx libxerces-c-dev libssl-dev kdiff3 default-jre libxml2-utils python-enum34 python-lxml python3-pip

  2. Deploy Jinja2

    pip3 install -U Jinja2 --user

Setup for Windows users

WindowsSetup.html

Tutorial

quasar has a pretty detailed tutorial for both newcomers as well as experienced users.
The tutorial is available at our YouTube channel:
The relevant playlist:

Optional modules

quasar is containing a list of built-in (mandatory) modules. A number of optional modules exist which can be used for implementing various flavours of OPC UA servers. Amongst those are alternative OPC UA backends, APIs for device specific protocols or software utilites.
The list of optional modules is maintained by the quasar team on github.
To enable and use a module:
./quasar.py enable_module MyQuasarModule [tag] [git server]
Pulls quasar-modules MyQuasarModule from git, checks version of chosen module to be compatible. A module version can be specified, if later a new module tag/release is needed, call the command again (the existing module version will be removed). You can specify a git server URL e.g. to use mirrors in restricted networks (e.g. ssh://git@gitlab.cern.ch:7999).
To download the module and include it in the build configuration run:
./quasar.py prepare_build
cmake will check for new enabled modules and pull from git if they are not yet existing. Thereafter you can build your project normally using ./quasar.py build which will consider includes and create and link an object library called like the module itself.
Further commands related to optional modules are:
./quasar.py remove_module MyQuasarModule Removes downloaded module code, if modifications are found - abort.
./quasar.py disable_module MyQuasarModule Removes module and disables its use (need to enable first again if needed).
./quasar.py list_modules [git server] List all maintained modules from git and their required quasar versions.
./quasar.py list_enabled_modules List all modules enabled in the project and their versions.

quasar build system

Quasar build system is documented here.

Calculated Variables

Logging

Logging in quasar servers is provided via the LogIt module.
  • Quasar specific documentation, targeted at quasar developers and quasar framework maintainers can be found here

  • Generic LogIt documentation can be found here

Frequently Asked Questions (FAQ)

  1. How to build an executable with debug symbols?

    Just append Debug to your “quasar.py build” invocation, i.e.:

    ./quasar.py build Debug

  2. Build fails

    Try to read carefully the output. If you can’t figure the issue on your own, try contacting quasar-developers@cern.ch

  3. quasar (itself) misbehaves (not to confuse with quasar-made OPC UA components). What can I do?

    1. You can increase verbosity of quasar tooling itself. This might point you to a problem (e.g. file permissions issues) or can help quasar developers diagnose the problem. The verbosity is controlled by environment variable called “QUASAR_LOG_LEVEL” and the most relevant levels are “INF” (the default, about no debug) and “DBG” (a lot of debug). If you use bash, you can increase the verbosity by invoking:

      export QUASAR_LOG_LEVEL=DBG

    2. Sometimes quasar tooling (e.g. anything you run via quasar.py command) will terminate with error. We did pay attention to be verbose enough but sometimes it might help to drop in the Python Debugger (pdb) to debug post-mortem rather than to drop to shell. This can be achieved by exporting the variable QUASAR_RUN_PDB to 1, e.g. in bash:

      export QUASAR_RUN_PDB=1

    3. The general support email is quasar-developers@cern.ch. You can get some support there or you can file a bug ticket directly via GitHub.

  4. How to create a RPM/MSI/DEB package with my OPCUA server? CPack fits very well into the provided quasar build system and RPM/MSI are known to work well with quasar.

  5. How to upgrade to newer release of quasar?
    1. Download/checkout quasar in the version of your choice

    2. Execute quasar.py upgrade_project which is in its root directory, passing path to your project to be upgraded as the first parameter: ./quasar.py upgrade_project <path>

  6. Can I use evaluation version of the UA Toolkit to create an OPC UA server using this framework?

    You can. Note that for many basic features you can use free and open-source open62541-compat backend instead of the paid UA Toolkit, see More info on alternative backends.

  7. How does a developer define specific command line options for my quasar server implementation? This is documented here: User Defined Command Line Parameters

  8. How does a developer define a dynamic (at start up) configuration? For example, where the server ‘discovers’ connected hardware on start up. This is documented here: User Defined Runtime Configuration

  9. How does a developer persist a ‘discovered’ configuration as described above? For example, where the server ‘discovers’ connected hardware initially and saves it for use thereafter as a static configuration. This is also documented here: User Defined Runtime Configuration

  10. How do I link libraries, add include directories, use build configurations etc… ? See build system doc.

Contributing

We welcome contributions to quasar! Whether you’re fixing bugs, improving documentation, or proposing new features, your input is valuable. Please contact quasar-developers@cern.ch for more information on how to get started or to discuss your ideas.


Report inconsistencies and bugs to <quasar-developers@cern.ch>

© CERN 2015-2024. All rights not expressly granted are reserved.