A13 + LCD7-TS + Debian + Xorg difficulties

Started by spctr, November 29, 2012, 09:28:31 PM

Previous topic - Next topic

ozko

#30
Hello everybody!
Im trying to run the lcd7ts on debian R17
with the wordpress guide http://olimex.wordpress.com/2012/12/19/a13-lcd7ts-support-in-linux/
Im also pretty new to linux overall and at step 3 $ patch -p1 < ../tslib.patch I get
patch: **** Only garbage was found in the patch input.
Are the patches outdated or I need another debian image?
Please help and thanks in advance!

edit: and I dont know if its because it didnt patch, but I tried autoreconf -vi
the response was autoreconf: command not found

vaishali

hi ozko, 

same problem with me too,
but the difference is only that i have R15 in my 16gb sd card.
if there is any progress in lcd ts connection, then please let me know...
dinks

vaishali

hello ,

i am using official 2gb debian with xfce4 in sd card to enable touch screen.
but whenever i tried to download patches from github it requires certificate. so using below command i installed patches in /usr/src

#wget --no-check-certificate https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A13/TOUCHSCREEN/1-xf86tslib-sigfault.patch

#wget --no-check-certificate https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A13/TOUCHSCREEN/tslib.patch

#wget --no-check-certificate https://github.com/OLIMEX/OLINUXINO/tree/master/SOFTWARE/A13/TOUCHSCREEN/xf86-input-tslib-port-ABI-12-r48.patch

#env GIT_SSL_NO_VERIFY=true git clone https://github.com/kergoth/tslib

#cd tslib

#patch -p1 < ../tslib.patch

at this time i am getting the below error

patch: **** Only garbage was found in the patch input.

please help me with this.

dinks

vaishali

hello olimex,

I am using the official debian with x in 16gb sd card.
I have followed the steps from wordpress to start my 7" lcd ts.
I am able to do ts_calibrate and ts_test.
But not able to enable touch in my xfce4.
I have followed the instruction to ENABLE TOUCHSCREEN FOR X.
now how should i start my touch in x.
after rebooting and doing startxfce4 my keyboard and mouse stops working and i am not able to do touch in the lcd.
please help what should i do.
I have followed all the instructions directly on my a13 wifi board , i have not done cross compiling to load touch module.
please help.
dinks

vaishali

Hello all,


Finally after long struggle my touch screen has started working.
I am using official debian image with xfce4 (2gb image).
Currently my touch screen works in xfce4 only after i load sun4i-ts everytime before starting xfce4.
after rebooting if i do startx without running command modprobe sun4i-ts , my touch screen stops working.
And my mouse is also not working.
Can you tell me how can i enable my touch module automatically after reboot.
I want my mouse and touch screen both working in this image.
I have exported the variable of ts module in .bashrc file to make it start automatically after reboot but it didn't work.
I have also exported the the variable in /etc/environment file but it didn't start after reboot automatically.
In which file i should make changes to make my touch screen work automatically after reboot. 
dinks

JohnS


vaishali

hi john ,

thanx for your help but i have already tried to use this file but didn't succeeded.
The reason was i was putting the wrong name of ts module.
After putting correct name in /etc/module file it is working fine.
Now my touch screen works after reboot.
Thanx guys. Thank you for your help.
dinks

vaishali

Hello all,

here i have mentioned the detailed steps to start the touch screen with a13 wifi board with the help of dimitar and Skaag Argonius. thanks to both of you.

(1) First of all download the official debian image with xfce4 (2gb image) from the wiki or the following link.

https://docs.google.com/file/d/0B-bAEPML8fwlQjBOa1JUZlE2TGM/edit?usp=sharing

(2)Then extract this image from the downloaded rar file.

(3)You will get .img file.

(4)then copy this file to your microsd card using dd command.

(5)Now insert this card into your a13 wifi board and please do not connect keyboard , mouse or any other usb devices into the a13 wifi board.

(6)And also do not connect any serial devices to UART1 port at the time of connecting power supply.

(7)then using ssh port connect with your board from your computer. Use below command in the terminal of your computer to connect from your computer through ssh to your a13 wifi board.

ssh l root 192.168.1.xxx (whichever is your ip).

(8)so you will be asked for your password.
password is password for this image.
so now you are connected to your board and you will find the below text in your terminal.

root@debian:/#

