Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Debugging the QtBluetooth module
Qt 6.11 is out! See what's new in the release blog

Debugging the QtBluetooth module

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 1.8k 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.
  • M Offline
    M Offline
    martonmiklos
    wrote on last edited by martonmiklos
    #1

    Hello all,

    I have some problems with the BLE device handling of the Qt 5.7.0. I have not been able to connect to any BLE device with Qt. hcitool and gattool works as expected, so it is not a system/hardware level problem.

    The official lowenergyscanner example throws the following error when trying to discover services on the device:

    Error:  "Unknown Error"
    qt.bluetooth.bluez: void QBluetoothSocketPrivate::_q_readNotify() 25 error: -1 "Resource not available"
    Error:  "Unknown Error"
    Disconnect from device
    

    I have decided to try debugging this issue.
    Cloned the http://code.qt.io/cgit/qt/qtconnectivity.git/ and built the bluetooth module.
    I have removed the QT += bluetooth line from the project file, and added

    LIBS += -L/home/mm/Projektek/qt/qtconnectivity/lib/ -l:/home/mm/Projektek/qt/qtconnectivity/lib/libQt5Bluetooth.so.5.7.1
    

    But the ldd still shows the following even after setting the LD_LIBRARY_PATH:

    mm@lapos:/opt/qt-5.7.0/Examples/Qt-5.7/bluetooth/build-lowenergyscanner-Desktop_Qt_5_7_0_GCC_64bit-Debug$ ldd ./lowenergyscanner  | grep Blue
            libQt5Bluetooth.so.5 => /opt/qt-5.7.0/5.7/gcc_64/lib/libQt5Bluetooth.so.5 (0x00007f73aca4e000)
    
    

    How can I use a locally built Qt module with a Qt application?

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

      Hi,

      IIRC, you have to set the LD_LIBRARY_PATH environment variable to select the order in which the loader will search for these files.

      Hope it helps

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

      M 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi,

        IIRC, you have to set the LD_LIBRARY_PATH environment variable to select the order in which the loader will search for these files.

        Hope it helps

        M Offline
        M Offline
        martonmiklos
        wrote on last edited by
        #3

        @SGaist Yepp it sloved it, my mistake. Also the QtBluetooth uses the QLoggingCategory, so with ```
        QLoggingCategory::setFilterRules("*.debug=false\n"
        "qt.bluetooth.bluez.debug=true\n"
        "qt.bluetooth.debug=true");

        I was able to get extended debug out.
        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