How set Touch screen calibration on imx7 torizon weston?

torizon@colibri-imx7-emmc-06673350:~$ docker exec -it weston evtest /dev/input/touchscreen0
Input driver version is 1.0.1
Input device ID: bus 0x18 vendor 0x0 product 0x79 version 0x3
Input device name: “AD7879 Touchscreen”
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 330 (BTN_TOUCH)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 0
Min 0
Max 4095
Event code 1 (ABS_Y)
Value 0
Min 0
Max 4095
Event code 24 (ABS_PRESSURE)
Value 0
Min 0
Max 4096
Properties:
Testing … (interrupt to exit)
this is screen event which are currently executed in my display 7inch resistive imx7 colibri even though i am not able to touch screen .screen is clickable but not touchable.
weston.ini
[shell]
panel-position=none
locking=false
cursor-theme=hicolor
cursor-size=32

[input]
touch2pointer=true

[screensaver]
disable=true
i set this please guide me for this issue @ToradexAI .

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


Hello! Thank you for providing the detailed information about your setup and configuration.

From your description, the AD7879 touchscreen input device is detected, and evtest shows that it is generating events. However, you mention that the screen is “clickable but not touchable,” which I understand as the display responding to pointer events (possibly from a mouse), but not to actual touch input on your 7-inch resistive screen.

Here are the steps you should take to resolve this:

1. Calibrate the Touchscreen

For resistive touch displays on Colibri iMX7 with Torizon, you need to calibrate the touchscreen using the weston-touch-calibrator container. This ensures that touch coordinates are correctly mapped.

Follow these steps:

a. Stop all running containers:

docker stop $(docker ps -q)

Reference

b. Start the weston-touch-calibrator container:

docker run -ti --rm --privileged -v /dev:/dev -v /run/udev/:/run/udev/ -v /etc/udev/rules.d:/etc/udev/rules.d torizon/weston-touch-calibrator:$CT_TAG_WESTON_TOUCH_CALIBRATOR

Reference

c. You should see a calibration screen. Touch each cross as it appears. When finished, you will return to the Weston desktop.

d. Reboot the device so the calibration takes effect.

2. Check Your weston.ini

Your [input] section with touch2pointer=true is correct for converting single touches to pointer events. After calibration, this should ensure proper pointer operation from the touchscreen.

3. Troubleshooting

  • If you still have issues after calibration, verify that the touch device is correctly set in /etc/udev/rules.d/ and see if a matrix calibration file was created (typically /etc/udev/rules.d/98-touchscreen-calibration.rules).
  • Check if the Weston service logs (journalctl -u weston.service) report any errors regarding input devices.
  • Confirm that no other input device (like a USB mouse) is interfering during calibration.

You can find the official touchscreen calibration instructions and additional troubleshooting tips in the documentation:
Touch Screen Calibration on Torizon

Let me know if calibration solves the problem or if you need more help with additional troubleshooting steps.

Best regards,
Toradex AI Assistant.

Hi @intersense.design!

I saw you opened another thread. Can I consider this one solved? Were you able to calibrate your touch screen?

Best regards.

no please help me solve this touch calibration issue i am able to click my application not able to touch
this is input
torizon@colibri-imx7-emmc-06673350:~$ cat /proc/bus/input/devices
I: Bus=0018 Vendor=0000 Product=0079 Version=0003
N: Name=“AD7879 Touchscreen”
P: Phys=0-002c/input0
S: Sysfs=/devices/platform/soc/30800000.bus/30a20000.i2c/i2c-0/0-002c/input/input0
U: Uniq=
H: Handlers=event0
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003

I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name=“gpio-keys”
P: Phys=gpio-keys/input0
S: Sysfs=/devices/platform/gpio-keys/input/input1
U: Uniq=
H: Handlers=kbd event1
B: PROP=0
B: EV=3
B: KEY=8000 0 0 0 0