(9) Now follow the below instructions to add ts module in your wifi board.

root@debian:/# apt-get update
this will take some time.

root@debian:/# apt-get install build-essential git automake autoconf libtool ntpdate pkg-config

for correct timing , cause you will need this later.

root@debian:/# ntpdate pool.ntp.org
to check the timing.

root@debian:/# cd /usr/src

root@debian:/usr/src# git clone https://github.com/kergoth/tslib

root@debian:/usr/src# cd tslib

root@debian:/usr/src/tslib# cd plugins/
 
root@debian:/usr/src/tslib/plugins/# ls

to list the files inside , so you can see there is a file called input-raw.c.


arctic2.la      dejitter.c    input-raw.c     Makefile.in   tatung-raw.lo
arctic2-raw.c      dejitter.la    input-raw.lo     mk712.la   touchkit.la
arctic2-raw.lo      dejitter.lo    linear.c     mk712-raw.c   touchkit-raw.c
collie.la      dmc.la    linear-h2200.c   mk712-raw.lo   touchkit-raw.lo
collie-raw.c      dmc-raw.c    linear_h2200.la  plugins.h   ucb1x00.la
collie-raw.lo      dmc-raw.lo    linear-h2200.lo  pthres.c   ucb1x00-raw.c
corgi.la      h3600.la    linear.la     pthres.la   ucb1x00-raw.lo
corgi-raw.c      h3600-raw.c    linear.lo     pthres.lo   variance.c
corgi-raw.lo      h3600-raw.lo  Makefile     tatung.la   variance.la
cy8mrln-palmpre.c  input.la    Makefile.am     tatung-raw.c   variance.lo

root@debian:/usr/src/tslib/plugins/# rm -f input-raw.c

this file is old so removed from above command.

root@debian:/usr/src/tslib/plugins# ls
check that this file is removed properly.

root@debian:/usr/src/tslib/plugins# wget https://dl.dropbox.com/u/40057/patches/input-raw.c
download the already patched file from above link.

root@debian:/usr/src/tslib/plugins# ls

to check that the new file named input-raw.c has been downloaded.
this will save you from patching module files and the related problems.

root@debian:/usr/src/tslib/plugins# cd ..

root@debian:/usr/src/tslib# autoreconf -vi
to compile the ts module.

root@debian:/usr/src/tslib# ./configure --prefix=/usr/local

root@debian:/usr/src/tslib# make

root@debian:/usr/src/tslib# make install

root@debian:/usr/src/tslib# ldconfig

root@debian:/usr/src/tslib# modprobe sun4i-ts
to load the ts module.

root@debian:/usr/src/tslib# dmesg | grep sun4i-ts
this will give you the name of your input touch screen device by following text.

[   13.210000] sun4i-ts.c: sun4i_ts_init: start ...
[   13.220000] sun4i-ts: tp_screen_size is 5 inch.
[   13.230000] sun4i-ts: tp_regidity_level is 5.
[   13.230000] sun4i-ts: tp_press_threshold_enable is 0.
[   13.240000] sun4i-ts: rtp_sensitive_level is 15.
[   13.250000] sun4i-ts: rtp_exchange_x_y_flag is 0.
[   13.260000] sun4i-ts.c: sun4i_ts_probe: start...
[   13.280000] input: sun4i-ts as /devices/platform/sun4i-ts/input/input1
[   13.300000] sun4i-ts.c: sun4i_ts_probe: end


from the above you can see the name of your touch screen input is input1. It may be input2 or 3 or 4 for you.

(9) now go the following directory to export required variable.

root@debian:/etc# nano environment

to open the environment file and to copy and past the below text into this file.

export TSLIB_TSEVENTTYPE=raw
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_TSDEVICE=/dev/input/event1
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/etc/ts.conf
export TSLIB_PLUGINDIR=/usr/local/lib/ts


change event number according to your input number like if you have input1 then it should be event1 and so on.

then press control+x so it will tell you to save so press y and enter key.

root@debian:/etc# ts_calibrate

from this command you can calibrate your screen.
so start calibrating it by touching your touch screen.

root@debian:/etc# ts_test
by this command you can test your touch screen by drawing and dragging on your touch screen.

now go to the following directory to load xf86-xorg-tslib module for your x .

root@debian:/usr/src# apt-get install xorg-dev xserver-xorg-dev x11proto-core-dev
it will take some time.

