Closed jerkball closed 4 years ago
Hi
Basically qtcharts is not in Debian stable, so it won't be available on the Pi. You either have to compile it yourself, or you can install it from my APT repository ( I just finished working on it, so its not in the build guides yet). So what you want to do is add my repository to your apt sources, trust it public key and do an update:
echo "deb http://apt.viktorgino.me stretch/" | sudo tee --append /etc/apt/sources.list
wget -O - http://apt.viktorgino.me/public.asc | sudo apt-key add
sudo apt-get update
sudo apt-get upgrade
sudo reboot
Then you can install all the other dependencies:
sudo apt-get install qt5-default qml-module-qtquick2 qtdeclarative5-dev qtmultimedia5-dev libqt5multimedia5-plugins qml-module-qtquick* qml-module-qtmultimedia qml-module-qt-labs-settings qml-module-qt-labs-folderlistmodel qml-module-ofono qml-module-ofono libqt5charts5-dev qml-module-qtcharts qml-module-qtcontacts plasma-pa build-essential cmake protobuf-compiler libusb-1.0-0-dev libssl-dev openssl libglib2.0-dev libboost-dev libudev-dev libtag1-dev libprotobuf-dev libgstreamer1.0-dev gstreamer1.0-plugins-base-apps gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-alsa libgstreamer-plugins-base1.0-dev gstreamer1.0-pulseaudio libfaad-dev libfftw3-dev librtlsdr-dev libusb-1.0-0-dev mesa-common-dev libglu1-mesa-dev zlib1g-dev portaudio19-dev libsndfile1-dev libsamplerate0-dev git libgl1-mesa-dri xorg xinit rfkill fonts-droid-fallback fonts-liberation2 ofono ofono-dev ofono-phonesim pulseaudio bluez bluez-obexd pulseaudio-module-bluetooth libqt5xmlpatterns5-dev libqt5bluetooth5 qtconnectivity5-dev qml-module-qtbluetooth libkf5bluezqt-dev qml-module-org-kde-bluezqt libqt5gstreamer-dev libqt5gstreamerquick-1.0-0 libqt5gstreamer-1.0-0 libqofono-dev
After this you should be able to compile headunit-desktop with all the parts included and working
Thanks for your quick reply! Works like a charm... Thanks for sharing your repository...
Didn't recognize to be so near to developement...
Also thanks for your 4GB upload on your raspberry image files page...
I have set up Qt Creator on macOS for cross-compilation and successfully built Qt 5.12.3. Unfortunately, when trying to build headunit-desktop, I am experiencing similar qmake errors as jerkball
. After installing the libraries (notably bluez-qt and QtGstreamer) from your repository, viktorgino
, and accordingly updating my sysroot, everything has been reduced to the single but nonetheless fatal error:
Project ERROR: Unknown module(s) in QT: BluezQt
The project builds fine just fine (in about 30 secs on my macBook pro) when the phone-bluetooth submodule is not included. However, bluetooth HFP/A2DP is something I consider desirable for a head unit to have.
Here is what I have tried (to no avail):
/Volumes/rpi-xtools/staging/usr/lib/arm-linux-gnueabihf/qt5/qml
) containing org/kde/bluezqt to QML_IMPORT_PATH and QML2_IMPORT_PATH, both in the build enviroment and in various assignments of that variable in the different .pro
files. qmldir
and .qml
file in the BluezQt module to replace the path org.kde.bluez by BluezQt, circumventing the alias..qmltypes
file (by studying the sources of bluez-qt). This is correctly interpreted by the Qt Creator editor, but qmake still throws an error upon compilation. As a beginner to Qt, I must say that I don't quite understand how qmake finds the modules to import via the QT +=
directive in the .pro
file. (In this case, phone-bluetooth.pro
.) This is more clear to me on the level of the QML files. For instance, Phone.qml
in the phone-bluetooth
submodule imports the module/plugin via import org.kde.bluezqt 1.0 as BluezQt
. However, this exposes the namespace only to the QML files. If remove BluezQt from the QT +=
statement, the corresponding namespace is invisible to the C++ parts of phone-bluetooth
. Hence, instead of the missing QT module errors, the #include
statements in the header files of that submodule which refer to BluezQt (such as #include <BluezQt/Device>
) are declared erroneous. Since these are not actual paths to header files, including the bluez-qt header files is not a solution. (Rather, I suspect that this is something that the Qt preprocessor somehow magically converts into something palatable to C++.)
Apparently, this error does not occur if headunit-desktop is built directly on RPi. (This seems less than optimal for development purposes.) Any ideas how to solve this problem?
@aalldridge do you have bluez-qt installed? I'm not sure how package management works on macOS, but on Ubuntu and Debian the BluezQt packages are readily available: https://packages.debian.org/source/stretch/bluez-qt.
You can find info on how Qt modules work here : https://doc.qt.io/qt-5/qmake-advanced-usage.html but I don't think you will need to worry about this, the make system for BluezQt should take care of it for you.
If you dont have BluezQt readily available on mac then you can build it using these steps:
git clone https://anongit.kde.org/bluez-qt.git
cd bluez-qt
cmake . -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=lib/$(dpkg-architecture -qDEB_HOST_MULTIARCH) -DCMAKE_INSTALL_INCLUDEDIR=include -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-std=c++11 -DKDE_INSTALL_QMLDIR=/opt/qt59/qml -DECM_MKSPECS_INSTALL_DIR=/opt/qt59/mkspecs/modules
make -j4
sudo make install
You just need to replace /opt/qt59
with your Qt install dir.
You can follow the .travis.yml
file, the instructions there are correct, should help you on getting the additional dependencies working.
@viktorgino Thanks for the quick and detailed response.
Note that I am cross-compiling for RPi on my Mac. My toolchain is in place and I have cross-compiled Qt 5.12.3. Both the latter and the binary version of bluez-qt provided in your repository is installed in the sysroot (which I have kept separate from the toolchain in order to prevent pollution).
Unfortunately, the link you provided in the Qt documentation has not helped, so far.
For now, I am trying to compile bluez-qt from sources (again, cross-compiling with my toolchain. Configuring the build with cmake works, with this command line:
cmake . -DCMAKE_INSTALL_PREFIX=/Volumes/rpi-xtools/staging -DCMAKE_INSTALL_LIBDIR=/Volumes/raspi/qt5pi/lib -DCMAKE_INSTALL_INCLUDEDIR=/Volumes/raspi/qt5pi/include -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=-std=c++11 -DKDE_INSTALL_QMLDIR=/Volumes/raspi/qt5pi/qml -DECM_MKSPECS_INSTALL_DIR=/Volumes/raspi/qt5/mkspecs/modules -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_VERSION=1 -DCMAKE_C_COMPILER=/Volumes/rpi-xtools/armv8-rpi3-linux-gnueabihf/bin/armv8-rpi3-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=/Volumes/rpi-xtools/armv8-rpi3-linux-gnueabihf/bin/armv8-rpi3-linux-gnueabihf-g++ -DCMAKE_FIND_ROOT_PATH=/Volumes/rpi-xtools/staging -DQt5_DIR=/Volumes/rpi-xtools/staging/usr/lib/arm-linux-gnueabihf -DCMAKE_PREFIX_PATH=/Volumes/raspi/qt5pi -DCMAKE_SYSROOT=/Volumes/rpi-xtools/staging -DCMAKE_LIBRARY_PATH_FLAG=-L/Volumes/rpi-xtools/staging/lib/arm-linux-gnueabihf
Here,
/Volumes/rpi-xtools/armv8-rpi3-linux-gnueabihf
is my toolchain, /Volumes/rpi-xtools/staging
is my sysroot (with all the libraries required for headunit-desktop installed), and /Volumes/raspi/q5pi
is the location my target Qt5 binaries prior to installation in the sysroot.(Note that I am working with disk images as there are issues with non-case sensitive file systems on macOS.)
So, now the bluez-qt build aborts at about 19% because the linker is unable to locate some libraries (libdbus-1.so.3, etc.). The location of these is /Volumes/rpi-xtools/staging/lib/arm-linux-gnueabihf
, but I haven't figured how to pass these to cmake. I have tried adding
link_directories(/Volumes/rpi-xtools/staging/usr/lib/arm-linux-gnueabihf)
to CMakeLists.txt
, to no avail.
I've never tried building on OSX, but what about using Buildroot?
There is OSX specific version in case the official does not work: https://github.com/generia/buildroot-osx
and then use the buildroot headunit image builder: https://github.com/gregd72002/headunit-desktop-rpi-imagebuilder/tree/dev
@gregd72002
That sounds like a viable solution. After the headaches I have had so far, I shall give it a shot.
Trying to compile headunit-destop on Raspberrypi using Raspbian Stretch...
pi@CarPC:~/qt-gstreamer/build/headunit-desktop $ qmake && make -j4 sub-app-pro ( test -e Makefile.app || /usr/lib/arm-linux-gnueabihf/qt5/bin/qmake /home/pi/qt-gstreamer/build/headunit-desktop/app.pro -o Makefile.app ) && make -f Makefile.app Project ERROR: Unknown module(s) in QT: bluetooth BluezQt charts Makefile:41: die Regel für Ziel „sub-app-pro“ scheiterte make: *** [sub-app-pro] Fehler 3
(Sorry for german text)
After installing qtconnectivity5-dev error message changes to: Project ERROR: Unknown module(s) in QT: charts
Seems Charts feature is not recognized correctly...
Don't find any charts packages on raspbian stretch feed... only on sid, but version mismatch 5.7.1 - 5.9.2
Any help on compiling headunit-desktop on up-to-date raspbian stretch?
Thanks in advance