Hello everyone,
I’ve once again encountered issues during reboots where I lost access to the touchscreen function. To address this problem, I’m now using a service that resets the touchscreen function at startup. Here is the file that performs the reset:
reset-touch.sh
#!/bin/bash
# Reset script for the Official Raspberry Pi Touch Display v2 (goodix_ts driver)
TRIES=3
for i in $(seq 1 $TRIES); do
echo "Attempt $i: resetting goodix_ts module..."
modprobe -r goodix_ts
sleep 1
modprobe goodix_ts && exit 0
sleep 2
done
echo "⚠️ Failed to reset touchscreen after $TRIES attempts."
exit 1
Here is the service that uses this file:
[Unit]
Description=Reset touchscreen for Raspberry Pi Official Touch Display (goodix_ts)
After=multi-user.target
[Service]
Type=oneshot
ExecStart=/usr/local/bin/reset-touch.sh
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Here is the script that put in place the service :
reset-touch.service
#!/bin/bash
# Installation script for touchscreen reset service (goodix_ts)
# Run after every Volumio installation or update
set -e
echo "=== Installing touchscreen reset service (goodix_ts) ==="
# Copy script to /usr/local/bin
sudo cp reset-touch.sh /usr/local/bin/reset-touch.sh
sudo chmod +x /usr/local/bin/reset-touch.sh
# Copy systemd service
sudo cp reset-touch.service /etc/systemd/system/reset-touch.service
# Enable and start service
sudo systemctl daemon-reexec
sudo systemctl enable reset-touch.service
sudo systemctl start reset-touch.service
echo "✅ Installation complete. Touchscreen will be reset automatically on every boot."
To put them into the system here is the associated script :
install.sh
#!/bin/bash
# Installation script for touchscreen reset service (goodix_ts)
# Run after every Volumio installation or update
set -e
echo "=== Installing touchscreen reset service (goodix_ts) ==="
# Copy script to /usr/local/bin
sudo cp reset-touch.sh /usr/local/bin/reset-touch.sh
sudo chmod +x /usr/local/bin/reset-touch.sh
# Copy systemd service
sudo cp reset-touch.service /etc/systemd/system/reset-touch.service
# Enable and start service
sudo systemctl daemon-reexec
sudo systemctl enable reset-touch.service
sudo systemctl start reset-touch.service
echo "✅ Installation complete. Touchscreen will be reset automatically on every boot."
If it can be usefull. I should mention that I’m not a developer, so I set this up just using my limited skills.
Regards
Ben