WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Touchscreen on piCore  (Read 1685 times)

Offline MrToga

  • Full Member
  • ***
  • Posts: 142
Re: Touchscreen on piCore
« Reply #15 on: May 25, 2022, 07:24:33 AM »
Doesn't work either.
I saw a file named 10-quirk so I try to rename the file 09-screen.conf but still don't work
It's fine

Offline MrToga

  • Full Member
  • ***
  • Posts: 142
Re: Touchscreen on piCore
« Reply #16 on: May 31, 2022, 02:34:35 AM »
Hello guys,

I found something while searching if my touchscreen is really seen as a touchscreen but in Xorg.0.log I saw that my touchscreen driver is seen as a mouse and that he is using the configuration InputClass from 'libinpute pointer catchall' :
Code: [Select]
   53.460] (II) config/udev: Adding input device EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface (/dev/input/event4)
[    53.460] (**) EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface: Applying InputClass "libinput pointer catchall"
and that Xorg recognise this like I said : 
Code: [Select]
event4  - EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface: is tagged by udev as: Mouse
[    53.726] (II) event4  - EloTouchSystems,Inc Elo TouchSystems 2216 AccuTouch® USB Touchmonitor Interface: device is a pointer
Any toughts ?
It's fine

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 13997
Re: Touchscreen on piCore
« Reply #17 on: May 31, 2022, 03:42:23 AM »
Does the boot code usbhid.mousepoll=0 fix it?

Offline MrToga

  • Full Member
  • ***
  • Posts: 142
Re: Touchscreen on piCore
« Reply #18 on: May 31, 2022, 04:47:20 AM »
Where do I put this line because I don't find any file that show bootcode I only find an option called showbootcode that only shows me what are the oprtion on boot I try to search something like this : http://forum.tinycorelinux.net/index.php?topic=13762.0 /extlinux.conf but didn't find any.

It's fine

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10363
Re: Touchscreen on piCore
« Reply #19 on: May 31, 2022, 05:15:06 AM »
Hi MrToga
... /extlinux.conf but didn't find any.
Pi uses a different bootloader. Try this:
Code: [Select]
sudo mount /dev/mmcblk0p1
cd /mnt/mmcblk0p1/
Then add it to  cmdline.txt.

Quote
Where do I put this line ...
It's not a separate line. Append it to the existing line.

Offline MrToga

  • Full Member
  • ***
  • Posts: 142
Re: Touchscreen on piCore
« Reply #20 on: May 31, 2022, 05:27:36 AM »
So I added like Rich said but it still say that my touchscreen is a mouse here the cmdline.txt file

Am I in the wrong file ?
It's fine

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10363
Re: Touchscreen on piCore
« Reply #21 on: May 31, 2022, 05:48:07 AM »
Hi MrToga
It looks like you did it correctly.

Maybe there's an easier way since this worked:
I needed to install xinput and xrandr, after that I used
Code: [Select]
xinput set-prop <deviceid> "Coordinate Transformation Matrix" -1.1 0 1.02 0 1.05 -0.02 0 0 1 ----- Snip -----
But now I was wondering if I can make this modification persistent on my rasp ...
Create a file (any name you want) in the  /home/tc/.X.d  directory containing:
Code: [Select]
xinput set-prop <deviceid> "Coordinate Transformation Matrix" -1.1 0 1.02 0 1.05 -0.02 0 0 1 &Run a backup. Next time you boot, that command will be run automatically right after X starts.

Offline MrToga

  • Full Member
  • ***
  • Posts: 142
Re: Touchscreen on piCore
« Reply #22 on: May 31, 2022, 06:05:32 AM »
Hi Rich,

The problem with xinput is that when you unplug your usb and replug it the driver are set at defaults so the transformation matrix is reset.
« Last Edit: May 31, 2022, 06:10:36 AM by MrToga »
It's fine

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10363
Re: Touchscreen on piCore
« Reply #23 on: May 31, 2022, 06:50:01 AM »
Hi MrToga
I see. This may be a job for udev using a  .rules  file. Do the following:
1.
Code: [Select]
udevadm monitor --property > touch.txt2. Unplug the USB device.
3. Count to 3.
4. Re-plug the USB device.
5. Count to 3.
6. Press  Ctrl-C
7. Attach the  touch.txt  file to your next post.

