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. QT5.4.1 Bluetooth issue in Linux
Forum Updated to NodeBB v4.3 + New Features

QT5.4.1 Bluetooth issue in Linux

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
12 Posts 5 Posters 5.2k Views 4 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.
  • A Offline
    A Offline
    ankurtyagi
    wrote on last edited by
    #2

    Just to let everyone know, I managed to fix the problem.

    For open source version (meta-qt5), qtconnectivity lacks bluetooth support by default. Trick is to add bluez4 in packageconfig while building qtconnectivity.

    cheers

    H 1 Reply Last reply
    0
    • A Offline
      A Offline
      ambershark
      wrote on last edited by
      #3

      Just to let you know, Qt's bluetooth support is not great (yet). I have had many many problems with it since it was first introduced a few versions back.

      I ended up having to dig through Qt code to find out what it was doing to diagnose connection issues.

      Once I resolved those in linux, the same connection code doesn't work in OSX.

      After hitting too many problems like this with code paths that were incomplete in Qt or didn't give any sort of actionable or documented error message, I finally just went native for osx and linux.

      This was as of Qt 5.5, and the alpha of 5.6. I haven't tried to use it again.

      Just wanted to give you that warning in case you have a tight deadline like I did. ;)

      My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

      1 Reply Last reply
      0
      • A Offline
        A Offline
        ankurtyagi
        wrote on last edited by
        #4

        thanks for the heads up ! somehow I also have the same feeling :)

        A 1 Reply Last reply
        0
        • A ankurtyagi

          thanks for the heads up ! somehow I also have the same feeling :)

          A Offline
          A Offline
          ambershark
          wrote on last edited by
          #5

          @ankurtyagi Yea, in my opinion it's not ready for actual usage. I have tried to use it in 2 different projects now in the last year and a half with disastrous results.

          In my experience I've found Qt to be absolutely the best GUI toolkit ever, but very subpar when dealing with hardware. I had issues with serialport stuff as well when it was new.

          My advice is definitely don't expect Qt hardware stuff to just work easily out of the box like you do with the GUI stuff. :)

          My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

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

            Yes, Bluetooth support (tested here on OSX and iOS) seems terribly flawed and/or incomplete.

            I wish they wouldn't push out support for new tech as finished when clearly it is not. "Doesn't crash" is not the same as "works".

            A 1 Reply Last reply
            0
            • T TOMATO_QT

              Yes, Bluetooth support (tested here on OSX and iOS) seems terribly flawed and/or incomplete.

              I wish they wouldn't push out support for new tech as finished when clearly it is not. "Doesn't crash" is not the same as "works".

              A Offline
              A Offline
              ambershark
              wrote on last edited by
              #7

              @TOMATO_QT Lol yep, totally agree. We've all done it though. I know I've pushed out "working" code that was so minimally tested I'm surprised it compiled much less actually worked. ;)

              My L-GPL'd C++ Logger github.com/ambershark-mike/sharklog

              ? 1 Reply Last reply
              0
              • A ambershark

                @TOMATO_QT Lol yep, totally agree. We've all done it though. I know I've pushed out "working" code that was so minimally tested I'm surprised it compiled much less actually worked. ;)

                ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #8

                @ambershark Shame on us all! :-D

                1 Reply Last reply
                1
                • A ankurtyagi

                  Just to let everyone know, I managed to fix the problem.

                  For open source version (meta-qt5), qtconnectivity lacks bluetooth support by default. Trick is to add bluez4 in packageconfig while building qtconnectivity.

                  cheers

                  H Offline
                  H Offline
                  Haponov
                  wrote on last edited by
                  #9

                  @ankurtyagi
                  how exactly did you add bluez4 to package config for building qtconnectivity?

                  I have the very same issue as you do, I built qt for RPI according to http://wiki.qt.io/RaspberryPi2EGLFS and added qtconnectivity by:
                  cd ~/raspi/Qt-5.6/qtconnectivity
                  ~/raspi/qt5/bin/qmake -r
                  make
                  sudo make install

                  1 Reply Last reply
                  0
                  • H Offline
                    H Offline
                    Haponov
                    wrote on last edited by Haponov
                    #10

                    and my ~/raspi/qt5/bin/qmake -r does not work...while compiling all the stuff for rpi I missed these pretty lines:

                               Checking for bluez... no
                               Checking for bluez_le... no
                    

                    and yet Qt+=bluetooth did not complain (it complained before adding this corrupted compilation)

                    bluez is definitely on my Ubuntu 15.10 x64:

                               pkg-config --modversion bluez
                                5.35
                    

                    I studyed this - https://bugreports.qt.io/browse/QTBUG-39609 - not my case. Looks more like this http://raspberrypi.stackexchange.com/questions/40165/qt-5-6-qbluetooth-either-no-qt-d-bus-found-or-no-bluez-headers but I definitely have libdbus-1-dev

                    after doing /path/to/your/qmake -d >qmake.log 2>&1 I have these nice lines:

                        DEBUG 1: /home/hap/raspi/qt5/mkspecs/features/link_pkgconfig.prf:10: test function returned false
                        DEBUG 1: /home/hap/raspi/qt5/mkspecs/features/link_pkgconfig.prf:10: AND
                        DEBUG 1: /home/hap/raspi/qt5/mkspecs/features/link_pkgconfig.prf:10: evaluating test function "error"
                        DEBUG 1: /home/hap/raspi/qt5/mkspecs/features/link_pkgconfig.prf:10: calling built-in error("bluez development package not found")
                        Project ERROR: bluez development package not found
                    

                    well, link_pkgconfig.prf on line 10 has

                        !packagesExist($$PKGCONFIG_LIB): error("$$PKGCONFIG_LIB development package not found")
                    

                    and how am I to fix this?..

                    sorry if it goes offtopic, but the problem was detected just according to the topic title

                    1 Reply Last reply
                    0
                    • H Offline
                      H Offline
                      Haponov
                      wrote on last edited by
                      #11

                      solution for my case (compiling qtconnectivity for RPI) is here https://forum.qt.io/topic/63995/building-from-git-clone-git-code-qt-io-qt-qtconnectivity-git-b-5-6-fails/7

                      and usb dongles from CSR are detected ok

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        ankurtyagi
                        wrote on last edited by ankurtyagi
                        #12

                        @Haponov

                        sorry for late response. This is how I configure it

                        PROFILES="ls /home/qtconnectivity/5.4.1-r0/qtconnectivity-opensource-src-5.4.1/*.pro"
                        QMAKE_VARSUBST_PRE=" CONFIG+=OE_BLUEZ_ENABLED"

                        export QMAKE_MAKE_ARGS=" MAKEFLAGS='-j 4' OE_QMAKE_COMPILER='arm-linux-gnueabihf-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=/home/external-linaro-toolchain/sysroots/am335x-evm' OE_QMAKE_CC='arm-linux-gnueabihf-gcc -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=/home/external-linaro-toolchain/sysroots/am335x-evm' OE_QMAKE_CXX='arm-linux-gnueabihf-g++ -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=/home/external-linaro-toolchain/sysroots/am335x-evm' OE_QMAKE_CFLAGS=' -isystem/home/gcc-4.7.3/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/include -fstack-protector -O2 -pipe -g -feliminate-unused-debug-types' OE_QMAKE_CXXFLAGS=' -isystem/home/gcc-4.7.3/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/include -fstack-protector -O2 -pipe -g -feliminate-unused-debug-types' OE_QMAKE_LINK='arm-linux-gnueabihf-g++ -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=/home/external-linaro-toolchain/sysroots/am335x-evm' OE_QMAKE_LDFLAGS=' -L/home/gcc-4.7.3/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/lib -Wl,-rpath-link,/home/gcc-4.7.3/gcc-linaro-arm-linux-gnueabihf-4.7-2013.03-20130313_linux/arm-linux-gnueabihf/lib -Wl,-O1 -Wl,--hash-style=gnu' OE_QMAKE_AR='arm-linux-gnueabihf-ar' OE_QMAKE_STRIP='echo' OE_QMAKE_WAYLAND_SCANNER='/home/external-linaro-toolchain/sysroots/i686-linux/usr/bin/wayland-scanner' OE_QMAKE_INCDIR_QT='/home/external-linaro-toolchain/sysroots/am335x-evm//usr/include/qt5' "

                        /home/i686-linux/usr/bin/qt5/qmake -makefile -o Makefile $QMAKE_VARSUBST_PRE $PROFILES

                        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