Qt

Setting Up Qt with LCD Touch on Beaglebone – PART I

A year ago, I completed an interesting project, that involved the development of a  data acquisition system with a rich GUI, and some amazing features for testing industrial machines. I developed this application on embedded Linux with Qt, that is when I fell in love with Qt because of its cross-platform capabilities with excellent graphic libraries, to create attractive and powerful GUI applications. It is also easy to use framework that uses C++ library classes with loads of API’s, for easy and fast developments. Qt has gained a lot of popularity in the past few years and is being used by many small, medium and large companies for developing embedded GUI applications.

I have broken down this series into five parts so that we can take it slow step by step, you can think this part as your first date with a pretty girl i.e. your BBB hehe!. If you do well on your first date, then you will have the next one and so on until the fifth part.

In this PART-I, let’s install the basic stuff’s on our new image that will enable us to set up the toolchains for Qt and Beaglebone Black (BBB), along with the supporting libraries for Qt and touch screen.

Configure the new Debian Jessie image before setting up Qt

First, let’s check the Debian version by running the below command.

 

You should get an output like below. Make sure you are using Debian Jessie OS.

As you can see, I am currently using Debian Jessie 8.5. Install sudo tool onto to Linux distribution by running the below commands.

 

Open visudo file and add your username to it as shown below.

 

Then press ‘Ctrl+X’ to exit from the file. And run the below ‘exit’ command to logout from the root mode.

In the next part i.e. PART-II. I will show you how to set up the crossbuild tools for your BBB. So, stay with DeeplyEmbedded.

