How to cross-compile QGroundControl for Raspberry Pi3

Is there any news on this topic? In my opinion with the new Raspberry Pi 4 it´s hotter than ever.

Hello!

I’ve tried to build QGC master by the beginnigs of July, which requires Qt 5.11.3.
I get 5.12.0 (because there’s no “single” “qt-everywhere” for 5.11.3).
Build process ended just fine, but when i try to run this QGC on RPi, it says me “illegal instructions”.

So, my question is: “what obvious mistakes are in my build try?” Maybe there is no chances to succes with that Qt version?

Thanks!

This https://download.qt.io/archive/qt/5.11/5.11.3/single/ does not help?

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

1 Like

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!

1 Like

@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 ?)