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

So the Volumio UI does not start?

Please post the result of

cat /var/log/Xorg.0.log

when this happens.

I think volumio boot correctly, on the screen it displays I see:

Raspbian GNU/Linux 10 volumio tty1

Welcome to Volumio!
WebUI available at volumio.local
volumio login:
cat /var/log/Xorg.0.log`
volumio@volumio:~$ cat /var/log/Xorg.0.log
cat: /var/log/Xorg.0.log: No such file or directory
volumio@volumio:~$
volumio@volumio:~$
volumio@volumio:~$ cat /var/log/Xorg.0.log
[    45.686]
X.Org X Server 1.20.4
X Protocol Version 11, Revision 0
[    45.687] Build Operating System: Linux 5.4.0-72-generic armv8l Raspbian
[    45.687] Current Operating System: Linux volumio 5.10.90-v7+ #1512 SMP Thu Jan 13 16:32:54 GMT 2022 armv7l
[    45.688] Kernel command line: coherent_pool=1M 8250.nr_uarts=0 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=1016 bcm2708_fb.fbheight=1856 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  splash plymouth.ignore-serial-consoles dwc_otg.fiq_enable=1 dwc_otg.fiq_fsm_enable=1 dwc_otg.fiq_fsm_mask=0xF dwc_otg.nak_holdoff=1 quiet console=ttyS0,115200 console=tty1 imgpart=/dev/mmcblk0p2 imgfile=/volumio_current.sqsh rootwait bootdelay=5 elevator=noop logo.nologo vt.global_cursor_default=0 net.ifnames=0 snd-bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 loglevel=0
[    45.689] Build Date: 04 January 2022  10:05:34AM
[    45.689] xorg-server 2:1.20.4-1+rpt4+deb10u4 (https://www.debian.org/support)
[    45.689] Current version of pixman: 0.36.0
[    45.690]    Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
[    45.690] Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[    45.693] (==) Log file: "/var/log/Xorg.0.log", Time: Thu Jan 27 14:38:18 2022
[    45.702] (==) Using config directory: "/etc/X11/xorg.conf.d"
[    45.703] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[    45.710] (==) No Layout section.  Using the first Screen section.
[    45.710] (==) No screen section available. Using defaults.
[    45.710] (**) |-->Screen "Default Screen Section" (0)
[    45.710] (**) |   |-->Monitor "<default monitor>"
[    45.717] (==) No device specified for screen "Default Screen Section".
        Using the first device section listed.
[    45.717] (**) |   |-->Device "Allwinner A10/A13/A20 FBDEV"
[    45.717] (==) No monitor specified for screen "Default Screen Section".
        Using a default monitor configuration.
[    45.717] (==) Automatically adding devices
[    45.717] (==) Automatically enabling devices
[    45.717] (==) Automatically adding GPU devices
[    45.717] (==) Max clients allowed: 256, resource mask: 0x1fffff
[    45.718] (WW) The directory "/usr/share/fonts/X11/cyrillic" does not exist.
[    45.718]    Entry deleted from font path.
[    45.719] (==) FontPath set to:
        /usr/share/fonts/X11/misc,
        /usr/share/fonts/X11/100dpi/:unscaled,
        /usr/share/fonts/X11/75dpi/:unscaled,
        /usr/share/fonts/X11/Type1,
        /usr/share/fonts/X11/100dpi,
        /usr/share/fonts/X11/75dpi,
        built-ins
[    45.719] (==) ModulePath set to "/usr/lib/xorg/modules"
[    45.719] (II) The server relies on udev to provide the list of input devices.
        If no devices become available, reconfigure udev or disable AutoAddDevices.
[    45.719] (II) Loader magic: 0x1fdf80
[    45.719] (II) Module ABI versions:
[    45.719]    X.Org ANSI C Emulation: 0.4
[    45.719]    X.Org Video Driver: 24.0
[    45.719]    X.Org XInput driver : 24.1
[    45.719]    X.Org Server Extension : 10.0
[    45.722] (--) using VT number 2

[    45.722] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[    45.722] (II) no primary bus or device found
[    45.723] (II) LoadModule: "glx"
[    45.726] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[    45.795] (II) Module glx: vendor="X.Org Foundation"
[    45.795]    compiled for 1.20.4, module version = 1.0.0
[    45.795]    ABI class: X.Org Server Extension, version 10.0
[    45.795] (II) LoadModule: "fbdev"
[    45.797] (II) Loading /usr/lib/xorg/modules/drivers/fbdev_drv.so
[    45.800] (II) Module fbdev: vendor="X.Org Foundation"
[    45.800]    compiled for 1.20.3, module version = 0.5.0
[    45.800]    Module class: X.Org Video Driver
[    45.800]    ABI class: X.Org Video Driver, version 24.0
[    45.800] (II) FBDEV: driver for framebuffer: fbdev
[    45.802] (WW) Falling back to old probe method for fbdev
[    45.802] (II) Loading sub module "fbdevhw"
[    45.802] (II) LoadModule: "fbdevhw"
[    45.803] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[    45.805] (II) Module fbdevhw: vendor="X.Org Foundation"
[    45.805]    compiled for 1.20.4, module version = 0.0.2
[    45.805]    ABI class: X.Org Video Driver, version 24.0
[    45.805] (EE) open /dev/fb1: No such file or directory
[    45.805] (WW) Falling back to old probe method for fbdev
[    45.805] (II) Loading sub module "fbdevhw"
[    45.805] (II) LoadModule: "fbdevhw"
[    45.806] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
[    45.806] (II) Module fbdevhw: vendor="X.Org Foundation"
[    45.806]    compiled for 1.20.4, module version = 0.0.2
[    45.806]    ABI class: X.Org Video Driver, version 24.0
[    45.806] (EE) open /dev/fb1: No such file or directory
[    45.806] (EE) No devices detected.
[    45.806] (EE)
Fatal server error:
[    45.806] (EE) no screens found(EE)
[    45.806] (EE)
Please consult the The X.Org Foundation support
         at http://wiki.x.org
 for help.
[    45.806] (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional information.
[    45.806] (EE)
[    45.809] (EE) Server terminated with error (1). Closing log file.

Now please post the output of

ls -al /etc/X11/xorg.conf.d

ls -al /usr/share/X11/xorg.conf.d

and

ls -al /dev/fb*

ls -al /etc/X11/xorg.conf.d

-rw-r--r-- 1 root root  375 Jan 27 14:38 95-touch_display-plugin.conf
-rw-r--r-- 1 root root  204 Jan 27 14:29 99-calibration.conf
-rw-r--r-- 1 root root  151 Jan 27 14:14 99-swapxy.conf.old
-rw-r--r-- 1 root root  151 Jan 27 13:43 99-swapxy.conf.sav

ls -al /usr/share/X11/xorg.conf.d

-rw-r--r-- 1 root root   92 Feb  7  2019 10-amdgpu.conf
-rw-r--r-- 1 root root 1099 Aug 23  2018 10-evdev.conf
-rw-r--r-- 1 root root 1350 Jan  4 10:05 10-quirks.conf
-rw-r--r-- 1 root root   92 Apr  6  2019 10-radeon.conf
-rw-r--r-- 1 root root 1429 Mar 31  2019 40-libinput.conf
-rw-r--r-- 1 root root 1099 Jan 27 13:26 45-evdev.conf
-rw-r--r-- 1 root root 2747 Jun 26  2017 70-wacom.conf
-rw-r--r-- 1 root root  607 Jan 27 01:05 99-fbturbo.conf

ls -al /dev/fb*

crw-rw---- 1 root video 29, 0 Jan 27 14:37 /dev/fb0

It seems your display uses fb0 (which is puzzling me). So open “/usr/share/X11/xorg.conf.d/99-fbturbo.conf” with

sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf

and change

Option "fbdev" "/dev/fb1"

to

Option "fbdev" "/dev/fb0"

It works, thank you :wink:
It was probably due to the fact the I have my hdmi plug connected to a screen at the same time… :woozy_face: If I remove the hdmi plug I can stay with Option "fbdev" "/dev/fb1" sorry about that.

So have to edit my first post to simplify it with the details that you give me.

Last question (I hope :yum: ) more to know than a real necessity : how to find the best values for calibration ? I tried xinput_calibrator but the values are less good than something like Option "Calibration" "268 3880 227 3936"

Yes, that’s the reason… :grimacing:

I have no screen like yours and did never use “xinput_calibrate”, so ATM I have no idea why the values you get from “xinput_calibrate” are leading to a worse result.

Your values are from the goodtft github repo I think. What’s the brand and model name of your screen?

This is this cheap screen from Aliexpress.

When I look at the bottom I see this resistor called “LED_FUNCTION”… :thinking:
Now I’m asking myself if someone has managed backlight on these screens… Could be useful to switch off when Volumio goes in screensaver mode.

“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