I'll look at it tonight and see if I can figure out a  .rules  file to handle this.

Offline MrToga

  • Full Member
  • ***
  • Posts: 142
Re: Touchscreen on piCore
« Reply #24 on: May 31, 2022, 06:56:06 AM »
Hi Rich,

Here's the file.
Hope you can find something .
It's fine

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10363
Re: Touchscreen on piCore
« Reply #25 on: May 31, 2022, 09:49:53 AM »
Hi MrToga
Create a file called  TouchScreen.sh  in your  /home/tc/.local/bin  directory  that looks like this:
Code: [Select]
#!/bin/sh

# Exit if X is not running yet.
[ -z "$DISPLAY" ] && exit

xinput set-prop <deviceid> "Coordinate Transformation Matrix" -1.1 0 1.02 0 1.05 -0.02 0 0 1
Make it executable:
Code: [Select]
chmod 775 .local/bin/TouchScreen.sh
Create a file in the  /home/tc/.X.d  directory containing:
Code: [Select]
TouchScreen.sh &You can name that file anything you want.

Save the attached  98-touch.rules  file to  /etc/udev/rules.d/
Add  etc/udev/rules.d/98-touch.rules  to your backup.
Run a backup.

When you reboot, the file you created in  /home/tc/.X.d  will run  TouchScreen.sh.
Now udev should sense any time your USB device gets plugged in and run  TouchScreen.sh.

    [EDIT]: Attachment removed. See reply #27 for corrected version.  Rich
« Last Edit: June 01, 2022, 06:33:08 AM by Rich »

Offline MrToga

  • Full Member
  • ***
  • Posts: 142
Re: Touchscreen on piCore
« Reply #26 on: June 01, 2022, 02:39:39 AM »
Update :
So after putting all the files like Rich told me. The command worked when I start my X server but when I try to unplug/replug my usb it doesn't work so I used the command :
Code: [Select]
sudo udevd --debugto see if there are problem and I saw something like this after commanting the line in touchscreen (because it return me 0 and doesn't work either) :
Code: [Select]
[ -z "$DISPLAY" ] && exit
Code: [Select]
[1319.071965] [3907] udev_event_spawn: starting '/home/tc/.local/bin/TouchScreen.sh'
[1319.088537] [3899] spawn_read: '/home/tc/.local/bin/TouchScreen.sh'(err) 'Unable to connect to X server'
[1319.090857] [3899] spawn_wait: '/home/tc/.local/bin/TouchScreen.sh' [3907] exit with return code 1
It's strange because I run xhost + and xterm -display my.ip.adress:0.0 to be sure that I can connect and it worked.
Any toughts ?
« Last Edit: June 01, 2022, 02:44:40 AM by MrToga »
It's fine

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10363
Re: Touchscreen on piCore
« Reply #27 on: June 01, 2022, 05:40:17 AM »
Hi MrToga
Save this new attached  98-touch.rules  file to  /etc/udev/rules.d/
Run:
Code: [Select]
sudo udevadm control --reload-rules See if unplugging/replugging the USB works now.

Offline MrToga

  • Full Member
  • ***
  • Posts: 142
Re: Touchscreen on piCore
« Reply #28 on: June 01, 2022, 05:58:15 AM »
Hi Rich,

Thanks a lot it worked now but can you explain me how does the 98-touch.rules file work ?
It's fine

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 10363
Re: Touchscreen on piCore
« Reply #29 on: June 01, 2022, 06:24:58 AM »
Hi MrToga
I'll do my best.

If the current action is not bind, ignore this event.
Code: [Select]
ACTION!="bind", GOTO="touch_end"
If the current subsystem is not usb, ignore this event.
Code: [Select]
SUBSYSTEM!="usb", GOTO="touch_end"
If the vendor ID matches 04e7 and the model ID mathes 0050 ...
Code: [Select]
ENV{ID_VENDOR_ID}=="04e7", ENV{ID_MODEL_ID}=="0050", ...
 ... then run the command inside the quotes:
Code: [Select]
RUN+="/b in/sh -c 'DISPLAY=:0 /home/tc/.local/bin/TouchScreen.sh'"
The values were obtained from the  touch.txt  file you attached in a previous post. The event they were taken
from was the last event that occurred after you plug in the USB (end of file).

More adventures with udev can be found here:
http://forum.tinycorelinux.net/index.php/topic,25540.0.html