Skip to content
  • 1 Votes
    1 Posts
    203 Views
    No one has replied
  • 0 Votes
    4 Posts
    1k Views
    aniketRoxyA

    Thank you @jsulm & @KroMignon !!
    :)

    Ports 0-1024 are "protected" for "known" services and By "protected", they must be used by system daemons. Thus, a regular user cannot start them.

    Solution 1:
    Run application using terminal:

    sudo \path\to\app

    Solution 2:
    Use a port above 1024
    So i changed port from 502 to 1502:

    const QUrl url = QUrl::fromUserInput("127.0.0.1:1502");

    Working now!!
    <3 Qt

  • 0 Votes
    2 Posts
    888 Views
    J

    hi vpettersson,

    i got the same errors and got it working with 3 symlinks:

    in sysroot/opt/vc/include/EGL

    mv egl.h egl.h-old
    mv eglext.h eglext.h-old
    mv eglplatform.h eglplatform.h-old

    ln -s /home/jw78/raspi/qt-everywhere-src-5.15.2/qtwebengine/src/3rdparty/chromium/third_party/khronos/EGL/eglext.h eglext.h
    ln -s /home/jw78/raspi/qt-everywhere-src-5.15.2/qtwebengine/src/3rdparty/chromium/third_party/khronos/EGL/egl.h egl.h
    ln -s /home/jw78/raspi/qt-everywhere-src-5.15.2/qtwebengine/src/3rdparty/chromium/third_party/khronos/EGL/eglplatform.h eglplatform.h

    of course you must adjust your paths (/home/jw78/raspi/qt-everywhere-src-5.15.2)

    there are many egl.h/eglext.h/eglplatform.h to include and because of the include order the comiler fetches first the files in sysroot/opt/vc/include/EGL
    probably the better solution is to reorder the "-I" flags for the compiler, but i have no idea how to do this

    i did not
    dpkg --purge libraspberrypi-dev

  • 0 Votes
    2 Posts
    3k Views
    SGaistS

    Hi and welcome to devnet,

    That's because you try to access a standard member variable from a static function.

    Take a look at the ir_receiver example of the pigpio project. It shows how to use a class with the callback with gpioSetAlertFuncEx.

  • 0 Votes
    26 Posts
    4k Views
    J

    Finally (!...) I was able to fix the problems. I'm showing the whole procedure, not only what relates to the main subject of this thread so that to contribute to the community..

    I was using the following sites as a source information to work out the following solution: LINK1 (for other Qt/Raspberry PI configuration check: link), LINK2, LINK3, LINK4, LINK5, LINK6.

    My hardware/software:

    Host:
    Ubuntu 18.04 (also I’ve check it on Ubuntu 20.04 and it also works)
    Qt ver. 5.12.3 (I also tried 5.12.9, but it didn’t work, probably there was something wrong with the fix that needs to be done on the sources) - you can install the “sources” and all the modules you need from Qt Online Installer (link) because later on you can add/remove modules/versions easily by lauching ~/Qt/MaintenanceTool
    QtCreator will be installed automatically (the newest version) when you use Qt Online Installer

    Target:
    Raspberry PI 3, with Raspbian Stretch

    Procedure:

    [on RPi] Edit sources list in /etc/apt/sources.list and uncomment the deb-src line: sudo nano /etc/apt/sources.list [on RPi] Update your system and install required libraries: sudo apt-get update sudo apt-get build-dep qt4-x11 sudo apt-get build-dep libqt5gui5 sudo apt-get install libudev-dev libinput-dev libts-dev libxcb-xinerama0-dev libxcb-xinerama0

    After installing MySQL itself on RPi install also MySQL libraries/packages to be used by Qt:

    sudo apt install mariadb-client libmariadb-dev-compat libqt5sql5-mysql [on RPi] Prepare our target directory sudo mkdir /usr/local/qt5pi sudo chown pi:pi /usr/local/qt5pi [on RPi] Correct links to EGL and GLES Drivers sudo rm /usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0 sudo rm /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0 sudo ln -s /opt/vc/lib/libbrcmEGL.so /usr/lib/arm-linux-gnueabihf/libEGL.so.1.0.0 sudo ln -s /opt/vc/lib/libbrcmGLESv2.so /usr/lib/arm-linux-gnueabihf/libGLESv2.so.2.0.0 [on host] Create our working directory and get a toolchain: mkdir ~/raspi cd ~/raspi git clone https://github.com/raspberrypi/tools [on host] Create a sysroot. mkdir sysroot sysroot/usr sysroot/opt rsync -avz pi@yourpi:/lib sysroot rsync -avz pi@yourpi:/usr/include sysroot/usr rsync -avz pi@yourpi:/usr/lib sysroot/usr rsync -avz pi@yourpi:/opt/vc sysroot/opt [on host] Adjust symlinks to be relative: wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py chmod +x sysroot-relativelinks.py ./sysroot-relativelinks.py sysroot [on host] Modify the qmake.conf –> mkspecs/devices/linux-rasp-pi3-g++/qmake.conf nano ~/raspi/qtbase/mkspecs/devices/linux-rasp-pi3-g++/qmake.conf

    VC_LIBRARY_PATH = $$[QT_SYSROOT]/opt/vc/lib
    VC_INCLUDE_PATH = $$[QT_SYSROOT]/opt/vc/include

    VC_LINK_LINE = -L$${VC_LIBRARY_PATH}

    QMAKE_LIBDIR_OPENGL_ES2 = $${VC_LIBRARY_PATH}
    QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL_ES2
    QMAKE_LIBDIR_OPENVG = $$QMAKE_LIBDIR_OPENGL_ES2

    [on host] Protect your “sources” by creating working folder: cd ~/Qt/5.12.3 tar jcvf qt-5.12.3-src.tar.bz2 Src cd ~/raspi tar xvf ~/Qt/5.12.3/qt-5.12.3-src.tar.bz2 mv Src qt-5.12.3-src

    You can remove from qt-5.12.3-src the modules that you don’t want (at least for now) leaving qtbase folder - this will shorten the building process.
    Create also working folder for the building (if building would be unsuccessful all you need to do is to delete the content of this folder and start again):

    mkdir ~/raspi/build_raspi cd ~/raspi/build_raspi [on host] Configure
    From ~/raspi/build_raspi ../qt-5.12.3-src/configure -release -opengl es2 -device linux-rasp-pi3-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -no-use-gold-linker -v -no-gbm -sql-mysql MYSQL_INCDIR=~/raspi/sysroot/usr/include/mysql MYSQL_LIBDIR=~/raspi/sysroot/usr/lib/arm-linux-gnueabihf

    Notice the above contains also building MySQL driver.

    Notice that the Config summary should contain (if it doesn't, you need to correct something... and do the configure again):
    EGLFS Raspberry Pi ................... yes
    MySql .................................. yes

    Regarding “-release” parameter read here (in other words you don’t need “-debug-and-release” and the warnings you can ignore… at least this is what I can read at the forum).

    [on host] Make
    From ~/raspi/build_raspi make

    You can use make -j 8 instead (much faster), but if there will be problems the all the “jobs” would need to finish and consequently it could be more difficult to find the error messages.

    [on host] Make install
    From ~/raspi/build_raspi: make install [on host] Deploy Qt to the device. We simply sync everything from ~/raspi/qt5pi to the prefix we configured above
    From ~/raspi: rsync -avz qt5pi pi@192.168.1.100:/usr/local [on host] Configuration of QtCreator: Tools > Options > Devices > Add > Generic Linux Device > Start Wizard Write: “Raspberry” (your custom name), “192.168.X.X” (your Raspberry PI address), “pi” (your Raspberry PI user) Don’t write anything at “private key”, click “Next” There will be error window with: “Device test failed” > Cancel Authentication type → choose: “Default” Now test connection (“Test” button) and after you give the password to the RPi it should be successful Kits > Compilers > Add > GCC > C Write: “GCC (Raspberry Pi)” as your custom name and: “~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc” as the path to the compiler Kits > Compilers > Add > GCC > C++ Write: “G++ (Raspberry Pi)” as your custom name and: “~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-g++” as your path to the compiler Regarding the debugger, you should install:
    [On Host]: sudo apt-get install gdb-multiarch

    I’m not sure if this is needed but you can also install on RPi:

    sudo apt-get install gdbserver Kits > Debuggers > Add Write: “GDB (Raspberry Pi)” as your custom name and “/usr/bin/gdb-multiarch” as the path to the debugger Apply Kits > Qt Version > Add Write path: ~/raspi/qt5/bin/qmake Write name: Qt %{Qt:Version} (qt5) Raspberry PI Apply Kits > Kits > Add Name: Raspi Device Type: Generic Linux Device The Device is the one created in the previous step We set the Sysroot to where we have the sysroot image: ~/raspi/sysroot Set compilers: "GCC (Raspberry PI)" and "G++ (Raspberry PI)" Set the Debugger to the one created previously Use the Qt version we created previously We don't need to set mkspec, so leave it empty. OK To enable your running application to have regular window do the following:
    Projects > Raspberry PI > Run > Environment > Batch Edit: DISPLAY=:0.0 QT_QPA_PLATFORMTHEME=qt5ct XAUTHORITY=/home/pi/.Xauthority XDG_SESSION_TYPE=x11

    If you don’t do this your application after starting up will be shown full screen but you will see it only when directly connect a screen to Raspberry PI (VNC desktop sharing will show nothing)
    14) [on host] In your Raspberry PI project, in .pro file, you need to show where the executable file should be placed: (LINK):

    target.path = /home/pi INSTALLS += target

    So comment the previous settings, eg.:

    # qnx: target.path = /tmp/$${TARGET}/bin # else: unix:!android: target.path = /opt/$${TARGET}/bin # !isEmpty(target.path): INSTALLS += target [on host] If you get: “WARNING: The code model could not parse a included file, which might lead to incorrect code completion and highlighting”:
    You need to deselect “ClangCodeModel” in HELP > ABOUT PLUGINS and restart QtCreator (LINK). You should be able to build/run/debug your project on RPi and connect to the MySQL database without "QMYSQL driver not loaded" error.
  • 0 Votes
    1 Posts
    670 Views
    No one has replied
  • 0 Votes
    26 Posts
    5k Views
    jsulmJ

    @vishbynature It's config.log file located in the same directory from which you called configure. It is a text file, nothing special. Look for compile errors in that file related to to what you need.

  • 0 Votes
    9 Posts
    4k Views
    jsulmJ

    @CodeinSipper said in installing Qbluetooth module:

    how to install it on windows?

    Using Qt Maintenance Tool from your Qt set-up.

  • 0 Votes
    5 Posts
    1k Views
    A

    @Pablo-J-Rogina
    I will look into it.

  • 0 Votes
    6 Posts
    1k Views
    IMAN4KI

    Seems to be a bug reported here QTBUG-50244

    Nobody tried to integrate MySQL for a Raspberry Pi project already ?! no workaround?!
    Seems strange :(

  • 0 Votes
    1 Posts
    724 Views
    No one has replied
  • 0 Votes
    7 Posts
    1k Views
    A

    @sneubert Thanks :)

  • 0 Votes
    7 Posts
    1k Views
    Pablo J. RoginaP

    @Andrex_Qt said in Responsive QtMainWindow on Startup.:

    i access them through C Api

    Could it be possible you share a link to such API for the benefit of other users just in case?

  • 0 Votes
    5 Posts
    2k Views
    JBonillaJ

    Hi, I described the steps I followed in a post over here, https://mechatronicsblog.com/cross-compile-and-deploy-qt-5-12-for-raspberry-pi/

    Some people found some issues and posted comments there, the “qendian” issue seems to be related to this bug, there is also a patch there.

    https://bugreports.qt.io/browse/QTBUG-71945

  • 0 Votes
    12 Posts
    3k Views
    SGaistS

    May I suggest to change for Python 3 ?
    Python 2.7 will reached end of life next year so it's not a good idea to start a new project with it.

  • 0 Votes
    1 Posts
    806 Views
    No one has replied
  • 0 Votes
    2 Posts
    698 Views
    KutyusK

    I tested it with Qt 5.11.0, but more deficiency detected.
    The General Attribute also undetected and characteristic write is not working :(

  • 0 Votes
    3 Posts
    1k Views
    C

    No, because they were neved emitted. I just found this: https://bugreports.qt.io/browse/QTBUG-38401, it seems that they are not implemented yet for Bluez 5. However, I would like to set the pin in only one-way, the raspberry shouldn't accept any pairing if the pin code (probably hardcoded in the raspberry) is different from the one entered by the user. Anyway, I'm not sure if this is possible.

  • 0 Votes
    4 Posts
    3k Views
    SGaistS

    Topic locked for duplication

  • 0 Votes
    6 Posts
    2k Views
    W

    I have found a solution here.
    Looks like Ubuntu couldn't run 32bit binary, but it's working now.