Touch Display plugin not working with PiTFT 3.5

Hello!

(Sorry for the intentionally broken links, I am a new user so I can’t post more than 2 links)

I am trying to make Volumio (3.819) and the touchscreen plugin (3.5.1) work with my Adafruit PiTFT 3.5 with resistive touchscreen. I am getting partway there — I am able to get X to start running on the touchscreen — but I’m having trouble making the plugin actually use it.

Here is the set of steps that I have performed that has gotten me closest to it working.

  1. Flash a new SD card from the latest image.

  2. Do the setup wizard.

  3. Go to volumio.local/dev and Enable SSH.

  4. Log in to volumio.local via ssh (user/pass volumio/volumio)

  5. sudo apt install raspi-config

  6. (Now working from this set of instructions: h ttps://learn.adafruit.com/adafruit-pitft-3-dot-5-touch-screen-for-raspberry-pi/easy-install-2):

sudo apt install python3-venv
python -m venv env --system-site-packages
cd ~
sudo apt-get update
sudo apt-get install -y git python3-pip
pip3 install --upgrade adafruit-python-shell click
git clone https://github.com/adafruit/Raspberry-Pi-Installer-Scripts.git
cd Raspberry-Pi-Installer-Scripts
sudo -E env PATH=$PATH python3 adafruit-pitft.py
  1. In the wizard, choose 3.5 resistive, and “console mode”.

  2. (Now working from this set of instructions starting at step 6: h ttps://community.volumio.com/t/volumio-2-and-pitft-adafruit-2-8/7560/6) Modify /boot/config.txt to add the line dtparam=i2c_vc=on which was the only one missing.

  3. Edit the file /boot/cmdline to verify that the following was at the end: fbcon=map:10 fbcon=font:VGA8x8 consoleblank=0

  4. Reboot.

  5. Install touch plugin via web interface.

So this is where I’m at now: Having done all the above, the console shows on the touchscreen.

If I run the following commands:

sudo systemctl stop volumio-kiosk.service
FRAMEBUFFER=/dev/fb1 startx

Then X starts up on the touchscreen and the mouse pointer shows! However, I can’t figure out how to configure the plugin to use the correct frame buffer device.

All of the instructions I’ve found so far for the PiTFT touchscreens rely on modifying the configuration of the fbturbo X driver to use fb1 instead of fb0, but the newer PiTFT drivers appear not to use fbturbo anymore. I tried installing xserver-xorg-video-fbturbo, but that did not solve the problem and it produced errors in the X.org logs.

Wondering if anyone has already gotten this to work and can shove me in the right direction?

The touchscreen calibration is also off by 90 degrees, but that’ll be the next problem :wink:

I suggest to start with a fresh Volumio installation.

Then don’t folow the Adafruits instructions, but put

dtparam=spi=on
dtoverlay=pitft35-resistive,speed=20000000,fps=20,drm

into your “/boot/userconfig.txt”.

Thanks for the response!

To be clear, does this mean that I don’t need the Adafruit script to set up the device tree?

Where can I find logs for the plugin on the device, so I can try to do some troubleshooting on my own?

  • Correct, don’t use the script.
  • You can open http://yourvolumioip/dev and use the “Send logs of bug report” and open the url in your browser.
  • You can open a 2nd terminal and run volumio livelog

Hi again, I finally got around to reformatting the card and setting up the bootconfig.txt as described. When I go to activate the plugin, I have the error:

Jul 26 14:02:02 volumio volumio[1042]: error: touch_display: Error setting display brightness: Error: EINVAL: invalid argument, write

The touchscreen does “turn on” and briefly flashes a pink colour, before then going fully white. I wonder if it still is somehow trying to access the wrong device …? But there isn’t much shown in the X11 logs.