Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. [SOLVED] QT Serial Communication with Beaglebone
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] QT Serial Communication with Beaglebone

Scheduled Pinned Locked Moved 3rd Party Software
22 Posts 3 Posters 12.4k Views 1 Watching
  • 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.
  • K Offline
    K Offline
    kuzulis
    Qt Champions 2020
    wrote on last edited by
    #4

    so, what a problem?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      seiko
      wrote on last edited by
      #5

      can you post the compile error log to be able to help you?

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Tilapia21
        wrote on last edited by
        #6

        Hello, Thank you for your answers !

        kuzulis : Thanks for your screenshot ! If you're right, I have to install qt 4.8 (not really anniying because final development need to use QT 4.8.2). Just have to repreat configure QT 4.8.2 for my Beaglebone.

        seiko : If I use mingw32-make, this will compile the project for use Linux apps not for Beaglebone apps, right ?

        seiko : here is a picture with compiler errors :
        !http://nomics.be/files/debug/ScreenshotQtError.png(QtSerialPort compiler errors)!

        So now I will install qt 4.8.2 and try to compile QtSerialPort using this version.

        Thank you.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          seiko
          wrote on last edited by
          #7

          QElapsedTimer introduced in Qt 4.7 . so you gonna need to upgrade

          1 Reply Last reply
          0
          • T Offline
            T Offline
            Tilapia21
            wrote on last edited by
            #8

            Ok, I upgraded my version to QT 4.8.2 and configure my BeagleboneKit to use this version. But I still get the same errors when trying to build the project.

            seiko : I get a warning when trying to compile using my term :
            /opt/qt/bin$ qmake ~/Downloads/qt-qtserialport/qtserialport.pro
            The program 'qmake' can be found in the following packages:

            • qt3-dev-tools
            • qt4-qmake
              Try: sudo apt-get install <selected package>

            What do I need to do ? Thanks in advance.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              seiko
              wrote on last edited by
              #9

              you are request qmake from system bin prefix since
              you are inside directory as i can see
              /opt/qt/bin
              use ./qmake instead of qmake
              or use
              @
              cd ~/Downloads/qt-qtserialport && /opt/qt/bin/qmake ~/Downloads/qt-qtserialport/qtserialport.pro && make
              @
              then
              @
              sudo make install
              @

              1 Reply Last reply
              0
              • T Offline
                T Offline
                Tilapia21
                wrote on last edited by
                #10

                Hi,

                tried your command seiko but still get the errors...

                cd ~/Downloads/qt-qtserialport && /opt/qt/bin/qmake ~/Downloads/qt-qtserialport/qtserialport.pro && make
                WARNING: /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/share/qtopia/mkspecs/common/g++.conf:44: Variable QMAKE_RPATH is deprecated; use QMAKE_LFLAGS_RPATH instead.
                WARNING: /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/share/qtopia/mkspecs/features/yacc.prf:27: Unescaped backslashes are deprecated.
                WARNING: /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/share/qtopia/mkspecs/features/lex.prf:19: Unescaped backslashes are deprecated.
                cd src/ && make -f Makefile
                make[1]: Entering directory /home/julian/Downloads/qt-qtserialport/src' cd serialport/ && make -f Makefile make[2]: Entering directory /home/julian/Downloads/qt-qtserialport/src/serialport'
                arm-angstrom-linux-gnueabi-g++ -c -pipe -Wall -W -D_REENTRANT -fPIC -DQT_BUILD_SERIALPORT_LIB -DQT_NO_DEBUG -DQT_CORE_LIB -I/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/share/qtopia/mkspecs/linux-g++ -I. -I/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi//usr/include/qtopia/QtCore -I/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi//usr/include/qtopia -I. -I../../include -I../../include/QtSerialPort -Iqt4support/include -Iqt4support/include/QtCore -Iqt4support/include/private -I. -o qserialport_unix.o qserialport_unix.cpp
                qserialport_unix.cpp:58:34: error: QtCore/qelapsedtimer.h: No such file or directory
                qserialport_unix.cpp: In member function 'bool QSerialPortPrivate::waitForReadyRead(int)':
                qserialport_unix.cpp:427: error: 'QElapsedTimer' was not declared in this scope
                qserialport_unix.cpp:427: error: expected ;' before 'stopWatch' qserialport_unix.cpp:429: error: 'stopWatch' was not declared in this scope qserialport_unix.cpp: In member function 'bool QSerialPortPrivate::waitForBytesWritten(int)': qserialport_unix.cpp:461: error: 'QElapsedTimer' was not declared in this scope qserialport_unix.cpp:461: error: expected ;' before 'stopWatch'
                qserialport_unix.cpp:463: error: 'stopWatch' was not declared in this scope
                make[2]: *** [qserialport_unix.o] Error 1
                make[2]: Leaving directory /home/julian/Downloads/qt-qtserialport/src/serialport' make[1]: *** [sub-serialport-make_default] Error 2 make[1]: Leaving directory /home/julian/Downloads/qt-qtserialport/src'
                make: *** [sub-src-make_default-ordered] Error 2

                Then I tried : /opt/qt/bin$ sudo ./qmake ~/Downloads/qt-qtserialport/qtserialport.pro
                Makefile has been generated but then, when calling make :
                /opt/qt/bin$ ls

                Makefile moc qmake rcc uic
                /opt/qt/bin$ sudo make

                I get the following errors :

                cd src/ && /opt/qt/bin/qmake /home/julian/Downloads/qt-qtserialport/src/src.pro -o Makefile
                cd src/ && make -f Makefile
                make[1]: Entering directory /opt/qt/bin/src' cd serialport/ && /opt/qt/bin/qmake /home/julian/Downloads/qt-qtserialport/src/serialport/serialport.pro -o Makefile cd serialport/ && make -f Makefile make[2]: Entering directory /opt/qt/bin/src/serialport'
                /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++ -c -pipe -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp -Wall -W -D_REENTRANT -fPIC -DQT_BUILD_SERIALPORT_LIB -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_SHARED -I/opt/qt/mkspecs/qws/linux-am335x-g++ -I/home/julian/Downloads/qt-qtserialport/src/serialport -I/opt/qt/include/QtCore -I/opt/qt/include -I/home/julian/Downloads/qt-qtserialport/src/serialport -I../../include -I../../include/QtSerialPort -I/home/julian/Downloads/qt-qtserialport/src/serialport/qt4support/include -I/home/julian/Downloads/qt-qtserialport/src/serialport/qt4support/include/QtCore -I/home/julian/Downloads/qt-qtserialport/src/serialport/qt4support/include/private -I. -I/home/julian/Downloads/qt-qtserialport/src/serialport -I. -o qserialport.o /home/julian/Downloads/qt-qtserialport/src/serialport/qserialport.cpp
                In file included from /home/julian/Downloads/qt-qtserialport/src/serialport/qserialport.cpp:1399:
                /home/julian/Downloads/qt-qtserialport/src/serialport/moc_qserialport.cpp:14:2: error: #error "This file was generated using the moc from 4.6.3. It"
                /home/julian/Downloads/qt-qtserialport/src/serialport/moc_qserialport.cpp:15:2: error: #error "cannot be used with the include files from this version of Qt."
                /home/julian/Downloads/qt-qtserialport/src/serialport/moc_qserialport.cpp:16:2: error: #error "(The moc has changed too much.)"
                make[2]: *** [qserialport.o] Error 1
                make[2]: Leaving directory /opt/qt/bin/src/serialport' make[1]: *** [sub-serialport-make_default] Error 2 make[1]: Leaving directory /opt/qt/bin/src'
                make: *** [sub-src-make_default-ordered] Error 2

                I think I'm still missing sth but can't figure exactly what....

                Thanks.

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  seiko
                  wrote on last edited by
                  #11

                  Are you sure from install qt 4.8 ?
                  Because the error still exist "QElapsedTimer"

                  @
                  qserialport_unix.cpp:58:34: error: QtCore/qelapsedtimer.h: No such file or directory
                  qserialport_unix.cpp: In member function ‘bool QSerialPortPrivate::waitForReadyRead(int)’:
                  qserialport_unix.cpp:427: error: ‘QElapsedTimer’ was not declared in this scope
                  @

                  By enter follow command you should see what's your qt version

                  @
                  /opt/qt/bin/qmake -v && /opt/qt/bin/moc -v
                  @

                  1 Reply Last reply
                  0
                  • T Offline
                    T Offline
                    Tilapia21
                    wrote on last edited by
                    #12

                    Here's the result :

                    QMake version 2.01a
                    Using Qt version 4.8.2 in /opt/qt/lib

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      seiko
                      wrote on last edited by
                      #13

                      first of all check qt doc link "check qt doc link...":http://qt-project.org/wiki/QtSerialPort and re-extract to get a clean dir of QtSerialPort
                      because what I see here from your log
                      looks like duplicated qmake or you moc version isn't the same as qmake
                      @
                      /home/julian/Downloads/qt-qtserialport/src/serialport/moc_qserialport.cpp:14:2: error: #error “This file was generated using the moc from 4.6.3. It”
                      /home/julian/Downloads/qt-qtserialport/src/serialport/moc_qserialport.cpp:15:2: error: #error “cannot be used with the include files from this version of Qt.”
                      /home/julian/Downloads/qt-qtserialport/src/serialport/moc_qserialport.cpp:16:2:
                      @
                      check your moc version
                      @
                      /opt/qt/bin/moc -v
                      @
                      Also your qtopia using old qt flags
                      @
                      WARNING: /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/share/qtopia/mkspecs/common/g++.conf:44: Variable QMAKE_RPATH is deprecated; use QMAKE_LFLAGS_RPATH instead.
                      WARNING: /usr/local/angstrom/arm/arm-angstrom-linux-
                      @

                      1 Reply Last reply
                      0
                      • T Offline
                        T Offline
                        Tilapia21
                        wrote on last edited by
                        #14

                        Qt Meta Object Compiler version 63 (Qt 4.8.2)

                        Would it help if I uninstall qt4-emebedded ?

                        I think it has worked this time.
                        So I downloaded qt-qtserialport once more and extracted it.
                        Then :
                        @cd ~/Downloads/qt-qtserialport
                        /opt/qt/bin/qmake ~/Downloads/qt-qtserialport/qtserialport.pro
                        make
                        sudo make install
                        @
                        and it finished without errors. I'm gonna check how it's going in QTCreator.

                        1 Reply Last reply
                        0
                        • T Offline
                          T Offline
                          Tilapia21
                          wrote on last edited by
                          #15

                          Ok, last step would be having it in QtCreator obviously.

                          When I add :
                          #include <QtSerialPort/QSerialPort>
                          #include <QtSerialPort/QSerialInfo>
                          and try to build, it says :
                          No such file or directory.
                          Another parameter to configure ?

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            seiko
                            wrote on last edited by
                            #16

                            Because you forget to add
                            @
                            CONFIG += serialport
                            @
                            in your .pro file

                            Note: CONFIG += serialport must be the first or second line in your .pro file.

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              seiko
                              wrote on last edited by
                              #17

                              Would it help if I uninstall qt4-emebedded ?
                              I don't think so , If you upgraded your qt version to 4.8 so your qt4-emebedded gonna upgraded too

                              [quote author="Tilapia21" date="1391776804"]
                              I think it has worked this time.
                              So I downloaded qt-qtserialport once more and extracted it.
                              Then :
                              @cd ~/Downloads/qt-qtserialport
                              /opt/qt/bin/qmake ~/Downloads/qt-qtserialport/qtserialport.pro
                              make
                              sudo make install
                              @
                              and it finished without errors. I'm gonna check how it's going in QTCreator.[/quote]

                              Here was my guess you used qmake version 4.6.3 then after you upgrade
                              you used qmake version 4.8.2 without clean the old moc files and MakeFile

                              so I think everything gonna work fine with you this time

                              1 Reply Last reply
                              0
                              • T Offline
                                T Offline
                                Tilapia21
                                wrote on last edited by
                                #18

                                Sorry, I forgot to mention I had done it too.

                                @QT += core gui
                                CONFIG += serialport
                                greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

                                TARGET = QTTest2
                                target.files = QTTest2
                                target.path = /home/root

                                INSTALLS += target
                                TEMPLATE = app

                                SOURCES += main.cpp
                                mainwindow.cpp

                                HEADERS += mainwindow.h

                                FORMS += mainwindow.ui@

                                1 Reply Last reply
                                0
                                • S Offline
                                  S Offline
                                  seiko
                                  wrote on last edited by
                                  #19

                                  Well in that case qt creator has different qmake
                                  since you had been upgraded your qt you have to add a new qt kit
                                  for /opt/qt/bin/qmake and make it a default qt for your project

                                  1 Reply Last reply
                                  0
                                  • T Offline
                                    T Offline
                                    Tilapia21
                                    wrote on last edited by
                                    #20

                                    You're right it had gone back to qt 4.6.3 qmake.
                                    All errors have disappeared.
                                    I'm gonne make a small test program and mark this subject as solved if everything goes fine.

                                    Thank you for your help ! Great community !
                                    Special thanks to you seiko !

                                    1 Reply Last reply
                                    0
                                    • T Offline
                                      T Offline
                                      Tilapia21
                                      wrote on last edited by
                                      #21

                                      Ok, just a last problem then I think I'll be ready to fly on my own.

                                      I compiled the "terminal" example and it was displayed on the beaglebone screen. But I wanted to change the mainWindow resolution cause the example was really small and I should have made sth wrong cause now I get this error :

                                      16:06:32: Running steps for project terminal...
                                      16:06:32: Configuration unchanged, skipping qmake step.
                                      16:06:32: Starting: "/usr/bin/make"
                                      arm-angstrom-linux-gnueabi-g++ -Wl,-rpath-link,/opt/qt/lib -o terminal main.o mainwindow.o settingsdialog.o console.o moc_mainwindow.o moc_settingsdialog.o moc_console.o qrc_terminal.o -L/home/julian/Downloads/qt-qtserialport/src/serialport -L/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi//usr/lib -lglib-2.0 -lQtSerialPort -lQtGui -lQtCore -lpthread
                                      /usr/local/angstrom/arm/lib/gcc/arm-angstrom-linux-gnueabi/4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: cannot find -lQtGui
                                      collect2: ld returned 1 exit status
                                      make: *** [terminal] Error 1
                                      16:06:32: The process "/usr/bin/make" exited with code 2.
                                      Error while building/deploying project terminal (kit: BeagleboneKit)
                                      When executing step 'Make'
                                      16:06:32: Elapsed time: 00:00.

                                      1 Reply Last reply
                                      0
                                      • S Offline
                                        S Offline
                                        seiko
                                        wrote on last edited by
                                        #22

                                        @
                                        /usr/local/angstrom/arm/lib/gcc/arm-angstrom-linux-gnueabi/4.3.3/../../../../arm-angstrom-linux-gnueabi/bin/ld: cannot find -lQtGui
                                        collect2: ld returned 1 exit status
                                        @
                                        the linker can't find QtGui because in follow directory you should have
                                        QT library and I don't why qt qmake didn't even provide the path of lib maybe you should recall qmake
                                        @
                                        /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/usr/lib
                                        @

                                        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