Page Contents
Introduction to LCD Displays and GUI Applications
This is the first video in a set of three on Qt application development on the Beaglebone or any other embedded Linux device. This video introduces the LCD module that I used, reviews it and then discusses how you can install it and develop very basic on-board GTK GUI applications.
Setting up QT Creator for C++ ARM Embedded Linux Development
This leads to the second video where I set up a full toolchain for Qt application development under embedded Linux (Qt for embedded devices). This toolchain allows us to cross compile Qt applications for the Beaglebone, deploy the applications directly to the beaglebone with a single click and even use remote debugging using gdbserver to diagnose any problems with our applications. The main use of this platform is for GUI application development when a LCD module, or external display is present.
Thad Failor (via YouTube) provides some information on how to deal with the requirement to execute . /usr/local/angtrom/arm/environment-setup in advance of starting QtCreator. The steps are:
– Open Qt Creator
– Open your project
– Click Projects under [Your Beaglebone Kit]
– Click Build
– Scroll down to the bottom and click details
– Click on Batch
– Edit Paste the contents of the “. /usr/local/angstrom/arm/enviroÂÂnment-setup” removing any of the “export” commands.
Example Qt Embedded Linux Application on the Beaglebone
This is the third video in a set of three on Qt application development on the Beaglebone or any other embedded Linux device. This toolchain allows us to cross compile Qt applications for the Beaglebone, deploy the applications directly to the beaglebone with a single click and even use remote debugging using gdbserver to diagnose any problems with our applications. The main use of this platform is for GUI application development when a LCD module, or external display is present.
In this the final video in this series I demonstrate an example application that uses a BMA 180 accelerometer and LED to act as output/input devices and I provide the full source code. I explain how the source code is structured and how the physical circuit was configured.
Source Code
The full source code for the code in these videos is available on my github site. You can clone this by typing:
1 | git clone git://github.com/derekmolloy/beagleboneQT.git |
at the Linux prompt, or by installing some git tools under Windows.
The QtCreator project file is:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | #------------------------------------------------- # # Project created by QtCreator 2013-03-03T16:36:32 # #------------------------------------------------- QT += core gui greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = beagleboneQT target.files=beagleboneQT target.path=/home/root INSTALLS+=target TEMPLATE = app SOURCES += main.cpp\ mainwindow.cpp \ SimpleGPIO.cpp \ EasyDriver.cpp \ BMA180Accelerometer.cpp HEADERS += mainwindow.h \ SimpleGPIO.h \ EasyDriver.h \ BMA180Accelerometer.h FORMS += mainwindow.ui |
And the core C++ files are mainwindow.h:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | /* * mainwindow.h * The main window for the QT Application * * Copyright Derek Molloy, School of Electronic Engineering, Dublin City University * www.eeng.dcu.ie/~molloyd/ * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> #include <QTimer> #include "BMA180Accelerometer.h" namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); private slots: void on_ledOnButton_clicked(); void on_ledOffButton_clicked(); void on_ledAutoButton_clicked(); void on_lightLevelDial_valueChanged(int value); //manually created void newAccelerometerDataSlot(); private: Ui::MainWindow *ui; unsigned int GREEN_LED_PIN; BMA180Accelerometer *accelerometer; bool autoLEDState; QTimer dataTimer; void autoLED(bool value); }; #endif // MAINWINDOW_H |
And mainwindow.cpp
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | /* * mainwindow.cpp * The main window for the QT Application * * Copyright Derek Molloy, School of Electronic Engineering, Dublin City University * www.eeng.dcu.ie/~molloyd/ * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL I * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "mainwindow.h" #include "ui_mainwindow.h" #include "SimpleGPIO.h" #include "BMA180Accelerometer.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); // Green LED Pin // use SimpleGPIO.h to setup the LED Pin correctly as an output pin using MODE 7 (GPIO0_7) // if you don't understand these steps watch my video on YouTube // "Beaglebone: GPIO Programming on ARM Embedded Linux" gpio_omap_mux_setup("eCAP0_in_PWM0", "07"); //gpio0_7 P9 header pin# 42 this->GREEN_LED_PIN = 7; //gpio number (0x32)+7 = 7 state of the class for sharing gpio_export(this->GREEN_LED_PIN); gpio_set_dir(this->GREEN_LED_PIN, OUTPUT_PIN); // Set up the Accelerometer this->accelerometer = new BMA180Accelerometer(3, 0x40); this->accelerometer->setBandwidth(BW_150HZ); this->accelerometer->setRange(PLUSMINUS_1_G); autoLED(false); connect(&this->dataTimer, SIGNAL(timeout()), this, SLOT(newAccelerometerDataSlot())); this->dataTimer.start(100); } // My manually created Slot void MainWindow::newAccelerometerDataSlot() { accelerometer->readFullSensorState(); double p = accelerometer->getPitch(); double r = accelerometer->getRoll(); ui->pitchSlider->setValue((int)p); ui->rollSlider->setValue((int)-r); QString pitchString = "", rollString = ""; pitchString.append(QString("%1").arg((int)p)); rollString.append(QString("%1").arg((int)-r)); ui->pitchNumber->display(pitchString); ui->rollNumber->display(rollString); int dialValue = ui->lightLevelDial->value(); if(this->autoLEDState){ if(((int)p)>=dialValue || ((int)-r)>=dialValue){ ::gpio_set_value(this->GREEN_LED_PIN, HIGH); } else{ ::gpio_set_value(this->GREEN_LED_PIN, LOW); } } } MainWindow::~MainWindow() { delete ui; } void MainWindow::on_ledOnButton_clicked() { ::gpio_set_value(this->GREEN_LED_PIN, HIGH); autoLED(false); } void MainWindow::on_ledOffButton_clicked() { ::gpio_set_value(this->GREEN_LED_PIN, LOW); autoLED(false); } void MainWindow::on_lightLevelDial_valueChanged(int value) { QString temp = ""; temp.append(QString("%1").arg(value)); ui->lightLevelEdit->clear(); ui->lightLevelEdit->insert(temp); } void MainWindow::on_ledAutoButton_clicked() { autoLED(true); } void MainWindow::autoLED(bool state){ if(state){ this->autoLEDState = true; ui->statusBar->showMessage("Auto LED Enabled"); } else{ this->autoLEDState = false; ui->statusBar->showMessage("Auto LED Disabled"); } } |
Hello Derek,
I try to follow the Video to set up Qt
To install Qt4-embedded on the latest Beaglebone Image I fault with this
root@beaglebone:~# opkg install qt4-embedded
Installing qt4-embedded (4.8.1-r50.1.2) to root…
Downloading http://feeds.angstrom-distribution.org/feeds/v2012.12/ipk/eglibc/armv7a-vfp-neon/base/qt4-embedded_4.8.1-r50.1.2_armv7a-vfp-neon.ipk.
qt4-embedded: unsatisfied recommendation for qt4-embedded-common
qt4-embedded: unsatisfied recommendation for libqt-embeddeduitools4
qt4-embedded: unsatisfied recommendation for libqt-embeddedassistantclient4
libgles-omap3-flipwsegl: unsatisfied recommendation for libgles-omap3-flipwsegl-es2
libgles-omap3-linuxfbwsegl: unsatisfied recommendation for libgles-omap3-linuxfbwsegl-es2
libgles-omap3-blitwsegl: unsatisfied recommendation for libgles-omap3-blitwsegl-es2
libgles-omap3-frontwsegl: unsatisfied recommendation for libgles-omap3-frontwsegl-es2
libgles-omap3: unsatisfied recommendation for libgles-omap3-es2
qt4-embedded: unsatisfied recommendation for libqt-embeddedmediaservices4
qt4-embedded: unsatisfied recommendation for libqt-embeddedopengl4
qt4-embedded: unsatisfied recommendation for libqt-embeddedpvrqwswsegl4
Collected errors:
* satisfy_dependencies_for: Cannot satisfy the following dependencies for qt4-embedded:
* kernel-image-3.2.30 *
* opkg_install_cmd: Cannot install package qt4-embedded.
root@beaglebone:~#
Do You have any hints for that?
regards
Joerg
ps. thank You for the verry helpfull Tutorials and other stuff You have made !!! I would like to have courses at Yours but it is to fare away from Germany 😉
Thanks Joerg. I have tried it on my Beaglebone Black and even after an opkg update it is not working. It looks like there is a problem with that distribution. It may be easier to build your own distribution for Angstrom than trying to fix this directly (See the guide to building Angstrom in my blog). Either that or wait until this issue is addressed by a new distribution.
Hello Derek,
thanks a lot for your clear and well exposed tutorial.
I’ve the same Joerg’s fault.
Moreover i see that beaglebone try to install
qt4-embedded (4.8.1-r50.1.2)
In
http://www.angstrom-distribution.org/toolchains/
or in
http://www.angstrom-distribution.org/toolchains/next
there are toolchains for QTE-4.6.3 or QTE-4.7.1
No QTE4.8.1 is present.
I imagine that beaglebone and Ubuntu toolchain should have the same review.
I’m in wrong?
Do You have any hints for that?
regards
Pierluigi
Yes, as I just posted to Joerg, there is a problem with the current distribution; unfortunately to fix this yourself would likely mean rebuilding the distribution. It would be very good to keep the client versions the same for cross development. Derek.
Hello Derek,
Keep the same version of qt4-embedded on the beaglebone and on ubuntu is a little difficoltous.
For very simple program is possible to compile directly on beaglebone?
example:
I’ve installed qt4-embedded on beaglebone.
In /usr/bin/qtopia there are a lot of demos and example.
Is possible modify a demo and recompile it directly on beaglebone.
Do You have any hints for that?
Thanks in advance
Pierluigi
Hi Pierluigi, yes it is possible to compile directly on the Beaglebone. Assuming you are in the directory of your Qt project on the Beaglebone itself, you can use qmake to create a Makefile from your project file and then run make. Just check that your path is set correctly, Derek.
Hello everyone, I may have a solution – I flashed the most recent Angstrom distribution “BBB-eMMC-flasher-2013.07.31.img”. I did get the same error at first, and then I tried “opkg install qt4-embedded –force-depend”. It gave 2 warnings. The remote deploy successfully sent the files over to the Beaglebone. From the ssh terminal I entered “./QTtest2” (I’m up to 33mins into the video) and got a lot of ‘QWSSocket’ failures, so then I tried “./QTtest2 -qws” and it appears to run (well, it’s doing something) without generating any errors. I have a problematic LCD screen (800×600) so I can’t say for sure that it works, but I believe it may be.
I previously tried rolling back to an earlier distribution (20-May-13), which did not work, and the “–force-depend” trick would not work on that distribution either.
Hope this is useful to someone.
Yours, David
P.S. Derek, thanks very much for the video’s they are fantastic.
Thanks Dave that worked for me
I failed install cross-compile toolchain on my ubuntu laptop.
Compile and run Qt on BBB directly is possible. I have tried that. It works. The only thing is debug and compile will be slow because the limited resources on BBB.
Hello.
Thanks for the tutorials. I have a question. How can I use Qt on BeagleBone Black Ubuntu 12.10 ? I can’t compile sources for BeagleBone. I have arm-linux-gnueabi toolchain but I can’t use this. I can add new compiler but I don’t found qmake. Qt version is 2.7.2. Thanks good work.
Hello Derek,
Any luck getting Qt 4.8.5 (newest) working on Beagle Bone Black? I’ve tried to no avail.
Thanks
Chris
Hi Derek,
I am using a LCD4 cape and I just figured that SPI0 is used by the down button on the cape. Is it possible to still use SPI bus at the same time with the cape? I wanna read data in fast and also have a nice user interface.
Thanks.
Derek,
I have a BeagleBoard-xm with a monitor attached on the HDMI port and these tutorials worked great! Using Ubuntu 12.04 and QtCreator 2.7.0. I am able to build Qt apps and remote debug.
Thanks!
David
Hello Derek,
I managed now qtcreator works with my environment. Many thanks for that.
Just one thing for the moment.
Hardware access need root permission, so everything works with the root user.
In view of the safety, I search a way to work with a none root user. I try something with change the group of /sys/class without success
I hope You have a better way.
Joerg
One important point I just figured out today. On the Qt website the latest Qt build is Qt 5.1. However, the Angstrom cross-compile tools as of today are using Qt 4.6.3. Notice when the BeagleBoneKit is made it says Qt 4.6.3 for the Qt version.
I ran into a problem when testing some example code since the examples I was using were for Qt 5.1 but the cross-compiler tools use 4.6.3. Some of the objects have changed from the earlier version.
OK, this issue was talked about a little earlier. I can still use the Qt Creator 5.1 but I need to make sure that I don’t use the objects from this release, only those from 4.6.3.
I started following the video, but had some problems (BeagleBone black + QT 4.8.5). Eventually I wrote my own tutorial which includes recompiling QT (instead of using Angstrom installation) –
http://www.cloud-rocket.com/2013/07/building-qt-for-beaglebone/
Hello there,
To all that are having problems with the qt4-embedded and the latest kernell (3.8) I think It may run adding the flag “–force-depends”
P.D.: Derek, great web!!!!
Hello, I’m having a problem with Qt-creator. I have a fresh installation of ubuntu 13.04 and Qt-creator 2.8.0. When I deploy to the Beaglebone I get the error “mainwindow.ui: Command not found”. It seems that it’s using ‘make’ from /usr/bin/make rather than /usr/local/angstrom/arm/bin/make (see compile output listed below). If I use a terminal to go to the /usr/local/angstrom/arm/bin and then enter the command ‘make’ it works, I can then press the green triangle and it deploys just fine. I can set the path for qmake in Options->Build&Run->QtVersions, but I don’t see how I can enter the path for make. It’s not the worst problem in the world, but i thought I’d post incase anyone else gets stuck at the error message. If you have a real fix Derek, I’d love to hear it.
23:38:50: Running steps for project P1…
23:38:50: Starting: “/usr/local/angstrom/arm/bin/qmake” /home/david/QTPROJECTS/P1/P1.pro -r -spec linux-gnueabi-oe-g++ CONFIG+=debug
23:38:50: The process “/usr/local/angstrom/arm/bin/qmake” exited normally.
23:38:50: Starting: “/usr/bin/make”
mainwindow.ui -o ui_mainwindow.h
make: mainwindow.ui: Command not found
make: *** [ui_mainwindow.h] Error 127
23:38:50: The process “/usr/bin/make” exited with code 2.
Error while building/deploying project P1 (kit: Beaglebone_192.168.1.70-Generic Linux Device)
When executing step ‘Make’
23:38:50: Elapsed time: 00:00.
P.S. Alejandro, yes I also find “opkg install qt4-embedded –force-depend” works, the screen does display, but on my system the touchpad entry doesn’t seem to work (even with the environment variable set and the screen calibration program has been used and tested).
That doesn’t really make sense to me. For one thing, there is no “makefile” in the /usr/local/angstrom/arm/bin directory. So when you run make from there…there’s nothing there to “make.” So I believe what you meant to say was that you need to go into the PROJECT directory, and (after running qmake) there will be a Makefile there. Then you can run “make” from that directory, which results in an executable.
The problem with this however is that it doesn’t remote deploy the executable–you have to FTP it over to the Beaglebone. Furthermore, since it doesn’t remote deploy, I don’t know that there’s a way to actually debug remotely then either. I’m still exploring this problem a bit more, as I haven’t gotten it completely resolved.
As for the issue of installing qt4-embedded on the Beaglebone, I think the problem that folks are having is in large part related to having an Angstrom OS with a newer version of the kernel than the 3.2.20 kernel that qt4-embedded is looking for. I rolled back to the same version of Angstrom that Derek uses in his videos, and that took the qt4-embedded installation without a problem. I didn’t even have to use the –force-depends option, like I did with the 3.8.x kernel. Here is the direct link to the Angstrom version that Derek uses in the videos:
http://downloads.angstrom-distribution.org/demo/beaglebone/archive/Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.05-beaglebone-2012.11.22.img.xz
TB
Hi!
Very nice video! I noticed that there is a newer Angstrom toolchain:
angstrom-eglibc-x86_64-armv7a-vfp-neon-v2012.12-toolchain.gz
Unfortunately, it does not have Qt included.
Is it possible to somehow manually add latest Qt to that toolchain?
Thanks,
Anguel
I have a 7″ LCD screen and the touchscreen (mouse) part didn’t work under Q’t. The remedy for me was (from an SSH session to the Beaglebone):
opkg update ; opkg install qt4-embedded qt4-embedded-plugin-mousedriver-tslib
(followed by a reboot).
Hope this is useful to someone,
David
Yes, this was very helpful I have been wracking my brain trying different distros and versions trying to get the darned mouse to work. I really appreciate the post!
Dave W,
Thank you! My 4DCAPE-43T (4″ LCD with touchscreen) cape from http://www.4dsystems.com.au/product/22/125/Beagle_Bone_LCD_Capes/4DCAPE-43/ which claims to use the same drivers as the LCD4 also did not react in Qt. Installing qt4-embedded-plugin-mousedriver-tslib seems to solve the problem. Thank you once again!
Now I have another strange problem, my touchscreen works but it is not very accurate, although calibrated. From time to time it “pulls” the pointer up/down or to the sides, e.g. when I try to draw (some kind of jumping). No idea if this is the touchscreen, improper debouncing, the ADC of the BeagleBone Black or some driver problem. Any hints are welcome. Running 2013.08.21 Angstrom image.
Anguel
First of all, nice tutorials! They helped me a lot when I started. Unfortunately, there are not too many useful tutorials for embedded systems.
although this question is quite old it still might help somebody else: the touchscreen jitter comes from a bug in the driver! I tested with Angstrom image 2013-09-04 an had that really weird jitter (almost thought my cape is broken). Using an image <=2013-06-20 image works without any problems. 4DSystems also mentions that problem in the datasheet (at the very end). However, the bug is not their fault since they provide hardware only. Not sure at what version (or if ever) this bug will be fixed.
Also it seems that the Angstrom download page for Toolchains is down for quite some time already… i found another link that worked: http://web.archive.org/web/20131105184456/http://www.angstrom-distribution.org/toolchains/
Cheers, and keep on delivering great tutorials, Derek!
Glad it was helpful Anguel. I observe the same begaviour with my LCD7 cape Rev A3 from circuitco. I can also replicate this under gdm but it does not get replicated when using ts_test, which draws lines only where I tap (it works perfectly). So, it isn’t hardware for me, I suspect it is likely a problem with the mouse driver used for Qt and gdm. Discarding the first point after a press looks like it would solve the problem. I’m afraid it will need someone much better than me to fix that. David
Hello
I have also the BBB and the 4DCAPE-43T, but the touchscreen doesn’t work when I run the programm. I have installed the tslib and run ts_test, the touchscreen works fine.
Then I export it like this: export QWS_MOUSE_PROTO=LinuxInput:/dev/input/event0
Then start the qt, but the touchscreen doesn’t react.
Patrick
@Pjwl
You may find that the event number is event 1. or export QWS_MOUSE_PROTO=LinuxInput:/dev/input/event1. Just check the directory to find the link.
I did a fresh install of Ubuntu and found that setting the environment variable QWS_MOUSE_PROTO to LinuxInput:/dev/input/event0 did not work. Instead I did tslib:/dev/input/event0 and it worked. Just letting people know incase it’s useful.
Patrick, you set the environt variable within Qt, see 33mins 02secs into Derek’s Qt creator video (from Projects Beaglebonekit, Run, EnvironmentVariables, Details). If it still doesn’t work try the line below, it worked for Anguel and I. Line to install qt-embedded plugin for mousedrivers:
opkg install qt4-embedded qt4-embedded-plugin-mousedriver-tslib (followed by a reboot).
David
Hello,
I’ve got a problem my Qt version. When I download the toolchain it is only for Qt version 4.6.3, but the http://qt-project.org/downloads site only offers Qt version 5.1 or 4.8. When I now create a kit with the compiler from the toolchain I get the eror message, that it can’t compile version 5.1.
Within the toolchain-package is a qmake at user/local/angstrom/arm/bin, so I tried adding this version to the kit, but there I get the message, that this Qt-version is not properly installed.
I tried several How-Tos and guides, but I just can’t manage to get it installed properly. If someone could help me or send a link to a good guide I would be very thankfull. I use Ubuntu and am pretty new to Linux.
Best regards
Rafael
Or to reformulate my question: Where do I get the mkspec file for the Qt-Version, that came with the toolchain, from?
Wel it took me some time, but with http://www.cloud-rocket.com/2013/07/building-qt-for-beaglebone/ I maged to get it working. Big thank you to Meir.
Hello,
I have also the BBB and the 4DCAPE-43 but how i want use 5 keys (up down right left and enter on the LCD) in my QT project ?
You can use scp instead of sftp. like this “scp ./testQT root@192.168.1.108:./tesdir/”, ./testQT is file path to copy to bbb ip 192.168.1.108 as user root. File will be copied to beagle ./tesDir.
Thank you so much for the tutorials.
Hello Derek,
I have used Eclipse to cross compile C/C++ apps for the Beaglebone Black running Ubuntu. I am only running a SSH environment on the BBB. No graphics needed as it only collects data, stores and forwards to a server repository. I am now looking to use a browser to look at the data and modify certain parameters by the user back on the BBM application, I am starting to use QT creator for this and would like to migrate to QT for cross compiling the app code for the BBB. I have been looking for some time and cannot find any guidance for setting up QT creator for cross compiling to BBB running Ubuntu. Essentially what you have done above but for ubuntu on the BBB from a Mint/Ubuntu development environment. Any suggestions??
Thanks
Ed
Is there any way to use QT Creator in Windows stead of Linux to program the BBB?
Hi Derek,
I am wondering if you are going to update this tutorial for Qt5.2 and BeagleBoneBlack, I found it very difficult to cross-compile Qt 5.2 apps on Desktop or compiling Qt Creator for BBB. (I mean for the ubuntu 13.10/12.04 armhf image for BBB).
It seems the minimum linux kernel that is required to support SGX is 3.12.x and the Angstrom distribution has not made a new distribution for a while so I tried to use ubuntu images with kernels 3.12.x and higher with no success.
So would you mind kindly share any kind of “How to’s” on compiling/cross compiling Qt5.2 applications for BBB.
Thanks in advance
So would I
I’ve tried three days. no success. So I use BBB compile it directly. No cross-compile
Is there anyone else having a problem with 4D LCD 7′ touchscreen ??
A few minutes into the second video (Part 8) you appear to be fetching links that are 3 years old!
Do you have a more up to date version of how to install and use QT Creator and cross compile ?
Basically a 2014 version of video # 8
Thanks
Hi!
First of all, thanks Derek Molloy for these videos!!
Related to Qt part 2, I´m having problems to display the app directly in the LDC7 connected to the beaglebone black..
I mean, I´ve configured the kit as explained in the video and apparently I have the same but when I run it the Application output shows the error message “sh: /home/root/test1: cannot execute binary file. Remoete application finished with exit code 126”.
I don´t know what I´m doing wrong because if I compile it directly, in terminal, with qmake2 it works fine.
Thanks for any help!
Hi Derek
Thanks for the time and effort to make these videos.
Does anyone know when the Angstrom site will return to full operation ?
I been looking for the 32 bit version (angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2) of the qte tool chain. I found a archive version of it but it is corrupted it gives an error when you try to uncompress it. If anyone has the file and is willing to share it or has link to it. This is the link I tried http://web.archive.org/web/20130801143314/http://www.angstrom-distribution.org/toolchains/
I have the same problem here. Need toolchain file that isn’t corrupted! I’ve looked all over, but have yet to find one.
You can make it work if you install both the Qt version and the non Qt version. They compliment each other and you end up with a working toolchain. I installed the Qt version first and it failed on a file called cpp1plus.. I deleted the corrupt file and then installed the non Qt toolchain.. You can get the toolchains from archive.org here: http://web.archive.org/web/20130823131954/http://www.angstrom-distribution.org/toolchains/
I think I was wrong. But the non Qt toolchain isn’t corrupt. You can use that to compile your own Qt. These instructions mostly worked http://qt-project.org/doc/qt-4.8/qt-embedded-crosscompiling.html.
Good afternoon.Please tell me how you can customize the touchscreen display and buttons for the BBB.My screen looks like a CircuitCo: BeagleBone LCD4.I’m on the SD-card installed for BBB Sitara Linux:3.2.0 # 1 Wed Sep 18 04:10:43 PDT 2013 armv7l GNU / Linuxbut there is no driver for the touchscreen and buttons.I was looking for «/ dev/input/touchscreen0», but I have a directory «/ dev / input /» empty .I tried to write to SD- card other OS:Ubuntu (Saucy 13.10): http://elinux.org/BeagleBoardUbuntuAngstrom (Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.12-beaglebone-2013.09.05.img.xz): http://downloads.angstrom-distribution.org/demo/beaglebone/But they display is not working.I did everything on your video “Introduction to LCD Displays and GUI Applications”. But I will not turn on the screen after the power supply , as you on video ( 8:50 ) .Maybe you know what could be the problem?
Good afternoon.
Please tell me how you can customize the touchscreen display and buttons for the BBB.
My screen looks like a CircuitCo: BeagleBone LCD4.
I’m on the SD-card installed for BBB Sitara Linux:3.2.0 # 1 Wed Sep 18 04:10:43 PDT 2013 armv7l GNU / Linuxbut there is no driver for the touchscreen and buttons.
I was looking for «/ dev/input/touchscreen0», but I have a directory «/ dev / input /» empty .
I tried to write to SD- card other OS:
Ubuntu (Saucy 13.10): http://elinux.org/BeagleBoardUbuntu
Angstrom (Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.12-beaglebone-2013.09.05.img.xz): http://downloads.angstrom-distribution.org/demo/beaglebone/
But they display is not working.
I did everything on your video “Introduction to LCD Displays and GUI Applications”. But I will not turn on the screen after the power supply , as you on video ( 8:50 ) .
Maybe you know what could be the problem?
Hi;
I have beaglebone white. I dont have LCD how can i make remote desktop connection with my BBW
I load it http://downloads.angstrom-distribution.org/demo/beaglebone/archive/Angstrom-Cloud9-IDE-GNOME-eglibc-ipk-v2012.05-beaglebone-2012.11.22.img.xz
I try with xrdp but i cant connect it. It says “auth successfull but some problems” and dont connect.
Regards
Hi Derek,
The video misses out the part where you configure the QT Version entry in QT Creator. I don’t have the option to select “Qt 4.6.3 in PATH (arm)”.
Please help!
Thanks,
Anthony Webber
I am getting a very strange problem with my BBB,
The GTK and Qt Applications arnt working at all
GTK shows the following error:- the pkg-config………………………isnt a directory or something .like that.
and the QT4 embedded opkg failed to install qt4 embedded.
what should I do now.I am stuck on this for about a week or soo.
Kindly help me a bit on this.
I have tried opkg update followed by the opkg install commands on emmc angstrom and fresh 4Gb SD angstrom on my BBB.
and g++ is installed in the system but it shows there “isnt a directory or something”
Cannot use mouse or touch when I deploy the application. Just the application is visible, cant click any botton, cant even move the mouse..
Please suggest..
Thanks in advance
Amey,
If you are using the CloudRocket blog instructions (http://www.cloud-rocket.com/2013/07/building-qt-for-beaglebone/) from Mier above, you need to add the following options to ./config:
-qt-mouse-tslib -plugin-mouse-tslib
Then just follow the rest of the video. This worked for BB with Circuitco LCD7 for me.
Derek,
Thank you for the tutorial, which greatly helped me to develop few lines of demo code for Beaglebone Black + ADXL345 accelerometer + GUI front end combination. I have posted the code on github for the benefit of greater open source community. Below is the link.
https://github.com/mahengunawardena/BeagleboneBlack_ADXL345_GUI
Thank you again
Hi,
im using AM3354 processor based SBC for one of my application. In this using QT I need to build the application and run it on SBC. I have installed TI SDK 6.0.0 and QT creator 2.7.1. While configuring the QT, it is showing Invalid QT version. Please let me know the possible reasons for getting this message.
Im unable to get the applications and libraries optin under New file or project. Because of this im unable to proceed to further.
Please help me.
Thanks in advance.
I cross compiled the Qt-5.2 for Beagle Bone Black (BBB). The libraries are compiled perfectly and working great. But I am facing two different issues
1) I m running Ubuntu on BBB and i also installed LXDE (Light Weight Desktop Environment) on BBB. When I am running Qt example or even my Applications. Nothing is appearing on the Screen. Instead I am getting an error
failed to set graphics mode inappropriate ioctl for device
2) Then i installed everything on other BBB , except LXDE. Now i am using console on this BBB. When I am running the example or applications. They are executing perfectly. But my mouse cursor hangs and also my screen hangs then i need to run the BBB via SSH. Any hint about this problem?
Hello Sir,
I have been trying to deploy Qt5.4 application on a BBB with Debian on it. Can you just guide me on how to do it? Till now I have downloaded Qt5.4 on my Windows 7 machine and Windows toolchain for BBB from http://gnutoolchains.com/beaglebone/ . I have even modified the Kit in the Qt5.4 to use the toolchain and connect it to the BBB. When I am running my app it is being deployed on my Desktop. Can you tell me how I can deploy it on my BBB.
One more thing is that I don’t have an LCD cape but I can access the BBB Desktop via VNC server application called tightVNC. Will it work with Qt5.4.
Thanks and Regards
Sounak Ranjan Das
Hi Derek,
First of all, thank you for all your posts and videos on BeagleBone Black, it is very helpful ! Despite your current article, I still have a question. I’m interested in using a 7″ Touchscreen to develop a QT5 interface, but I don’t know if the graphic chip of the beaglebone could be used with a non-hdmi screen (spi, or 24 bits). I already own a Raspberry Pi and it is not possible so before I switch to BeagleBone Black I want to be sure that I will be able to have accelerated QT5 interface on a LCD screen 😉
Best regards,
STEMax
Hello Derek,
I am trying to cross-compile QT for my BeagleBone Black on MAC OS X by following the instructions given here-
http://www.welzels.de/blog/en/arm-cross-compiling-with-mac-os-x/
But he is using Debian in BBB and I’m running Angstrom image in BBB. To remove lightdm, he gives the following commands-
apt-get remove lightdm
but my computers shows-
-sh: apt-get: command not found
Then I entered the following command but it still shows the errors-
root@beaglebone:~# update-rc.d -f gdm remove
update-rc.d: /etc/init.d/gdm exists during rc.d purge (continuing)
Removing any system startup links for gdm …
/etc/rc0.d/K20gdm
/usr/sbin/update-rc.d: line 60: rm: command not found
/etc/rc1.d/K20gdm
/usr/sbin/update-rc.d: line 60: rm: command not found
/etc/rc2.d/S99gdm
/usr/sbin/update-rc.d: line 60: rm: command not found
/etc/rc5.d/S99gdm
/usr/sbin/update-rc.d: line 60: rm: command not found
/etc/rc6.d/K20gdm
/usr/sbin/update-rc.d: line 60: rm: command not found
root@beaglebone:~# systemctl disable gdm
-sh: systemctl: command not found
root@beaglebone:~# systemctl disable gdm
-sh: systemctl: command not found
root@beaglebone:~# mv /lib/systemd/system/gdm.service ~/gdm.backup.service
-sh: mv: command not found
Please help me so that I can do some development with the board.
Hi Derek
Your tutorial are awesome and very helpfull.
I was just wondering if you have had time to play around with the “Ubuntu Device” as such.
Currently I am attempting to get 1 of my BBB boards loaded with an image that lets QT pickit up as an Ubuntu Device, as yet to no avail.
Have you had any success in this area ?
I have loaded the lates ubuntu SDK and am downloading the “Snappy image ” to see if that works.
Thanks again for your great work.
Hi Greg, Thanks. I have used Ubuntu in the past with good results, but not recently. Ubuntu has great device support (USB in particular) but less support from the BeagleBone community on accessing the BeagleBone-specific hardware — e.g., ADC, PRU. I find that the Debian image works really well and has almost the same level of device support, but with the advantage of low-level support for BeagleBone-specific hardware. I think that you would need a very strong reason (e.g., a product driver that is not available under Debian) to use Ubuntu over and above Debian for a project. Kind regards, Derek.
Hi.
Thanks for your step by step learning.
I running Debian on my beagle bone black and now want to programming this with the QT but where can i found the suitable ToolChain?
Best Regards.
Amir.
Hi Amir, Please see my instructions on the page: http://exploringbeaglebone.com/chapter11/ Kind regards, Derek.
Hi Sir,
We are using Chipsee’s 7″ lcd capacitive touch screen cape with Beagle Bone Black and AM3358 TI SDK(03.02.00.05) on ubuntu 12.04 64-Bit machine. I am the beginner, So how to integrate this cape with latest SDK , please tell me how to build and test this module.
Thanks,
Raghavendra
I’m having a lot problems cross compiling from my Host PC which is an AMD x86 computer (HOST) with Ubuntu 14.04 installed on it. I am trying to cross compile to my BeagleBone Black (TARGET) which has Debian-Jessie installed on it.
Dear Derek,
During cross compiling with Qt5.4 to my BBB, I was getting errors regarding the libQt5 files being the wrong format.The error message I receive is “cannot execute binary file, exec format error”.
Can you please help us how to cross compile correctly with Qt5.X from a host x86 PC (AMD) computer which has Ubuntu 14.04 installed to a BeagleBone Black- Debian Jessie?
I would really appreciate your help in this urgent matter.
Thanks
Tim
Hi Derek,
Thank you for your awesome tutorials.
I am having errors such as “gpio/export : No such file or directory and gpio/export : No such file or directory”. I installed QT Creator in Beaglebone black and compile native. Using your code, everything is fine, except accessing GPIO has some errors.Could you please give some advice? I could access GPIO in terminal using “sudo sh -c” command though.
Thank you.
kt
Hi Derek,
thank you very much for your tutorials! They are really simple to understand and very detailled.
I’ve been playing around with the PRUs and now Qt. For my application I want to combine both of them.
By my thinking I have to write and compile both codes for the GUI and the PRU Code separately and then call the PRU binary from the C++ Qt GUI code.
Is that the only way or do you think it’s possible to merge both parts? I see the problem in the C-Compiler from TI which I woud have to use instead of the gcc ….
I’d appreciate some hints
Thank you very much for the really awesome book.
Derek,
Awesome videos; they’ve been a great help in my embedded systems courses as a EET major.
Sorry if I’m duplicating a comment here, but do you intend to recreate this video for the BBB Rev C running Debian distribution?
I have an LCD cape and require a window GUI that can displays readings from gyroscopes in addition to controlling some servo motors. Would Qt still be a good fit for this kind of application? Any direction you could point me in would be appreciated.
Thanks again.
Hi,
All the steps you mentioned in the link http://exploringbeaglebone.com/chapter11/#prettyPhoto are running fine. But if i build a simple QTwidget using QTcreator the appication on beaglebone black just crashes. It just runs for a moment and then it crashes.
I’d like to be able to cross develop applications to run on the beaglebone using QT. I’ve watched you older videos (https://www.youtube.com/watch?v=kP7uvOu9hoQ) but the toolchain and distribution used in them is now out of date and/or unavailable. I’d like to use Debian, and I have followed your instructions to set up a cross toolchain on Debian Jessie with Eclipse, and this works very well. Would it be possible to use the same toolchain to build QT using the latest QT creator tool? How would I be able to build the QT environment to cross build on Jessie for the Beaglebone black target?
Hi Derek,
I have a project in mind which would require a large touch screen connected to BBB. I have been looking around for 23 inch + touch overlay option but can’t really figure out how to interface it with BBB. I can see a lot of tutorials to make BBB work with small 7 inch screen but my application is very different – Can you point me in right direction?
Thanks,
Atul Sharma
opkg update is not working. What can be done instead? Thank you.
HI Derek!
Could you help me to configure QT KIT for Beaglebone with Debian Wheezy?
may i use ubuntu 64x for dev apps for bbb?
Hi everyone!
I’m using Qt to develop an application on the BBB. I need to display Icons on Toolbuttons using QIcon. I do that through code by pointing to an image in the .build folder. It works well on PC but when I compile it on the BBB, the Icon is not displaying… My PC is running Ubuntu while the BBB runs Debian…. I’m a newbie with both Qt and BBB so I don’t know where the problem might come from.
Good day Mr Molloy,
Having installed Qt Creator, which came with a recent Qt version because either it detected Ubuntu, or I did choose poorly during the installation.
So, I got stuck on ‘where qmake could be found’, the proper one.
For my A5B version, I need Qt 4.8.1, which can be found through
http://exploringbeaglebone.com/chapter11/ , Building Qt from Source for the BeagleBone ,
which process lists a link to the proper Qt fileset. Which I am installing now.
Hello and good day
Its seems that SimpleGPIO does not work on the BBB using 3.8.13 bone70 on Qt.
When the Qt program starts the following error message is shown “failed to open OMAP_MUX: No such file or directory”
Having a look at the SimpleGPIO file the code try’s to read “SYSFS_OMAP_MUX_DIR” which does not exist on the BBB under /sys/kernel/debug/
Is there a fix or new vision of this code to work on the BBB under debian 3.8.13 bone70 build. Thank you
Great series of videos on QT Derek!. Thank you.
Hello and G’Day Mr Molloy,
Great videos and explanations. Such great companions to the book. (with much appreciated additional up-to-date info)
My BBBlack has a BB-VIEW7 attached and has had the display patches applied to get it to work (instructions different to manual)
The BBB kernel is 3.8.13 and under a debian wheezy 7.8 image. The qt4-dev-tools have been installed.
I have successfully set up QTCreator in an Oracle VBox running debian 8.5 (kernel 3.16.0-4-amd64), after successfully installing the armhf toolchains.
Selecting local g++ and compiling and running locally works fine for all Console and GUI-based examples under the VBox-installed debian image.
Running these GUI examples on the BBB varies in success however.
I have successfully compiled a GUI-based example (see Website Chap11 Step 7) and this deploys and runs perfectly on the BBbone. (this does not have the mainwindow.cpp file, just a main.cpp file).
When tried your example above (in video 8, with mainwindow.cpp), locally it runs fine, but after I compiling (using armhf g++) , and sftp and running the file, it flashes very quickly on the BB-VIEW screen and disappears. When locally run it remains displayed until ‘X’ is pressed.
Very odd that it works for a basic GUI example, but not the mainwindow.cpp version (or one that is auto-generated by QT Widget).
Is there some slot that is being auto-activated by the double-tap execution of the file on the BB-VIEW and hence causing it to close immediately? The BB-VIEW does ask to either Execute in Terminal or just Execute. Does the same even if the terminal session is closed. The code I have is exactly the same as your button press and count example (some names have been changed slightly).
[My QtCreator is 3.3.2, and the code for BBB is using a newly compiled version of qt4.8.2-armhf. – expect that it is fine as it works for console apps on BBB too, rootfs disk available on the BBB is 1.2GB]
Perhaps I need to copy ALL the qt4.8.2-armhf libraries that are being used to compile it on the VBox QT over to the BBB so all examples run? Is there any kind of enable or relink required for this on BBB?
A ‘not compatible’ was vaguely mentioned on CHP11 page 470 – not sure in what form these non-compatible artifacts normally are. It may be that one lib file is slightly different to the ones installed on the BBB via the qt4-dev-tools package. Will check it out…
Derek,
I have been searching for a PyQt howto for the beagle board black. How do I get PyQt to work with Python , on a beagle board black?
Thank you.
I need develop applications to run on the beaglebone black using QT. I’ve watched you older videos (https://www.youtube.com/watch?v=kP7uvOu9hoQ) but the toolchain and distribution used in them is now out of date and/or unavailable.
please help me, how i can make to get distribution and toolchain, for use with 7″cape
Hi Derek,
I know this is an old post but I was wondering if you have tried getting qt embedded working on a newer Debian image for the BeagleBone?
Specifically, I’m using an older IoT image of wheezy (Debian 7.11) from beagleboard.org. I’m willing to try another image but I would like to stay with an IoT setup and avoid using a distribution with a full desktop setup on it (and all the associated bloat…).
I have been able to compile qt 4.8.6 locally on the beagle bone black and can get a “hello world” test app to run with the -qws switch on a Chipsee BBB-EXP43 cape but I can’t figure out how to get the resistive touch screen to work. But, the local build isn’t optimal since i can’t do development on my host system. I also need to touch screen to work and I’m kind of stuck…
Any help would be appreciated.
Thanks,
Hartley
Hello Derek
Thank you very much for your tutorial on Beaglebone black
I have followed your lecture “Part 2: Setting up QT Creator for C++ ARM Embedded Linux Development”
And was able to successfully establish everything on Beaglebone and on my PC.
But when I try to run Qt application directly using run feature of Qt creator I get following error:
mesg: ttyname failed: Inappropriate ioctl for device
bash: /home/root/HelloWorld: No such file or directory
Application finished with exit code 127.
Please note I am able to successfully run Qt Application “HelloWorld” on BeagleBone (with debian OS) giving following command
./HelloWorld -platform linuxfb
But when i try to run it directly from Qt creator I get above mentioned error. Can you please tell me reason for it?
Thanks and regards
Saurabh Jain
Hi Darek,
Don’t know whether you are still following the comments of this page. Your tutorials are simply resourceful and easy to follow. Thank you for making things so easy for the novices like me.
I am new to QT & Beaglebone.
I was wondering whether all the links used, are still available??
Also, does these codes works with qt 5?
Thanks
ASG
Hey Derek,
Thanks for putting together these QT videos and instructions. Although they are a bit dated, they did prove to be helpful with setting up QT on a Beaglebone Blue with QT 5.7.1 and Debian version 9.5 and a Adafruit 2.4 TFT LCD ILI9341. I do not have touch configured yet, but the image does show on the LCD.
I did run into one issue for usleep while compiling the code from your github repository. I ended up having to add unistd.h to EasyDriver.cpp to get beyond this.
This is the issue I see after running qmake then make.
EasyDriver.cpp: In member function ‘void EasyDriver::step(int)’:
EasyDriver.cpp:105:21: error: ‘usleep’ was not declared in this scope
usleep(sleepDelay);
^
EasyDriver.cpp:114:21: error: ‘usleep’ was not declared in this scope
usleep(sleepDelay);
^
Makefile:396: recipe for target
Cheers,
Jon
Crossbuild for QT: I’m having a problem installing a crossbuild system for Qt on my PC that probably affects most newcomers to Beaglebone/Linux in 2019. The explanation in Exploring Beaglebone references various links that are obsolete. Trying to follow “Building Qt Libraries from Source” in the book doesn’t work (even though the cross compiler tools are installed and working ) since – I suppose – the paths for various things don’t match the book’s tacit assumptions. I don’t think using Angstrom (as described in the video) is an option for the Beaglebone Black wireless since that would require figuring out the new hardware drivers. The 2nd edition of the book doesn’t even discuss crossbuild for Qt as far as I can tell, and trying to build even simple stuff on the Beaglebone itself crashes due to lack of memory. Is there a detailed up-to-date description of the steps required, or even a list of tools tthat I need to learn in order to install the crossbuild tools in VirtualBox Debain on a PC? Or is this process too complicated for a relatively new Linux user to even attempt?
Thanks for any comments.
Hi Derek,
I want to cross compile qt for beagle-bone black running Debian on and host computer with Ubuntu 16.04.but i am wondering how to start.I search for lot of documents but all giving contents for Angstrom.Please guide me
Thanks,
Twinkal
Hi Derek,
Having one query what I want to control my QT GUI from some signals from BBB. What method need to be used.
There are certain images display on QT gui, that need to be change as per signal from BBB.
Thanks,
Geek13