EGalax touchscreen and Qt5



  • Hello,

    I'm using an eGalax touchscreen, trying to get it to work with Raspberry Pi and Qt5. I've got it working with X11, but that doesn't help with eglfs; it sounds like it needs to work with tslib.

    I've been able to get tslib to work with this display using a tarball and two patches from:
    http://repository.timesys.com/buildsources/t/tslib/tslib-1.0/

    I downloaded the tarball, applied the tslib-1.0-svn_updates-r50-r78.patch and tslib-1.0-egalax.patch patches, and built it.

    (loosely following directions from http://handychen.blogspot.com/2011/03/try-egalaxy-usb-touch-for-tslib.html).

    After screwing with some shared library paths and setting TSLIB_TSDEVICE=/dev/input/event1, I've been able to get the screen working with ts_calibrate and ts_test, but still not with Qt. Here's the output:

    @$ qmlscene dragselection.qml
    evdevtouch: Using device /dev/input/event1
    min X: 0 max X: 0
    min Y: 0 max Y: 0
    min pressure: 0 max pressure: 0
    device name: eGalax Inc. Touch
    Protocol type A@

    Based on "this thread":http://qt-project.org/forums/viewthread/21126, I think I need to use the evdevmouse or tslib plugins rather than evdevtouch. However, I've tried this:

    @$ qmlscene dragselection.qml -plugin Tslib:/dev/input/event1@

    and

    @$ qmlscene dragselection.qml -plugin EvdevMouse@

    and the output is no different; it still appears to be using evdevtouch. Is there any way I can disable the evdevtouch plugin so my tslib or evdevmouse arguments might work?



  • Hi,
    Have you tried just removing libqevdevtouchplugin.so from /your-QT5-install-path/plugins/generic ?



  • Looks like the issue was that the Qt tslib plugin wasn't compiled. plugins/generic/libqtslibplugin.so was missing.

    I fixed this by cross-compiling the plugin on the host against the tslib that I compiled on the pi, and copying the resulting plugins/generic/libqtslibplugin.so back to the pi.

    The source for the plugin is in qtbase/src/plugins/generic/tslib.



  • I have exactly the same problem. I have finally got tslib compiled according to your explanation, but could you please provide more information about how you have compiled the libqtslibplugin? Or maybe even provide the final result in binary format?

    And how do you have solved the shared libraries problem?

    Greetings,
    Florian



  • [quote author="koalo" date="1374181845"]I have exactly the same problem. I have finally got tslib compiled according to your explanation, but could you please provide more information about how you have compiled the libqtslibplugin? Or maybe even provide the final result in binary format?

    And how do you have solved the shared libraries problem?

    Greetings,
    Florian
    [/quote]

    Hi koalo,

    You can compile it by just giving make inside plugins/generic/tslib folder.
    After that libqtslibplugin.so gets generated inside plugins/generic folder



  • if i compile the tslib then egalax 7 inch touch screen working in qt5 apps.

    i will try to compile tslib in qtbase/src/plugins/generic/tslib. directory i got the error tslib.h file not found



  • Hi Tannyveer,

    Have you modified qmake.conf by adding tslib related stuffs:

    @
    QMAKE_INCDIR += /usr/local/tslib/src
    QMAKE_LIBDIR += /usr/local/tslib/libs
    @



  • Hi sid,
    When i a modified the qmake.conf file what u post i got the follwoing error

    /home/tal/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.7.2/../../../../arm-linux-gnueabihf/include/c++/4.7.2/arm-linux-gnueabihf/bits/os_defines.h:40:22: fatal error: features.h: No such file or directory
    compilation terminated.
    make: *** [.obj/qtslib.o] Error 1



  • Hi Tannyveer,

    Lets start from the beginning, First we need to build TSLIB. i will tell you whatever i did. Let me know wheter you are done with these steps or not.

    For TSLIB:
    @
    export ac_cv_func_malloc_0_nonnull=yes
    export CC=powerpc-wrs-linux-gnu-ppc_603e-glibc_std-gcc
    export CXX=powerpc-wrs-linux-gnu-ppc_603e-glibc_std-g++
    @

    If you get a problem about an undefined reference to rpl_malloc, you
    probably need to do:
    @$ export ac_cv_func_malloc_0_nonnull=yes@
    CC and CXX is your compiler. (In my case it is cross compilation so i gave the power pc tool chain compiler)

    After that:

    @
    ./autogen.sh
    ./configure --host=powerpc-603e-linux --target=powerpc --prefix=/usr/local
    make
    make install
    @
    You need to modify --host and --target as per your system. --prefix is the path where the final library will be generated.

    If all OK, you will get following summary:

    @
    ./configure --host=powerpc-603e-linux --target=powerpc --prefix=/usr/local
    configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for powerpc-603e-linux-strip... no
    checking for strip... strip
    checking for a thread-safe mkdir -p... /bin/mkdir -p
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking whether the C++ compiler works... yes
    checking for C++ compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... yes
    checking for suffix of object files... o
    checking whether we are using the GNU C++ compiler... yes
    checking whether powerpc-wrs-linux-gnu-ppc_603e-glibc_std-g++ accepts -g... yes
    checking for style of include used by make... GNU
    checking dependency style of powerpc-wrs-linux-gnu-ppc_603e-glibc_std-g++... gcc3
    checking for powerpc-603e-linux-gcc... powerpc-wrs-linux-gnu-ppc_603e-glibc_std-gcc
    checking whether we are using the GNU C compiler... yes
    checking whether powerpc-wrs-linux-gnu-ppc_603e-glibc_std-gcc accepts -g... yes
    checking for powerpc-wrs-linux-gnu-ppc_603e-glibc_std-gcc option to accept ISO C89... none needed
    checking dependency style of powerpc-wrs-linux-gnu-ppc_603e-glibc_std-gcc... gcc3
    checking how to run the C preprocessor... powerpc-wrs-linux-gnu-ppc_603e-glibc_std-gcc -E
    checking whether the C compiler supports -fvisibility=hidden... yes
    checking whether to use -fvisibility=hidden... yes
    checking whether ln -s works... yes
    checking whether make sets $(MAKE)... (cached) yes
    checking build system type... i686-pc-linux-gnu
    checking host system type... powerpc-603e-linux-gnu
    checking for a sed that does not truncate output... /bin/sed
    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for fgrep... /bin/grep -F
    checking for ld used by powerpc-wrs-linux-gnu-ppc_603e-glibc_std-gcc... /opt/WindRiver40/wrlinux-4/layers/wrll-toolchain-4.4a-323/powerpc/toolchain/x86-linux2/powerpc-wrs-linux-gnu/bin/ld
    checking if the linker (/opt/WindRiver40/wrlinux-4/layers/wrll-toolchain-4.4a-323/powerpc/toolchain/x86-linux2/powerpc-wrs-linux-gnu/bin/ld) is GNU ld... yes
    #Removed lots of stuffs here due to 6000 characters limit
    checking for vprintf... yes
    checking for _doprnt... no
    checking for bzero... yes
    checking for gettimeofday... yes
    checking for memmove... yes
    checking for memset... yes
    checking for munmap... yes
    checking for select... yes
    checking for strcasecmp... yes
    checking for strchr... yes
    checking for strdup... yes
    checking for strtoul... yes
    checking whether linear modules is requested... yes
    checking whether dejitter module is requested... yes
    checking whether linear-h2200 module is requested... yes
    checking whether variance module is requested... yes
    checking whether pthres module is requested... yes
    checking whether ucb1x00 module is requested... yes
    checking whether corgi module is requested... yes
    checking whether collie module is requested... yes
    checking whether h3600 module is requested... yes
    checking whether mk712 module is requested... yes
    checking whether arctic2 module is requested... yes
    checking whether input module is requested... yes
    checking where to place modules... ${libdir}/ts/
    checking whether to enable debugging... no
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating etc/Makefile
    config.status: creating plugins/Makefile
    config.status: creating src/Makefile
    config.status: creating tests/Makefile
    config.status: creating tslib-0.0.pc
    config.status: creating config.h
    config.status: executing depfiles commands
    config.status: executing libtool commands
    root@ebx-all:/usr/local/QT_littlee/qt-everywhere-opensource-src-5.2.1/qtbase/bin/tslib-1.0 #
    @

    Let me know if you are done with this. Then we will proceed with the intagration of TSLIB with the QT5



  • Hi Sid
    Thanks for ur above post i succesfully compile the tslib plugin.
    but my problem cannot be solved :
    Still touchscreen cannot be respond my Qt application.

    I am using Raspberry Pi board:
    Qt5 Installed:
    Raspbian Os
    egalax touch screen also installed
    tslib i.e libqtslibplugin.so in my qtinstalled path
    I also removed libqevtouchplugin.so in the generic path



  • Hi Tannyveer,
    Are you able to run some TSLIB tools like:

    1. ts_test
    2. ts_calibration

    If above tools work fine then you can say that TSLIB is successfully installed.

    Then we will look into the integration of TSLIB with QT5



  • hi sid

    i compiled tslib on my host system then copy the liqtslibplugin.so in my target raspberri pi system i.e in Qt_installed/plugins/generic folder.

    ts_test
    ts-calibration commands
    was not found in my taget system.



  • Hello Tannyveer,

    TSLIB is a separate from QT, you need to download the source code and then compile it. Download it from here:
    http://sourceforge.net/projects/tslib.berlios/



  • hi sid
    whether tslib compile in my target system ie my rsapberry pi or compile in my host system i am confused if it is in host system im already compiled.



  • Hi Tannyveer,
    If you have already compiled tslib library for RPI then there must be some tools generated along with the compilation. Check "tests" folder. If those tools like ts_test, ts_calibrate works fine then that means your tslib is working fine.

    If you compiled TSLIB in host system then transfer the required tools to RPI and then try running them.

    Thanks



  • when i run
    ./ts_test and ./ts_calibration i got the following error
    libts-1.0.so.0: cannot open shared object file: No such file or directory
    in my RPI



  • Ok then copy these libraries into your RPI and then add the path to environment variable LD_LIBRARY_PATH.

    If you generated the tslib in your host pc, then they get generated inside /usr/local.

    Copy these .so files to your RPI and add the path to LD_LIBRARY_PATH.

    let me know what happens next.



  • i add the path and i got the illegal operation error when i run ./ts_test



  • Have you set the following environment variables:

    @
    export TSLIB_FBDEVICE=/dev/fb0
    export TSLIB_TSDEVICE=/dev/ttyS1
    export TSLIB_PLUGINDIR=/home/Sid/tslib_plugins
    export TSLIB_CONFFILE=/home/Sid/ts.conf
    @

    also try running ts_calibrate. Do you get same error?

    Also some more tools are present like ts_print, ts_print_raw.

    Try running them as well..



  • hi sid
    so sadly i got the same error when i test the ts-test ts_calibrate ts_print ts_print-raw tools



  • Dear Tannyveer,

    I think may be its is related to some permission issue. I am not sure.
    Try changing the permission of all the related files.

    Also check with ldd command whether all the libraries needed are found by the required binaries or not.
    i have not come across any such error :(



  • Dear Sid
    sorry for the late post i am out of station from three days, right now iam in my workbench still i got the same errors i want to compile the tslib once again
    now my question is iam compiling tslib on my host system contains ubuntu 14.04 32-bit version. Is any problem encounter with this desktop version.
    another queston after install tslib in my host system i transfered the install files using gftp.this may be any troubled for my tslib.

    please answers these questions so that i vl try again to compile the tslib. give me the procedure from first steps to compile the tslib



  • So you are cross compiling. I mean to say you are compiling the source code in Ubuntu and then deploying the binaries in the RPI?

    If this is the case then you are doing cross compilation. Is it true?



  • yep sid



  • Dear Sid,
    Is there any method along with this. please post me Sid



  • Do following steps:

    @
    export ac_cv_func_malloc_0_nonnull=yes
    export CC=powerpc-wrs-linux-gnu-ppc_603e-glibc_std-gcc
    export CXX=powerpc-wrs-linux-gnu-ppc_603e-glibc_std-g++
    ./autogen.sh
    ./configure --host=powerpc-603e-linux --target=powerpc --prefix=/usr/local
    make
    make install
    @

    Make necessary changes in line number 2,3,5 as per your RPI tool chain. If you get a problem about an undefined reference to rpl_malloc, then only you need to do line number 1.



  • dear sid
    i installed the tslib on my rpi when i run ts_test and ts_calibrate
    i got the following

    couldnot load loaded pthres
    No raw modules
    ts_config :Sucess



  • Copy the pthres.so from your host pc to target pc(RPI)
    In host pc it is located at : tslib-1.0/plugins/.libs



  • Hai sid,
    I got the same errors even though i coped the pthe.so file on my rpi lib . i loss my patinece and i stoped my work. i think egalax cannot be work for rpi with qt5 application.
    Thank you very much for your support.



  • Dear Tannyveer,

    Do not loose hope.

    Have you tried setting TSLIB related environment variables?? If not set these:

    @
    export TSLIB_FBDEVICE=/dev/fb0
    export TSLIB_TSDEVICE=/dev/ttyS1
    export TSLIB_PLUGINDIR=/home/Sid/tslib_plugins
    export TSLIB_CONFFILE=/home/Sid/ts.conf
    @

    Modify the plugin dir path as per your system.



  • Hi Sid,
    I set these environment in /root/.bashrc.
    but still i got the same problem.



  • Do one thing to check whether these environment variables are getting set properly or not. check with echo command:

    @echo $TSLIB_PLUGINDIR@

    If this gives correct value then its fine, or try setting the same in .profile file.



  • @Sidii
    Hi sidii, i meet a similar problem.
    when my application startup, i click with finger on the main window , there are event response, popup another widget and a whiter cursor on the left top position.
    then i try to click(with finger) the widget there is no response. if i move the white cursor to the widget, then click everything is ok.
    it seems that click on the widget invoke the event on main window. as there is still another black cursor underground. what may be the problem? thank you!
    ENV: QT5.7.1 +raspberry pi3 , cross compiled ,host : ubuntu 16.04
    Tslib installed on rpi3 directory and sync it to the host.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.