I: Bus=0003 Vendor=04ca Product=00bd Version=0111
N: Name=“LITEON Dell Wireless Device”
P: Phys=usb-ci_hdrc.0-1/input0
S: Sysfs=/devices/platform/soc/30800000.bus/30b10000.usb/ci_hdrc.0/usb2/2-1/2-1:1.0/0003:04CA:00BD.0001/input/input2
U: Uniq=
H: Handlers=sysrq kbd leds event2
B: PROP=0
B: EV=120013
B: KEY=10000 7 ff9f207a c14057ff febeffdf ffefffff ffffffff fffffffe
B: MSC=10
B: LED=1f

I: Bus=0003 Vendor=04ca Product=00bd Version=0111
N: Name=“LITEON Dell Wireless Device Mouse”
P: Phys=usb-ci_hdrc.0-1/input1
S: Sysfs=/devices/platform/soc/30800000.bus/30b10000.usb/ci_hdrc.0/usb2/2-1/2-1:1.1/0003:04CA:00BD.0002/input/input3
U: Uniq=
H: Handlers=event3
B: PROP=0
B: EV=17
B: KEY=ff0000 0 0 0 0 0 0 0 0
B: REL=903
B: MSC=10

I: Bus=0003 Vendor=04ca Product=00bd Version=0111
N: Name=“LITEON Dell Wireless Device Consumer Control”
P: Phys=usb-ci_hdrc.0-1/input1
S: Sysfs=/devices/platform/soc/30800000.bus/30b10000.usb/ci_hdrc.0/usb2/2-1/2-1:1.1/0003:04CA:00BD.0002/input/input4
U: Uniq=
H: Handlers=kbd event4
B: PROP=0
B: EV=1f
B: KEY=306ff 0 0 0 0 483ffff 17aff32d bfd44446 0 0 1 130ff3 8b17c000 677bfa d9415fed 9ed680 4400 0 10000002
B: REL=1040
B: ABS=1 0
B: MSC=10

torizon@colibri-imx7-emmc-06673350:~$ ls -l /dev/input/
total 0
drwxr-xr-x 2 root root 100 Jul 9 09:21 by-id
drwxr-xr-x 2 root root 140 Jul 9 09:21 by-path
crw-rw---- 1 root input 13, 64 Jul 3 11:59 event0
crw-rw---- 1 root input 13, 65 Jul 3 11:59 event1
crw-rw---- 1 root input 13, 66 Jul 9 09:21 event2
crw-rw---- 1 root input 13, 67 Jul 9 09:21 event3
crw-rw---- 1 root input 13, 68 Jul 9 09:21 event4
lrwxrwxrwx 1 root root 6 Jul 3 11:59 touchscreen0 → event0

then i start docker run -it --ipc=host --name=weston --net=host --cap-add CAP_SYS_TTY_CONFIG -v /dev:/dev -v /tmp:/tmp -v /run/udev:/run/udev -v /home/torizon/weston-config/weston.ini:/etc/xdg/weston/weston.ini --device-cgroup-rule=‘c 4:* rmw’ --device-cgroup-rule=‘c 13:* rmw’ --device-cgroup-rule=‘c 226:* rmw’ torizon/arm32v7-debian-weston
after run my app using docker run -it -v /tmp/1000-runtime-dir:/tmp/1000-runtime-dir -v /dev:/dev -v /run/udev:/run/udev -e XDG_RUNTIME_DIR=/tmp/1000-runtime-dir -e QT_QPA_PLATFORM=wayland intersense123/my_app1:1.0 I am using pyqt5 ui in my application please help me to find solution @lucas_az.tx @ToradexAI

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

Did you like my answer? :+1: :-1:


Hello and thank you for the details. Since you can “click” but not register real touchscreen events in your PyQt5 application, your issue is typical for resistive touch panels used with Wayland/Weston and needs proper calibration, touch2pointer setup, and potentially special udev rules. Here’s a full step-by-step solution:


1. Calibrate the Touchscreen

You need to run the Weston Touch Calibrator to generate the calibration data.

a) Stop all running containers (including weston and your app):

docker stop $(docker ps -q)

b) Run the calibration container:

