Volumio with 3.5" TFT Touch Screen (GPIO) RPi 3B+

Display 3.5inch RPI DisplayLCD 480x320pixel XPT2046
nothing more is written on it. runs via gpio


here with it runs on raspbian


https://www.elecrow.com/wiki/index.php?title=3.5_Inch_480x320_TFT_Display_with_Touch_Screen_for_Raspberry_Pi#Step_4:_Install_driver

Ok, that’s something to start from :wink:

Since I don’t know in what state your Volumio installation is now, I recommend to start with a fresh Volumio system, i.e. start from scratch. Make sure to wair some minutes after the first boot of Volumio so the data partition can fully expand. Otherwise you will not be able to install the Touch Display plugin because of too less space.

The following is more or less a copy of my post above, but has been complemented for Volumio 3 (steps 9 and 10). I have also added steps 11 and 12, because “xserver-xorg-input-evdev” is required for the calibration settings in “99-calibration.conf” to take effect.

  1. Install the Touch Display plugin.

  2. Download the display specific overlay:

wget https://github.com/goodtft/LCD-show/raw/master/usr/tft35a-overlay.dtb

  1. Copy the overlay to “/boot/overlays/tft35a.dtbo”:

sudo cp tft35a-overlay.dtb /boot/overlays/tft35a.dtbo

  1. Open “boot/userconfig.txt”:

nano /boot/userconfig.txt

  1. Add the following lines:
dtparam=spi=on
dtoverlay=tft35a

It could be necessary to add a rotation value to the overlay later on.

  1. Save “/boot/userconfig.txt” by typing Ctrl+x then y and Enter.

  2. Download “99-calibration.conf-35-0” as it might be necessary to calibrate the screen:

wget https://raw.githubusercontent.com/goodtft/LCD-show/master/usr/99-calibration.conf-35-0

  1. Create “/etc/X11/xorg.conf.d” in case it’s missing and copy “99-calibration.conf-35-0” to “/etc/X11/xorg.conf.d/99-calibration.conf”:

sudo mkdir -p /etc/X11/xorg.conf.d
sudo cp 99-calibration.conf-35-0 /etc/X11/xorg.conf.d/99-calibration.conf

  1. Download “99-fbturbo.conf” with

sudo wget https://raw.githubusercontent.com/waveshare/LCD-show/master/usr/share/X11/xorg.conf.d/99-fbturbo.conf -P /usr/share/X11/xorg.conf.d

  1. Change the driver setting in “99-fbturbo.conf” from “fbturbo” to “fbdev”:

sudo sed 's/"fbturbo"/"fbdev"/' -i /usr/share/X11/xorg.conf.d/99-fbturbo.conf

  1. Install “xserver-xorg-input-evdev” by running

sudo apt-get -y install xserver-xorg-input-evdev

  1. After that execute

sudo cp /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf

  1. Reboot.

  2. If the display should not have the orientation you are looking for, add a rotation parameter to the overlay in “/boot/userconfig.txt” so it looks something like this:

dtoverlay=tft35a:rotate=90

This would rotate the display (not touch) by 90 degrees clockwise.

  1. Reboot once again.

  2. If the display rotation appears to be correct now, check if the touch function is already properly aligned to the display. If this should not the be case try to find out by what amount touch has to be rotated. Then head over to the Touch Display’s configuration page and set this value in the rotation setting.

  3. Reboot and check if touch is properly aligned to the display now. It is possible that setting the rotation in the prior step does not suffice. This would be the case if the screen’s touch axes are inverted or swapped which is not uncommon on these kind of screens… Then you would have to find out how the axes are inverted or swapped to be able to find a correction.

Edit: Corrected command in step 3.

3 Likes

Thank you in advance for your help

volumio@volumio2:~$ sudo cp tft35a.dtb /boot/overlays/tft35a.dtbo
[sudo] password for volumio:
cp: cannot stat ‘tft35a.dtb’: No such file or directory

Sorry, my bad. Command has to be:

sudo cp tft35a-overlay.dtb /boot/overlays/tft35a.dtbo

For future readers I have edited posts #165 and #275 accordingly.

Thank you thank you thank you :slight_smile: it works

I’m going to start again now. but the picture is already there :slight_smile: is it still possible to output the sound via hdmi or is there something getting in the way?

Can I make a backup somehow?

THANKs @gvolt

Don’t know, I don’t use HDMI audio out. Just try it. :wink:

You could make an image of the SD card, to have a backup of the whole system (see How can I create a backup of the Volumio SD card using Win32DiskImager?). But IMHO it doesn’t make too much sense if you know how to setup the display.

1 Like

Works perfectly for my display “waveshare 4inch RPi LCD (A)” , thanks a lot !!!

1 Like

Hey me again, now I’ve installed PeppyMeter and wanted to show it on the 3.5 display now it’s telling me something about

