Linux - fix tslib integration

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
ultraman Offline
Member
Posts: 80
Joined: Mar 2012
Reputation: 2
Post: #61
(2015-08-20 18:30)thebestofall007 Wrote:  Is there anything missing? What is the purpose for the "ts_env.sh" file, as my setup doesn't have it.
In this file are TSLIB_* exports: http://pastebin.com/HrwCXrPS
Which means without this ts_uinput_touch daemon will not even start. From your service file in osmc you can just call one .sh file where you have those exports and at the end call ts_uinput_touch.
find quote
thebestofall007 Offline
Junior Member
Posts: 47
Joined: May 2012
Reputation: 0
Post: #62
(2015-08-20 18:45)ultraman Wrote:  
(2015-08-20 18:30)thebestofall007 Wrote:  Is there anything missing? What is the purpose for the "ts_env.sh" file, as my setup doesn't have it.
In this file are TSLIB_* exports: http://pastebin.com/HrwCXrPS
Which means without this ts_uinput_touch daemon will not even start. From your service file in osmc you can just call one .sh file where you have those exports and at the end call ts_uinput_touch.

Ok, here is my newly edited ts_uinput_touch.service located in /lib/systemd/system/:

Code:
[Unit]
Description=Touchscreen support daemon
Before=mediacenter.service
After=graphical.target

[Service]
Type=oneshot
Environment=/usr/local/lib
ExecStartPre=-/bin/sh -c "exec /bin/sh /usr/local/bin/ts_calibrate"
ExecStart=-/bin/sh -c "/usr/local/bin/ts_env.sh; exec ts_uinput_touch -d"
RemainAfterExit=yes

[Install]
WantedBy=mediacenter.service

and here is my ts_env.sh:

Code:
#!/bin/sh

export TSLIB_TSDEVICE=/dev/input/event0
export TSLIB_PLUGINDIR=/usr/local/lib/ts
export TSLIB_CONSOLEDEVICE=none
export TSLIB_FBDEVICE=/dev/fb0
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_CONFFILE=/usr/local/etc/ts.conf
#export TSLIB_TAP_TIME=200

I made the ts_env.sh script executable with

Code:
cd /usr/local/bin
chmod +x ts_env.sh

and enabled the service with

Code:
sudo systemctl enable ts_uinput_touch.service

The problem now is that when the service starts up, the system boot hangs up, and the boot sequence stops after it says "started Touchscreen support daemon [OK]" and it just sits there at the console indefinitely. It does start way before kodi starts, though (that's because kodi doesn't have a chance to start because the system hangs, he he he).
(This post was last modified: 2015-08-21 08:20 by thebestofall007.)
find quote
ultraman Offline
Member
Posts: 80
Joined: Mar 2012
Reputation: 2
Post: #63
Try removing line Environment and fix ExecStartPre and ExecStart (you are missing service argument and one dot character).
find quote
thebestofall007 Offline
Junior Member
Posts: 47
Joined: May 2012
Reputation: 0
Post: #64
(2015-08-21 09:01)ultraman Wrote:  Try removing line Environment and fix ExecStartPre and ExecStart (you are missing service argument and one dot character).


Oh, that dot before /usr in ExecStart=-/bin/sh -c ". /usr/local/bin/ts_env.sh; exec ts_uinput_touch -d"?

What would a service argument be in my case?
find quote
ultraman Offline
Member
Posts: 80
Joined: Mar 2012
Reputation: 2
Post: #65
(2015-08-21 10:22)thebestofall007 Wrote:  What would a service argument be in my case?
My line
Code:
ExecStartPre=-/bin/sh -c "exec /bin/sh /usr/bin/ts_calibrate.sh service"
You are missing service string.

Update: I also add waveshare screen support.
(This post was last modified: 2015-08-31 10:43 by ultraman.)
find quote
thebestofall007 Offline
Junior Member
Posts: 47
Joined: May 2012
Reputation: 0
Post: #66
(2015-08-21 10:57)ultraman Wrote:  Update: I also add waveshare screen support.

Oh, awesome! Mine is a waveshare.

What will those updates do?
I'll do a new clone of your repository and try this again when I'm not as occupied.

I've been busy lately with school and car repairs, and haven't had time to tinker with this at the time.
(This post was last modified: 2015-09-01 13:55 by thebestofall007.)
find quote
ultraman Offline
Member
Posts: 80
Joined: Mar 2012
Reputation: 2
Post: #67
(2015-09-01 11:28)thebestofall007 Wrote:  mine is a waveshare. What will those updates do?
I know that one 5 inch display works with driver I add.