docker run -ti --rm --privileged \
  -v /dev:/dev \
  -v /run/udev/:/run/udev/ \
  -v /etc/udev/rules.d:/etc/udev/rules.d \
  torizon/weston-touch-calibrator:3

Make sure you have internet on the module or that the referenced image is available locally.
Documentation:
Touch Screen Calibration (Torizon) | Toradex Developer Center

c) Complete the calibration:
Touch all points as requested. When done, the container exits and writes the calibration matrix as a udev rule, usually /etc/udev/rules.d/98-touchscreen-calibration.rules.

d) Reboot the module:

sudo reboot

2. Verify the Calibration Rule

After reboot, check that the rule exists:

cat /etc/udev/rules.d/98-touchscreen-calibration.rules

You should see a line similar to:

SUBSYSTEM=="input", KERNEL=="event0", ENV{ID_INPUT_TOUCHSCREEN}=="1", ENV{LIBINPUT_CALIBRATION_MATRIX}="..."

Validate that the event0 matches your touchscreen device.

You can also use:

udevadm info /dev/input/event0

Look for LIBINPUT_CALIBRATION_MATRIX=...
Docs:


3. Set up udev Ignore Rule (for touch2pointer)

This disables direct input for Weston/libinput so only touch2pointer handles touch (needed for many Qt/PyQt5 apps):

Append this to your /etc/udev/rules.d/98-touchscreen-calibration.rules (or create 99-touch2pointer.rules):

SUBSYSTEM=="input", KERNEL=="event0", ENV{LIBINPUT_IGNORE_DEVICE}="1"

4. Check weston.ini for touch2pointer

Your file should include:

[input]
touch2pointer=true

Docs:


5. Launch weston, then your app

  1. Start Weston container:
docker run -it --ipc=host --name=weston --net=host \
  --cap-add CAP_SYS_TTY_CONFIG \
  -v /dev:/dev -v /tmp:/tmp -v /run/udev:/run/udev \
  -v /home/torizon/weston-config/weston.ini:/etc/xdg/weston/weston.ini \
  --device-cgroup-rule='c 4:* rmw' \
  --device-cgroup-rule='c 13:* rmw' \
  --device-cgroup-rule='c 226:* rmw' \
  torizon/arm32v7-debian-weston
  1. In another terminal, start your application container as before.

6. Test the Touch

  • Now, touching your screen should send pointer events to your application via touch2pointer.
  • If you’re still only able to “click” with a mouse but not with the touchscreen, double-check:
    • The calibration rule is present and correctly references event0
    • The ignore rule is present
    • Your pyqt5 app is set for Wayland (QT_QPA_PLATFORM=wayland)

7. If it still fails:

  • Try removing USB mouse receiver before calibration and startup.
  • Consider running your app with QT_DEBUG_PLUGINS=1 to debug Qt input devices.

References:


Let me know if you’re able to register touch as mouse clicks in your PyQt5 app after this process, or if you need more troubleshooting.

Best regards,
Toradex AI Assistant.

[10:43:07.828] launching ‘/usr/lib/arm-linux-gnueabihf/weston-desktop-shell’
could not load cursor ‘dnd-move’
could not load cursor ‘dnd-copy’
could not load cursor ‘dnd-none’
wayland-0
could not load cursor ‘dnd-move’
could not load cursor ‘dnd-copy’
could not load cursor ‘dnd-none’
could not load cursor ‘dnd-move’
could not load cursor ‘dnd-copy’
could not load cursor ‘dnd-none’
weston-touch-calibrator error: “Unknown-1” was not found. always this error getting @ToradexAI

Thanks for your response.

Please remember to tick the “Solution” checkbox below if my response solves your question. If you have follow-up questions, just continue to tag me using @ToradexAI in your new posts.

Did you like my answer? :+1: :-1:


Thank you for your detailed update.

The error message:

weston-touch-calibrator error: “Unknown-1” was not found.