error: touch_display: Pointer config cannot be applied: Error: ENOENT: no such file or directory, stat ‘/tmp/.X11-unix/X0’

and /dev/

Pointer config cannot be applied: Error: ENOENT: no such file or directory, stat ‘/tmp/.X11-unix/X0’

In what concrete situation does the error message occur?

Is the UI displayed at your screen at all?

Is pointer visibility set to “on”? If so, does the error message disappear after setting it to “off”?

Please post the result of

cat /var/log/Xorg.0.log

volumio was displayed, everything was fine. then i installed peppymeter because i needed the 3.5 display for it. now the display is only black illuminated. the error comes when I want to activate the mouse pointer, for example, or play a song

result of
cat /var/log/Xorg.0.log
-------------- CLEARED LOG --------------

Do you have the PeppyMeter plugin enabled? If so, does the error also happen with the PeppyMeter plugin disabled?

I first brought volumio up to date (fresh installed) then I installed touch display peppymeter on it install. and then installed the 3.5…

Can I disable peppymeter with one command?

If you installed the PeppyMeter plugin you should be able to disable it. Otherwise I don’t know, because I neither know peppymeter well enough nor what installation steps you took. :man_shrugging:

Without knowing your Volumio version I imply you are using Volumio 3.x.

If you cannot exclude the possibility that your system could be messed up by earlier attempts to make the display work, I recommend to start with a fresh Volumio system, i.e. start from scratch. In that case make sure to wait some minutes after the first boot of Volumio so the data partition can fully expand. Otherwise you will not be able to install the Touch Display plugin because of too less space.

  1. Install the Touch Display plugin.

  2. Connect to Volumio via SSH.

  3. Execute

sudo curl -L https://raw.githubusercontent.com/goodtft/LCD-show/master/usr/99-calibration.conf-5-0 -o /etc/X11/xorg.conf.d/99-calibration.conf

sudo curl -L https://raw.githubusercontent.com/goodtft/LCD-show/master/usr/99-fbturbo.conf-HDMI -o /usr/share/X11/xorg.conf.d/99-fbturbo.conf

sudo sed 's/"fbturbo"/"fbdev"/' -i /usr/share/X11/xorg.conf.d/99-fbturbo.conf

sudo apt-get -y install xserver-xorg-input-evdev

sudo cp /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf

cat >> /boot/userconfig.txt <<EOL

dtparam=spi=on
config_hdmi_boost=7
hdmi_group=2
hdmi_mode=87
hdmi_drive=1
hdmi_cvt 800 480 60 6 0 0 0
dtoverlay=ads7846
dtparam=cs=1
dtparam=penirq=25
dtparam=penirq_pull=2
dtparam=speed=50000
dtparam=swapxy=0
dtparam=pmax=255
dtparam=xohms=150
dtparam=xmin=200
dtparam=xmax=3900
dtparam=ymin=200
dtparam=ymax=3900
EOL
  1. Reboot.

Yes, Volume version 3.198, the system is clean, only the Touch Display plugin is installed. Thank you, I will try.

@moderators I suggest moving posts 287 to 292 to a new thread as they do not involve a 3.5" SPI display. As a title I would suggest something like “Volumio with 5” HDMI display with resistive touch screen".

Yes, thank you, the screen is working. I haven’t figured out the axes of the touchscreen yet, but the screen reacts to clicks. In addition, there is an inversion of colors, the picture on the screen looks wrong. Tell me, please, is there an opportunity to fix this?

I suggest to enable the mouse pointer to be shown on the Touch Display plugin’s config page, so you you could easier determine if / how axes are inverted or swapped.

Could you post a picture please?

You could try adding

Option  "InvertX"       "1"
Option  "InvertY"       "1"

to “/etc/X11/xorg.conf.d/99-calibration.conf” so it would look like

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option  "Calibration"   "140 3951 261 3998"
        Option  "SwapAxes"      "0"
        Option  "InvertX"       "1"
        Option  "InvertY"       "1"
EndSection

Or, if there is a 180 degree rotation of the touch screen instead of an inversion of the axes, you might try another calibration file which should rotate touch by 180 degrees:

sudo curl -L https://raw.githubusercontent.com/goodtft/LCD-show/master/usr/99-calibration.conf-5-180 -o /etc/X11/xorg.conf.d/99-calibration.conf

Regarding the color issue: Try upping the amount of memory used for the GPU to e.g. 64MB. You find an option on the plugin’s config page to do so. If that should not help, you may play around with the value of the “config_hdmi_boost” setting in “/boot/userconfig.txt”. Increase or decrease the value (minimum is 0 and maximum 11).

Also make sure the display is supplied with sufficient power.

The touch worked correctly with such settings:
Option “SwapAxes” “1”
Option “InvertX” “1”
Option “InvertY” “1”
Thank you very much!