Servers by jDrones

How to cross-compile QGroundControl for Raspberry Pi3

Thanks @Seeelefant! I think the problem is not in Qt version, but in the Qt compilation process.
I’m trying this tutorial: https://mechatronicsblog.com/cross-compile-and-deploy-qt-5-12-for-raspberry-pi/
There is a little bit different rpi device in configuration string.

Thanks @kpetrykin, please keep me in the loop. I am strongly interested in this topic. Is it only a problem with cross-compilation? Couldn´t this be solved by using the new Raspberry 4B natively?

Finally i can build on raspberry pi 3 B+ with this configuration(after a lot of errrorrrrrrrr…):
Ubuntu 18.0.4 LTS
Rasp 2019-07-10-raspbian-buster-full.zip OS
qt-everywhere-src-5.11.3.zip
Qt Creator 5.11.3

Nice! How does the menus work now?

Alex

everything its fine.
I dont have any problem with menus , It looks like I’m working with Android but performance not good :rage::rage::rage:

Hmmm… Are you running the app embedded or within X?

@JAR4x4 i use embedded

@SajyBug thats nice. It was not verry slow when I got it to work the first time.

Can you post how you got it to work?

Alex

@SajyBug, what toolchain did you use for cross-compile?

@kpetrykin @JAR4x4
I didn’t do any extra work.I just changed the Qt version and rasp version.
every step of my cross complie its same as you explain in this post

@SajyBug ok! I will try on a RPi 4 as soon as I can get my hands on one. If that works with ok performance we need to make a ready to go image so more people can test this! :slight_smile:

2 Likes

Good news, everyone! Suddenly i’ve found, that default Qt version for current Buster is 5.11.3! (https://packages.debian.org/buster/qt5-default)
QGC succesfully builds (don’t forget to install Qt private headers: sudo apt install qtbase5-private-dev) and works with it.
Also, you need to edit your QGCCommon.pri (I made a dirty hack like that):

linux {
    linux-g++ | linux-g++-64 | linux-g++-32 | linux-clang {
#        message("Linux build")
#        CONFIG  += LinuxBuild
#        DEFINES += __STDC_LIMIT_MACROS
#        DEFINES += QGC_GST_TAISYNC_ENABLED
#        DEFINES += QGC_GST_MICROHARD_ENABLED
#        linux-clang {
#            message("Linux clang")
#            QMAKE_CXXFLAGS += -Qunused-arguments -fcolor-diagnostics
#        }
#    } else : linux-rasp-pi3-g++  {
        message("Linux R-Pi2 build")
        CONFIG += LinuxBuild
        DEFINES += __STDC_LIMIT_MACROS __rasp_pi2__
        DEFINES += QGC_GST_TAISYNC_ENABLED
        DEFINES += QGC_GST_MICROHARD_ENABLED

and install all dependencies which will appear during make and first run process.

Have fun!

@kpetrykin fantastic! Did you compilie on your desktop and deploy to the pi?

No, I compiled it directly on rpi4.
I’ve tested the image on rpi3 - everything works fine too.

@kpetrykin nice! How long did it take on the pi4?

Any chance you can post a quick step by step guide here?

Half an hour with “make -j4”.
I’ll try to post a guide a little later.

Could you please share your projects of why building QGC in RPi ? First post is an example : like runing in standalone with 7" screen. What about others ? (integrated in RC ? Custom GCS ? Streaming video with RPI ?)

@kikislater my setup now includes two RPi’s in my GCS with one 7" screen each. One runs OpenHD for RC and FPV, the other is supposed to run QGCS for mission planning.

I’m using a custom joystick board, and everything is mounted in a small Peli case, i will post pictures later

1 Like

So, here is short guide how to build QGC on Raspbian Buster with default Qt5 from repos. The exact steps and dependencies may vary, depend on what was already installed on your system:

  • Get the last Rasbian Buster image
  • Update and upgrade it
  • Into raspi-config:
    • “Advanced Options” -> “Memory Split” -> 256
    • “Advanced Options” -> “GL Driver” -> “GL (Fake KMS) OpenGL desktop driver with fake KMS”
  • Install dependencies from this guide:
sudo apt-get install libudev-dev libinput-dev libts-dev libxcb-xinerama0-dev libxcb-xinerama0
sudo apt-get install speech-dispatcher libudev-dev libsdl2-dev libgstreamer1.0-0 gstreamer1.0-plugins-base libgstreamer-plugins-base1.0-dev
  • Install Qt5 dependencies:
sudo apt install qt5-default qtbase5-private-dev qtbase5-dev qtbase5-dev-tools libqt5texttospeech5-dev libqt5svg5-dev qtmultimedia5-dev libqt5serialbus5-dev libqt5charts5-dev libqt5serialport5-dev qtdeclarative5-private-dev qttools5-private-dev qtquickcontrols2-5-dev libssl-dev
  • Install gstreamer plugins if you want videostreaming
  • You need to build QtLocation from sources, because QGC requires location-private and positioning-private which is not available into repos:
git clone https://github.com/qt/qtlocation.git
cd qtlocation
git checkout v5.11.3
mkdir build
cd build/
qmake ../qtlocation.pro
make -j4
sudo make install
  • git clone https://github.com/mavlink/qgroundcontrol.git
  • cd qgroundcontrol && mkdir build && cd build
  • git submodule update --init --recursive
  • I didn’t yet resolve the issue with missing “texttospeech” plugin, so just make an empty directory for successfull building: sudo mkdir /usr/lib/arm-linux-gnueabihf/qt5/plugins/texttospeech
  • Edit your QGCCommon.pri to build everything with right flags (maybe you know the better way, but this one just works):
linux {
    linux-g++ | linux-g++-64 | linux-g++-32 | linux-clang {
#        message("Linux build")
#        CONFIG  += LinuxBuild
#        DEFINES += __STDC_LIMIT_MACROS
#        DEFINES += QGC_GST_TAISYNC_ENABLED
#        DEFINES += QGC_GST_MICROHARD_ENABLED
#        linux-clang {
#            message("Linux clang")
#            QMAKE_CXXFLAGS += -Qunused-arguments -fcolor-diagnostics
#        }
#    } else : linux-rasp-pi3-g++  {
        message("Linux R-Pi2 build")
        CONFIG += LinuxBuild
        DEFINES += __STDC_LIMIT_MACROS __rasp_pi2__
        DEFINES += QGC_GST_TAISYNC_ENABLED
        DEFINES += QGC_GST_MICROHARD_ENABLED
  • qmake -r ../qgroundcontrol.pro CONFIG+=release
  • make -j4
  • When everything will be compiled, cd to ./release directory and run ./qgroundcontrol-start.sh. It will show errors about missing QML plugins - you should apt search for them and install.
  • Enjoy!
1 Like

@kikislater, just want to run QGC and some kind of Open.HD on one device.

1 Like
Servers by jDrones