Update: Calibration fixed too. After first boot kodi's addon must be started to calibrate. It just works Blush
Update: Now after calibration is done all modules are reloaded (and calibration data too) which means touchscreen works immediately after calibration is done.
(This post was last modified: 2015-09-20 18:00 by ultraman.)
find quote
thebestofall007 Offline
Junior Member
Posts: 47
Joined: May 2012
Reputation: 0
Post: #68
I found their wiki if this can help:

http://www.waveshare.com/wiki/5inch_HDMI_LCD_%28B%29

I bought it from here:

http://www.ebay.com/itm/371336861897?_tr...EBIDX%3AIT
find quote
ultraman Offline
Member
Posts: 80
Joined: Mar 2012
Reputation: 2
Post: #69
I don't know which display is actually used.
And tslib raw input driver is made by informations from here.

Working touchscreen data:
Bus 001 Device 005: ID 0eef:0005 D-WAV Scientific Co., Ltd

DRIVER=hid-generic
HID_ID=0003:00000EEF:00000005
HID_NAME=RPI_TOUCH By ZH851
HID_PHYS=usb-3f980000.usb-1.5/input0
HID_UNIQ=3�785321R469
MODALIAS=hid:b0003g0001v00000EEFp00000005

hidraw data length: 22 bytes
(This post was last modified: 2015-09-02 09:16 by ultraman.)
find quote
thebestofall007 Offline
Junior Member
Posts: 47
Joined: May 2012
Reputation: 0
Post: #70
oh, ok.
find quote
dawed Offline
Member
Posts: 54
Joined: Sep 2015
Reputation: 1
Post: #71
looks great but i'm not able to compile...

i'd first
git clone https://github.com/vpeter4/tslib -b ts_uinput_touch ts_uinput_touch
but when i try to run ./autogen.sh i get following error:

Can't exec "aclocal": No such file or directory at /usr/share/autoconf/Autom4te/FileUtils.pm line 326.
autoreconf: failed to run aclocal: No such file or directory

something i miss, but i have no idea what Sad
find quote
ultraman Offline
Member
Posts: 80
Joined: Mar 2012
Reputation: 2
Post: #72
dawed, seems you have issues with autoconf or something like that. Try to reinstall it.
find quote
dawed Offline
Member
Posts: 54
Joined: Sep 2015
Reputation: 1
Post: #73
ohhh... automake package was missing...

but now other errors Sad

$ sudo ./autogen.sh
configure.ac:24: error: possibly undefined macro: AC_DISABLE_STATIC
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
configure.ac:25: error: possibly undefined macro: AC_ENABLE_SHARED
configure.ac:26: error: possibly undefined macro: AC_LIBTOOL_DLOPEN
configure.ac:27: error: possibly undefined macro: AC_PROG_LIBTOOL
autoreconf: /usr/bin/autoconf failed with exit status: 1
[email protected]:~/ts_uinput_touch$ ./configure
configure: error: cannot find install-sh, install.sh, or shtool in "." "./.." "./../.."


or do i need other packages first to run your daemon?
(This post was last modified: 2015-10-14 14:07 by dawed.)
find quote
ultraman Offline
Member
Posts: 80
Joined: Mar 2012
Reputation: 2
Post: #74
automake, libtool, autoconf
find quote
dawed Offline
Member
Posts: 54
Joined: Sep 2015
Reputation: 1
Post: #75
EDIT: oh there are othere posts with the same here Smile give them a look first

i'm a noob...
sorry

next errors:
Making install in etc
make[1]: Entering directory '/home/osmc/ts_uinput_touch/etc'
make[2]: Entering directory '/home/osmc/ts_uinput_touch/etc'
/bin/mkdir -p '/usr/local/etc'
/usr/bin/install -c -m 644 ts.conf '/usr/local/etc'
/usr/bin/install: cannot remove '/usr/local/etc/ts.conf': Permission denied
Makefile:326: recipe for target 'install-sysconfDATA' failed
make[2]: *** [install-sysconfDATA] Error 1
make[2]: Leaving directory '/home/osmc/ts_uinput_touch/etc'
Makefile:396: recipe for target 'install-am' failed
make[1]: *** [install-am] Error 2
make[1]: Leaving directory '/home/osmc/ts_uinput_touch/etc'
Makefile:467: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
(This post was last modified: 2015-10-14 14:23 by dawed.)
find quote
Post Reply