Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. QtonPi
  4. Mqtt module - client
Forum Updated to NodeBB v4.3 + New Features

Mqtt module - client

Scheduled Pinned Locked Moved Solved QtonPi
15 Posts 3 Posters 6.3k Views 2 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #5

    @pirates21 Qt Creator is just an IDE.

    To build a Qt module:

    mkdir build_qtmodule
    pushd build_qtmodule
    qmake /path/to/qtmodule
    make
    make install
    

    You can also build the module with Qt Creator, using the Qt version you want to build your application with.

    Interested in AI ? www.idiap.ch
    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

    1 Reply Last reply
    2
    • P Offline
      P Offline
      pirates21
      wrote on last edited by pirates21
      #6

      tomasz3dk, SGaist: thank you for your answer. At the moment I installed the library given by tomasz3dk. I am using a cross-compiler (QTRpi) in the QtCreator environment. If I run the project on ubuntu (host) it works, no problem. When the project run on raspberry pi (target), I have an error: "error while loading shared libraries: libqmqtt.so.1: cannot open shared object file: No such file or directory". I guess the library should go to raspberry pi. How should I do it?

      0_1524509495290_blad.png

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #7

        Indeed, you have to copy it over.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        2
        • P Offline
          P Offline
          pirates21
          wrote on last edited by pirates21
          #8

          I installed the library on ubuntu in this way:
          cd <projects folder>
          git clone https://github.com/emqtt/qmqtt.git
          cd qmqtt
          mkdir build
          cd build
          qmake -r ..
          sudo make install
          mkdir mqtt-client
          cd mqtt-client
          qmake -r ../../examples/mqtt/client
          make
          ./client

          I had errors when compiling (library) in raspberry. Can I transfer a library from ubuntu to raspberry? SGaist, you could describe in more detail how to do it?

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #9

            No, you need to copy the library you get once you cross-compiled it.

            How did you install Qt on your Pi ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            2
            • P Offline
              P Offline
              pirates21
              wrote on last edited by pirates21
              #10

              SGaist: Thank you for your help.

              Only the binary file is sent to Pi. I do not have Qt on raspberry installed. For example, the libqmqtt.so.1 file is located on ubuntu, in the location given in the picture. Where should this file be in raspberry?

              0_1524561043950_lib.png

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #11

                If you don't have Qt at all on your Pi, how are you running your application ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  pirates21
                  wrote on last edited by pirates21
                  #12

                  I compile applications on Ubuntu with QTrpi. If I do not use the mqtt module in it, it starts normally on raspberry. I'm sorry, I'm a beginner.0_1524566171480_pro.png

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    pirates21
                    wrote on last edited by pirates21
                    #13

                    In the * .pro file, I added: QMAKE_LFLAGS + = -Wl, -rpath, "'$$ ORIGIN'". I put a library on raspberry in the same location as on Ubuntu. It looks like it works.

                    1 Reply Last reply
                    2
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #14

                      Good move, so the executable can find it when it's beside it in the same folder.

                      Since you have it working now, then please mark the thread as solved using the "Topic Tools" button so that other forum users may know a solution has been found :)

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      2
                      • P Offline
                        P Offline
                        pirates21
                        wrote on last edited by
                        #15

                        Thank You very much!

                        1 Reply Last reply
                        2

                        • Login

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