means the weston-touch-calibrator cannot identify your AD7879 touchscreen device. This is a known issue, especially with resistive touchscreens on Colibri iMX7. The calibrator fails to autocomplete the device, so you’ll need to work around it with a manual calibration.

Please try the following steps:


1. Manual Calibration by Creating a Udev Rule

You can create a calibration rule manually.

a) Create the file:

sudo nano /etc/udev/rules.d/98-touchscreen-calibration.rules

b) Add this content (you may adjust the matrix values if necessary):

SUBSYSTEM=="input", KERNEL=="event0", ENV{ID_INPUT_TOUCHSCREEN}=="1", ENV{LIBINPUT_CALIBRATION_MATRIX}="1 0 0 0 1 0"
SUBSYSTEM=="input", KERNEL=="event0", ENV{LIBINPUT_IGNORE_DEVICE}="1"
  • The LIBINPUT_CALIBRATION_MATRIX above is a neutral matrix (no change). Change the values if you need to flip, stretch, or mirror the axes.
  • Make sure event0 is your touchscreen device as shown in your logs.

c) Save the file and reboot:

sudo reboot

2. Confirm Device Node and Matrix Is Applied

After reboot, run:

udevadm info /dev/input/event0 | grep LIBINPUT

You should see:

E: LIBINPUT_CALIBRATION_MATRIX=1 0 0 0 1 0
E: LIBINPUT_IGNORE_DEVICE=1

3. Check Your weston.ini File

Ensure you have this line set:

[input]
touch2pointer=true

and that your weston container is mounting this file.


4. Restart Weston and Your Application

  • Start the Weston container first.
  • Then launch your application container (with QT_QPA_PLATFORM=wayland).

5. If You Still Don’t Get Touch Events

  • Remove any USB mouse receivers before starting Weston.
  • Make sure /dev/input/event0 is your AD7879 touchscreen (as in your ls -l /dev/input/ and cat /proc/bus/input/devices output).
  • If you have rotated or mounted the display differently, you may need to adjust the calibration matrix accordingly. For example, for a 180° rotation:
    ENV{LIBINPUT_CALIBRATION_MATRIX}="-1 0 1 0 -1 1"
    

References:


Let me know if manual calibration works or if you need to tune the matrix for correct axis orientation.

Best regards,
Toradex AI Assistant.

torizon@colibri-imx7-emmc-06673350:~$ udevadm info /dev/input/event0 | grep LIBINPUT
E: LIBINPUT_CALIBRATION_MATRIX=1 0 0 0 1 0
E: LIBINPUT_IGNORE_DEVICE=1
torizon@colibri-imx7-emmc-06673350:~$ ls -l /dev/input/
total 0
drwxr-xr-x 2 root root 80 Jul 9 10:48 by-path
crw-rw---- 1 root input 13, 64 Jul 9 10:48 event0
crw-rw---- 1 root input 13, 65 Jul 9 10:48 event1
lrwxrwxrwx 1 root root 6 Jul 9 10:48 touchscreen0 → event0
torizon@colibri-imx7-emmc-06673350:~$ cat /proc/bus/input/devices
I: Bus=0018 Vendor=0000 Product=0079 Version=0003
N: Name=“AD7879 Touchscreen”
P: Phys=0-002c/input0
S: Sysfs=/devices/platform/soc/30800000.bus/30a20000.i2c/i2c-0/0-002c/input/input0
U: Uniq=
H: Handlers=event0
B: PROP=0
B: EV=b
B: KEY=400 0 0 0 0 0 0 0 0 0 0
B: ABS=1000003

I: Bus=0019 Vendor=0001 Product=0001 Version=0100
N: Name=“gpio-keys”
P: Phys=gpio-keys/input0
S: Sysfs=/devices/platform/gpio-keys/input/input1
U: Uniq=
H: Handlers=kbd event1
B: PROP=0
B: EV=3
B: KEY=8000 0 0 0 0
please guide me what i do step by step i tried multiple ways but not working @ToradexAI

Hi @intersense.design!

Just to understand your issue properly, what version of Torizon are you using?

Best regards.