Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Problems with running Stand-Alone OPC UA Server on Raspberry Pi 4

Problems with running Stand-Alone OPC UA Server on Raspberry Pi 4

Scheduled Pinned Locked Moved Solved Mobile and Embedded
6 Posts 2 Posters 695 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mauda
    wrote on last edited by
    #1

    Dear Community,

    Currently I am trying to run an application with a stand-alone OPC UA Server on a Rasperry Pi 4B, which is based on the official waterpump simulation server example of Qt Documentation: https://doc-snapshots.qt.io/qtopcua/qtopcua-waterpump-waterpump-qmlcpp-example.html
    For the cross compilation, I used the following installation guide: https://wapel.de/?p=842

    The problem, which I am trying to solve is the following:
    The OPC UA Serverproject can be built with two development Kits:

    • The Desktop Development Kit is working without any problems.

    • By using the Raspberry Pi Development Kit, I got the following error messages:
      f914e705-8600-4eca-8937-f95777415c55-grafik.png

    I tried to solve this problem by comparing the included header files and the project structure with the official waterpump example. They exactly match the default specifications of the waterpump example.

    I don´t understand the reason for this kind of errors. Maybe there is anyone who had the same problem?

    Thank you in Advance!

    Pablo J. RoginaP 1 Reply Last reply
    0
    • M Offline
      M Offline
      Mauda
      wrote on last edited by Mauda
      #6

      I solved the problem by myself changing two things:

      • Changing Pro-File:
      TEMPLATE = app
      
      INCLUDEPATH += \
                     $$PWD/../../../../raspi/qtopcua/src/plugins/opcua/open62541  \
                     $$PWD/../../../../raspi/sysroot/usr/include
      
      DEPENDPATH += INCLUDEPATH
      
      QT       += core gui
      QT       += opcua
      QT       += opcua-private
      
      greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
      
      CONFIG += c++11
      
      # You can make your code fail to compile if it uses deprecated APIs.
      # In order to do so, uncomment the following line.
      #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
      
      qtConfig(open62541):!qtConfig(system-open62541) {
         include($$PWD/../../../../raspi/qtopcua/src/3rdparty/open62541.pri)
      
      } else {
          QMAKE_USE_PRIVATE += open62541
      }
      
      
      SOURCES += \
          main.cpp \
          simulationserver.cpp \
          $$PWD/../../../../raspi/qtopcua/src/plugins/opcua/open62541/qopen62541utils.cpp \
          $$PWD/../../../../raspi/qtopcua/src/plugins/opcua/open62541/qopen62541valueconverter.cpp
      
      HEADERS += \
          simulationserver.h\
      
      
      FORMS += \
          simulationserver.ui
      
      TRANSLATIONS += \
         OpcUa_Server_RasperryPi4_en_GB.ts
      
      # Default rules for deployment.
      qnx: target.path = /tmp/$${TARGET}/bin
      else: unix:!android: target.path = /home/pi/$${TARGET}/bin
      !isEmpty(target.path): INSTALLS += target
      
      
      • Changing the server-main class type from QWidget to QObject

        • Old Code:

          Simulationserver::Simulationserver(QWidget *parent)
          : QMainWindow(parent)
          
        • New Code:

          Simulationserver::Simulationserver(QObject *parent)
          : QObject(parent)
          
      1 Reply Last reply
      0
      • M Mauda

        Dear Community,

        Currently I am trying to run an application with a stand-alone OPC UA Server on a Rasperry Pi 4B, which is based on the official waterpump simulation server example of Qt Documentation: https://doc-snapshots.qt.io/qtopcua/qtopcua-waterpump-waterpump-qmlcpp-example.html
        For the cross compilation, I used the following installation guide: https://wapel.de/?p=842

        The problem, which I am trying to solve is the following:
        The OPC UA Serverproject can be built with two development Kits:

        • The Desktop Development Kit is working without any problems.

        • By using the Raspberry Pi Development Kit, I got the following error messages:
          f914e705-8600-4eca-8937-f95777415c55-grafik.png

        I tried to solve this problem by comparing the included header files and the project structure with the official waterpump example. They exactly match the default specifications of the waterpump example.

        I don´t understand the reason for this kind of errors. Maybe there is anyone who had the same problem?

        Thank you in Advance!

        Pablo J. RoginaP Offline
        Pablo J. RoginaP Offline
        Pablo J. Rogina
        wrote on last edited by
        #2

        @Mauda

        For the cross compilation, I used the following installation guide: https://wapel.de/?p=842

        just in case, have you cross-compiled the Qt OPC UA module for RPi 4 as well?
        If so, is it properly deployed/copied into your sysroot location in host PC?

        Upvote the answer(s) that helped you solve the issue
        Use "Topic Tools" button to mark your post as Solved
        Add screenshots via postimage.org
        Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Mauda
          wrote on last edited by Mauda
          #3

          @Pablo-J-Rogina: Thank you for your answer. Please have a look at my comments:

          just in case, have you cross-compiled the Qt OPC UA module for RPi 4 as well?
          If so, is it properly deployed/copied into your sysroot location in host PC?

          Yes, I have cross-compiled the Qt OPC UA module as well. I used this part of the installation guide:
          https://wapel.de/?p=842

          55f2446d-5a00-4467-b240-1a189bd53499-grafik.png

          I checked the sysroot folder in my host PC: /home/user/raspi/sysroot/lib/qt5/bin/
          --> there is only a folder installed, which is called qt5

          I checked the second folder, which was build by the installation guide: /home/user/raspi/qt5pi/include/QtOpcUa/
          --> the Qt OPC UA Library is included within this folder.

          Is it necessary to have the Qt OPC UA Library within the sysroot folder as well?

          Pablo J. RoginaP 1 Reply Last reply
          0
          • M Mauda

            @Pablo-J-Rogina: Thank you for your answer. Please have a look at my comments:

            just in case, have you cross-compiled the Qt OPC UA module for RPi 4 as well?
            If so, is it properly deployed/copied into your sysroot location in host PC?

            Yes, I have cross-compiled the Qt OPC UA module as well. I used this part of the installation guide:
            https://wapel.de/?p=842

            55f2446d-5a00-4467-b240-1a189bd53499-grafik.png

            I checked the sysroot folder in my host PC: /home/user/raspi/sysroot/lib/qt5/bin/
            --> there is only a folder installed, which is called qt5

            I checked the second folder, which was build by the installation guide: /home/user/raspi/qt5pi/include/QtOpcUa/
            --> the Qt OPC UA Library is included within this folder.

            Is it necessary to have the Qt OPC UA Library within the sysroot folder as well?

            Pablo J. RoginaP Offline
            Pablo J. RoginaP Offline
            Pablo J. Rogina
            wrote on last edited by
            #4

            @Mauda said in Problems with running Stand-Alone OPC UA Server on Raspberry Pi 4:

            Is it necessary to have the Qt OPC UA Library within the sysroot folder as well?

            It depends on how you will reference the headers and libraries in your project.

            Could you post your .pro and/or CMakeLists.txt files?

            Upvote the answer(s) that helped you solve the issue
            Use "Topic Tools" button to mark your post as Solved
            Add screenshots via postimage.org
            Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

            M 1 Reply Last reply
            0
            • Pablo J. RoginaP Pablo J. Rogina

              @Mauda said in Problems with running Stand-Alone OPC UA Server on Raspberry Pi 4:

              Is it necessary to have the Qt OPC UA Library within the sysroot folder as well?

              It depends on how you will reference the headers and libraries in your project.

              Could you post your .pro and/or CMakeLists.txt files?

              M Offline
              M Offline
              Mauda
              wrote on last edited by
              #5

              @Pablo-J-Rogina said in Problems with running Stand-Alone OPC UA Server on Raspberry Pi 4:

              Could you post your .pro and/or CMakeLists.txt files?

              Shure, here is my .pro file:

              QT       += core gui
              QT       += opcua
              QT       += opcua-private
              
              greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
              
              CONFIG += c++11
              
              TEMPLATE = app
              
              DEPENDPATH += INCLUDEPATH
              
              INCLUDEPATH += \
                  $$PWD/../../../../src/plugins/opcua/open62541
              
              SOURCES += \
                  main.cpp \
                  simulationserver.cpp \
                  /home/qt-projects/OpcUa_Server/OpcUa_Server_RasperryPi4/Third_Party/open62541/qopen62541utils.cpp \
                  /home/qt-projects/OpcUa_Server/OpcUa_Server_RasperryPi4/Third_Party/open62541/qopen62541valueconverter.cpp
              
              HEADERS += \
                  simulationserver.h
              
              FORMS += \
                  simulationserver.ui
              
              TRANSLATIONS += \
                  OpcUa_Server_RasperryPi4_en_GB.ts
              
              qtConfig(open62541):!qtConfig(system-open62541) {
                  include(/home/qt-projects/OpcUa_Server/OpcUa_Server_RasperryPi4/Third_Party/open62541.pri)
              } else {
                  QMAKE_USE_PRIVATE += open62541
              }
              
              # Default rules for deployment.
              qnx: target.path = /tmp/$${TARGET}/bin
              else: unix:!android: target.path = /home/pi/$${TARGET}/bin
              !isEmpty(target.path): INSTALLS += target
              

              Where can I find the CMakeLists.txt file?

              Thank you!

              1 Reply Last reply
              0
              • M Offline
                M Offline
                Mauda
                wrote on last edited by Mauda
                #6

                I solved the problem by myself changing two things:

                • Changing Pro-File:
                TEMPLATE = app
                
                INCLUDEPATH += \
                               $$PWD/../../../../raspi/qtopcua/src/plugins/opcua/open62541  \
                               $$PWD/../../../../raspi/sysroot/usr/include
                
                DEPENDPATH += INCLUDEPATH
                
                QT       += core gui
                QT       += opcua
                QT       += opcua-private
                
                greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                
                CONFIG += c++11
                
                # You can make your code fail to compile if it uses deprecated APIs.
                # In order to do so, uncomment the following line.
                #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
                
                qtConfig(open62541):!qtConfig(system-open62541) {
                   include($$PWD/../../../../raspi/qtopcua/src/3rdparty/open62541.pri)
                
                } else {
                    QMAKE_USE_PRIVATE += open62541
                }
                
                
                SOURCES += \
                    main.cpp \
                    simulationserver.cpp \
                    $$PWD/../../../../raspi/qtopcua/src/plugins/opcua/open62541/qopen62541utils.cpp \
                    $$PWD/../../../../raspi/qtopcua/src/plugins/opcua/open62541/qopen62541valueconverter.cpp
                
                HEADERS += \
                    simulationserver.h\
                
                
                FORMS += \
                    simulationserver.ui
                
                TRANSLATIONS += \
                   OpcUa_Server_RasperryPi4_en_GB.ts
                
                # Default rules for deployment.
                qnx: target.path = /tmp/$${TARGET}/bin
                else: unix:!android: target.path = /home/pi/$${TARGET}/bin
                !isEmpty(target.path): INSTALLS += target
                
                
                • Changing the server-main class type from QWidget to QObject

                  • Old Code:

                    Simulationserver::Simulationserver(QWidget *parent)
                    : QMainWindow(parent)
                    
                  • New Code:

                    Simulationserver::Simulationserver(QObject *parent)
                    : QObject(parent)
                    
                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved