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

“LED_FUNCTION” could be just backlight on/off or PWM control. The PCB looks like a Kedei 3.5" display, but documentation is… sparse. :wink:

OK, I place the resistor to “ON” on “LED_FUNCTION” , now it allow to control backlight , I follow the trace and it can be controlled with GPIO 22 (which correspond to wiringpi pin number 3).

I’m now able to switch on and off the screen with gpio mode 3 out and then gpio write 3 1 or gpio write 3 0

But I’m not able to manage it with PWM , I tried something like this without success :

gpio -g mode 22 pwm      #Set the pin as PWM
gpio pwmc 100   
gpio -g pwm 22 0         #Set the brightness to dimmest
gpio -g pwm 22 1023      #Set the brightness to the brightest
gpio -g mode 22 out      #Clean the pin

My pwm commands seems to haven’t any effect, I don’t know why…
All GPIO of the RPI 3 are pwm capable ?

Not a big deal if I can’t dimmer the screen , how can I trigger the switch off of the screen at screensaver timeout (in touch display plugin) ?

I think GPIO 22 is not prepared for PWM, see PWM at Raspberry Pi GPIO Pinout.

As the display is using GPIO 22 for “LED_FUNCTION” it also probably has only the capability to switch the backlight on and off.

Possibly it is not necessary to control the backlight via GPIO. The Touch Display plugin uses DPMS to switch off the display as a screensaver. If the display should be DPMS compliant this would already switch off its backlight, too. Does the backlight of your display stay on after the screensaver timeout (set via the Touch Display plugin) has expired?

Now it is dimmable by PWM :laughing: :
image

I don’t think that this SPI screen is DPMS compliant… No it never switch off backlight even when Touch Display Plugin screensaver is activated.

In fact I just need to ON/OFF the screen so I found the plugin “gpio control” it was almost perfect to switch off my screen with my GPIO but it doesn’t work anymore with Volumio 3 :cry:

Is there a way to trigger a command line, a script or something when player stop/start on Volumio 3 ?

May be I could modify “touch_display/index.js” to execute my gpio write 3 0 when screensaver is activated… :thinking:

I would refrain from “hacking” the Touch Display plugin, but think the cleaner solution would be to use the gpio control plugin. I have not used that plugin, but saw it fails to start only because the npm module “onoff” is missing. I will reply to this issue in the thread https://community.volumio.com/t/plugin-gpio-control-control-gpio-with-volumio2-events.

Awesome, gpio control is now working on Volumio 3 thanks to you.I was considering switching to Volumio 2 :sweat_smile:

For the challenge (and also because it could be the best experience), I’ll try to hack Touch Display plugin too :japanese_ogre: I post it on the right thread.

Hey,

i’m from germany, unfortunately my english isn’t the best, i have a pi4 and a 3.5 lcd but i can’t get it to work, i’m also new to raspberry can someone help me

Hi toxedo welcome,

Please post all the info of your pi and 3.5 lcd versions brand ect.
and version of volumio this is needed to be able to help you with it.
ask @gvolt to help you with this.

best regards,
dvo

1 Like

Hey @gvolt and thanks @dvo

Display 3.5LCD 480x320pixel XPT2046 ------ works on other systems

Volumio 3.198 on PI4

Plugin Touch Display 3.3.1

SSH is running and /dev/

i used the instructions above but after 3-4 commands i saw that he doesn’t want to create . Unfortunately, my knowledge is no longer sufficient

1 Like

What’s the brand and exact model name of your screen?

If you can’t identify it, post a picture of the display’s PCB.

You may use DeepL or Google translate :wink:

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 --------------