root@debian:/usr/src# wget http://ftp.de.debian.org/debian/pool/main/x/xf86-input-tslib/xf86-input-tslib_0.0.6.orig.tar.gz

root@debian:/usr/src# tar zxfv xf86-input-tslib_0.0.6.orig.tar.gz

root@debian:/usr/src# cd xf86-input-tslib-0.0.6/

root@debian:/usr/src/xf86-input-tslib-0.0.6# cd src/

root@debian:/usr/src/xf86-input-tslib-0.0.6/src# ls

to check the files inside the folder.

root@debian:/usr/src/xf86-input-tslib-0.0.6/src# rm -f tslib.c
remove this old file.

root@debian:/usr/src/xf86-input-tslib-0.0.6/src# wget https://dl.dropbox.com/u/40057/patches/tslib.c
to load new file.

root@debian:/usr/src/xf86-input-tslib-0.0.6/src# cd ..

root@debian:/usr/src/xf86-input-tslib-0.0.6# ./configure --prefix=/usr

root@debian:/usr/src/xf86-input-tslib-0.0.6# make

root@debian:/usr/src/xf86-input-tslib-0.0.6# make install

now go to the followinf directory to add the below text.

root@debian:/usr/share/X11/xorg.conf.d# nano 20-touchscreen.conf

this is a new file you can change the name if you want.
and copy the below text.

Section "InputClass"
        Identifier "Sun4iTouchscreen"
        MatchDevicePath "/dev/input/event1"
        Driver "tslib"
        Option "Device" "/dev/input/event1"
        Option "ScreenNumber" "0"
        Option "Rotate" "NONE"
        Option "Width" "800"
        Option "Height" "480"
        Option "SendCoreEvents" "yes"
        Option "Type" "touchscreen"
EndSection


save this file as said above.


root@debian:/usr/share/X11/xorg.conf.d# startx

to check that your touch screen is working with x.

now follow the below instructions to load your ts module even after reboot else you will have to load it every time by modprobe sun4i-ts commnad before starting x.

go to following directory.

root@debian:/etc# nano modules

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.
fbcon
sun4i_ts



add sun4i_ts into above file cause it is not there before adding.
save this file and reboot without connecting anything to usb port of your a13wifi board.

now connect your keyboard and mouse and whatever you want cause now your touch screen is also working even after reboot.

dinks

manchot50

hello vaishali, very great and perfect help !  work fine on my 3.4.43+ kernel on olinuxino 13 wifi.

No, i search the config for the gpm.conf for console mode ts.

with TS and iPazzPort fly mouse, i can have a good control to my arm computer.


webconn

#39
Hello all,

I had some problems with getting the touchscreen to work, because, I think, libraries had been updated. So, I solved this problem by updating patches (just created a pull request on Github, hope that changes will be approved) and using "InputClass" in xorg.conf instead of "InputDevice". Also, I wrote a step-by-step manual, how to configure your Debian to work with touchscreen, and you can read it here: http://www.dimrobotics.com/2013/06/olinuxino-a13-touchscreen-support-in.html.

Good luck! I hope that this information should be useful for someone.

UPD: If you change some conditions in InputClass section (I used "MatchProduct "sun4i-ts"" instead of "MatchDevicePath "/dev/input/event1""), you will get your touchscreen works well with mice, keyboards etc. in every boot conditions (not matter when you plugged other devices in)

yo9hnf

THANK YOU vaishali for your tutorial !!!
It's working very nice on A13MICRO.

I had to install libtool, autoconf, build-essential and ntp for everything to run well.

Thank you!

yo9hnf

I have a small problem....my X doesn't start after boot.
How can i enable automatically to startx ?
i tried to edit inittab but i had no luck.

David Goadby

If you don't want a display manager then the usual way on Debian is described here: http://www.debianadmin.com/how-to-auto-login-and-startx-without-a-display-manager-in-debian.html

If you want an auto-login then this method works for me: http://www.backtrack-linux.org/forums/showthread.php?t=836

Have fun with it!

David

herveld

Hello,

Using linaro and following webconn method, I was able to use touchscreen in landscape mode.

However if I try to rotate screen in portrait mode, using Option "Rotate" "CW" in xorg.conf and 20-touchscreen.conf, Xorg crashes everytime the screen is touched.

Any idea how to make the touchscreen work in portrait mode ?

Regards,
herveld