Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: MrToga on May 20, 2022, 08:57:49 AM
-
Hello guys,
I have a touchscreen on piCore but it seem that the axe x are reverse
How can I calibrate my screen ?
-
axis x*
-
Its probably easiest to swap it in the touch driver. But it depends on what touchscreen you have.
-
Is the screen official one ?
You can just edit the config.txt file to swap the screen and the touch.
https://support.thepihut.com/hc/en-us/articles/115002072865-Official-touchscreen-is-upside-down
https://forums.raspberrypi.com/viewtopic.php?t=281149
-
Update :
I needed to install xinput and xrandr, after that I used xinput set-prop <deviceid> "Coordinate Transformation Matrix" -1.1 0 1.02 0 1.05 -0.02 0 0 1link here : https://unix.stackexchange.com/questions/685039/x11-how-to-invert-axis-on-touchscreen-matrix
But now I was wondering if I can make this modification persistent on my rasp I found this but don't know what to do (https://askubuntu.com/questions/20298/how-to-make-xinput-settings-persist-after-devices-are-unplugged-replugged-and)
-
Update :
After searching I found out that you can put a file in xorg.conf.d/ to handle the touchscreen ( https://askubuntu.com/questions/178140/xinput-coordinate-transformation-matrix-in-xorg-conf)
But after putting the file in xorg.conf.d and startx my touchscreen isn't modified by that file (See attached file).
Any toughts ?
-
Assuming you put the snippet in /usr/local/share/X11/xorg.conf.d, do you need MatchIsTouchscreen "on"?
-
Hi juanito,
I just put MatchTouchscreen "on" betwenn Identifier and Driver it still doesn't work (I'm putting the snippet in /usr/local/share/X11/xorg.conf.d).
Maybe it's my syntax.
Any toughts ?
-
Not MatchTouchscreen, but MatchIsTouchscreen...
-
Sorry that's what I wrote in the file but still doesn't work
-
So this doesn't work?
Section "InputClass"
Identifier "libinput touchscreen catchall"
MatchIsTouchscreen "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "TransformationMatrix" "-1.1 0 1.02 0 1.05 -0.02 0 0 1"
EndSection
-
Yes doesn't work for me
-
Are there any other conf snippets in /usr/local/share/X11/xorg.conf.d that might conflict with this?
-
Maybe the 40-libinput.conf but I can't modify this file since it's in /tmp/tcloop/xf86-input-libinput/usr/local/share/X11/xorg.conf.d/
Plus Xorg execute the file with the lowest number first.
-
What happens if you rename your snippet 50-screen.conf -> 10-screen.conf?
-
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
-
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' :
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 : 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 pointerAny toughts ?
-
Does the boot code usbhid.mousepoll=0 fix it?
-
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.
-
Hi MrToga
... /extlinux.conf but didn't find any.
Pi uses a different bootloader. Try this:
sudo mount /dev/mmcblk0p1
cd /mnt/mmcblk0p1/Then add it to cmdline.txt.
Where do I put this line ...
It's not a separate line. Append it to the existing line.
-
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 ?
-
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 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:
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.
-
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.
-
Hi MrToga
I see. This may be a job for udev using a .rules file. Do the following:
1. 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.
-
Hi Rich,
Here's the file.
Hope you can find something .
-
Hi MrToga
Create a file called TouchScreen.sh in your /home/tc/.local/bin directory that looks like this:
#!/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 1Make it executable:
chmod 775 .local/bin/TouchScreen.sh
Create a file in the /home/tc/.X.d directory containing:
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
-
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 :
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) :
[ -z "$DISPLAY" ] && exit[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 ?
-
Hi MrToga
Save this new attached 98-touch.rules file to /etc/udev/rules.d/
Run:
sudo udevadm control --reload-rules See if unplugging/replugging the USB works now.
-
Hi Rich,
Thanks a lot it worked now but can you explain me how does the 98-touch.rules file work ?
-
Hi MrToga
I'll do my best.
If the current action is not bind, ignore this event.
ACTION!="bind", GOTO="touch_end"
If the current subsystem is not usb, ignore this event.
SUBSYSTEM!="usb", GOTO="touch_end"
If the vendor ID matches 04e7 and the model ID mathes 0050 ...
ENV{ID_VENDOR_ID}=="04e7", ENV{ID_MODEL_ID}=="0050", ...
... then run the command inside the quotes:
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
-
Hello,
xinput extension submitted