Debugging the QtBluetooth module

  • 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 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/

    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
   => /opt/qt-5.7.0/5.7/gcc_64/lib/ (0x00007f73aca4e000)

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

  • Lifetime Qt Champion


    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

  • @SGaist Yepp it sloved it, my mistake. Also the QtBluetooth uses the QLoggingCategory, so with ```

    I was able to get extended debug out.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.