24 thoughts on “Setting Up Qt with LCD Touch on Beaglebone – PART I”

  1. There’s a typo in the last section: ‘Install IDE – QT Creater’ — should be Creator*.
    Nicely explained, by the way. 🙂

    1. Hey,
      I have planned it for PART-II, in which I will show how to setup the kit, build and deploy Qt applications onto your Beaglebone. I shall post it on this weekend, till then stay in sync with Deeply Embedded 🙂

  2. Thank you
    I have a project in my school and i want to development an application on BBB, but I am having some inconvenient to setup the BBB and the workstation. I have the latest Debian version 8.7 Jessie, maybe have you tested in it?
    I don’t have experience about it.

    1. Hi,
      Even I am running Debian GNU/Linux 8.7 (jessie) on Laptop.And yes, I have cross compiled Qt app and tested it by deploying onto the BBB. Before moving to the BBB, I would like to know, if you were able to set up the Qt toolchain and libs as described in my post?, if not, what problems are you facing while doing so?

  3. i tried other tutorial, but i had problems too
    I will try again, and i am going to document it for you help me.
    regards

  4. after to run this command
    vinaydivakar@debian:~/qt_src/qt-everywhere-opensource-src-4.8.2$sudo ./configure -v -opensource -confirm-license -xplatform linux-arm-gnueabihf-g++ -embedded arm -little-endian -host-little-endian -prefix /usr/local/qt4.8.2-armhf -nomake demos -nomake examples -no-qt3support -qt-gfx-linuxfb -qt-gfx-qvfb -qt-gfx-vnc -no-accessibility -qt-mouse-linuxinput -qt-mouse-tslib -reduce-relocations -no-nas-sound -no-sm -no-nis -qt-libjpeg -qt-libpng -qt-zlib -no-sql-ibase -no-sql-mysql -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 -no-pch -no-dbus -no-glib -no-phonon -no-phonon-backend -webkit -no-multimedia -no-audio-backend -no-qt3support -nomake docs -nomake translations -exceptions -no-fast -depths 16,24,32 -no-mmx -no-3dnow -no-sse -no-sse2 -no-cups -no-largefile -no-openssl -no-gtkstyle -qt-mouse-pc -plugin-mouse-tslib -plugin-mouse-linuxtp -plugin-mouse-pc -qt-gfx-transformed -plugin-gfx-transformed -release -debug

    I had this error

    arm-linux-gnueabi-g++ -c -pipe -O2 -Wall -W -I../../../mkspecs/linux-arm-gnueabihf-g++ -I. -o tslib.o tslib.cpp
    make: arm-linux-gnueabi-g++: Command not found
    Makefile:178: recipe for target ‘tslib.o’ failed
    make: *** [tslib.o] Error 127
    tslib disabled.
    The tslib functionality test failed!
    You might need to modify the include and library search paths by editing
    QMAKE_INCDIR and QMAKE_LIBDIR in

    1. Can you go the below directory path, in this directory you will find a qmake.conf file.

      vinaydivakar@debian:~/qt_src/qt-everywhere-opensource-src-4.8.2/mkspecs$ cd linux-arm-gnueabihf-g++/

      Could you please paste the contents of the qmake.conf file from the linux-arm-gnueabihf-g++ directory, so that I can take a look at it.

  5. is that

    # qmake configuration for building with arm-linux-gnueabi-g++
    #

    MAKEFILE_GENERATOR = UNIX
    TARGET_PLATFORM = unix
    TEMPLATE = app
    CONFIG += qt warn_on release incremental link_prl gdb_dwarf_index
    QT += core gui
    QMAKE_INCREMENTAL_STYLE = sublib

    include(../common/linux.conf)
    include(../common/gcc-base-unix.conf)
    include(../common/g++-unix.conf)

    # modifications to g++.conf
    QMAKE_CC = arm-linux-gnueabihf-gcc
    QMAKE_CXX = arm-linux-gnueabihf-g++
    QMAKE_LINK = arm-linux-gnueabihf-g++
    QMAKE_LINK_SHLIB = arm-linux-gnueabihf-g++

    # modifications to linux.conf
    QMAKE_AR = arm-linux-gnueabihf-ar cqs
    QMAKE_OBJCOPY = arm-linux-gnueabihf-objcopy
    QMAKE_STRIP = arm-linux-gnueabihf-strip

    # tslib
    QMAKE_INCDIR += /opt/tslib/include
    QMAKE_LIBDIR += /opt/tslib/lib
    QMAKE_LFLAGS += -Wl,-rpath-link=/opt/tslib/lib

    load(qt_config)

    1. There seems to be no problem in the qmake file. Between, I followed the steps in my post and was able to again successfully setup the toolchain on my other system. Your getting the errors as you have not exported the cross compiler path and you may have missed out on something prior to configuration. I advise you to cross check if you have followed all the steps carefully as described in the post.

  6. Hello! I followed your tutorial step by step and apparently everything is fine until it comes to test the touchscreen. When I try to execute the “ts_calibrate” command, I get the error:
    tslib: Selected device is not a touchscreen (must support ABS and KEY event types)
    ts_read: No such file or directory
    Do you have any idea how to fix this error? The LCD I am using is this one: https://www.seeedstudio.com/7-Inch-BeagleBone-Green-LCD-Cape-with-Resistive-Touch-p-2643.html
    I have had trouble with its configuration, so I would appreciate any help. Thanks a lot!

    1. There are a few commands which you execute at some point before running ts_calibrate. They are as follows:

      root@beaglebone:~# export TSLIB_TSDEVICE=/dev/input/event1
      root@beaglebone:~# export TSLIB_CONFFILE=/etc/ts.conf
      root@beaglebone:~# export TSLIB_CALIBFILE=/etc/pointercal
      root@beaglebone:~# export TSLIB_PLUGINDIR=/usr/lib/ts/
      root@beaglebone:~# export QWS_MOUSE_PROTO=LinuxInput:/dev/input/event1

      Try running these sequence of commands for different event values such as event0, event1, event2 or event3. One of them should work and then you should be
      able to calibrate your touch screen display. Hope this helps.

      1. Thanks for your reply, Vinay. It was very helpful. In case someone is having a hard time with this LCD touchscreen model: https://www.seeedstudio.com/7-Inch-BeagleBone-Green-LCD-Cape-with-Resistive-Touch-p-2643.html, the correct values to enable the display functionality are as follows.

        root@beaglebone:~# export TSLIB_TSDEVICE=/dev/input/by-path/platform-TI-am335x-tsc-event
        root@beaglebone:~# export TSLIB_CONFFILE=/etc/ts.conf
        root@beaglebone:~# export TSLIB_CALIBFILE=/etc/pointercal
        root@beaglebone:~# export TSLIB_PLUGINDIR=/usr/lib/ts/
        root@beaglebone:~# export QWS_MOUSE_PROTO=LinuxInput:/dev/input/by-path/platform-TI-am335x-tsc-event

        The tutorial is great, by the way. Well done!

  7. I have a problem building the tslib. It indicates that there is no compatible malloc when running $ ./configure and then it fails $ make. I have tried tried $ sudo apt-get install libjemalloc1:armhf but this relies on libc6 and when I try to install libc6:armhf it wants to remove almost all my libraries.

    I am using Ubuntu 16.04 instead of Debian Jessie but I have installed the cross tools the same way as described. I have tried both the debian source cross tools as you describe and also the Ubuntu crosstools using “deb [arch=armhf] http://ports.ubuntu.com/ubuntu-ports xenial main universe”

    I have also tried exporting C_INCLUDE_PATH and LIBRARY_PATH to the relevant directories of the cross tools.

    I have no problem using malloc when developing using Eclipse IDE and using the same crosstools.

    Have you seen this problem and do you know a way around it?

  8. Hi Vinay
    I am a newbie with BBB. In the beginning, it is asked to install the emdebian toolchain archive key using ‘curl’.
    I am stuck at that point . This what I am getting as an output. Please help.
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    0 0 0 0 0 0 0 0 –:–:– 0:02:06 –:–:– 0curl: (7) Failed to connect to emdebian.org port 80: Connection timed out
    gpg: no valid OpenPGP data found.

        1. If your running Windows 10 on your host machine, then I presume you are running Linux using Virtual Box?

Leave a Reply

Your email address will not be published. Required fields are marked *