Wave share and volumio

Hi folks,
I managed to install and calibrate the 5’ waveshare display on my Pi, with the Web-UI working perfectly. It took some trial and error, but the main steps to success were:

(Prerequisites:
Raspberry Pi 3B
volumio-2.502-2018-10-31-pi.img
waveshare 5’ resistive Touch HDMI-Display (Art.No.:10563)
The User Name for Volumio: root - - - Password: volumio
The User Name for lxde Desktop: volumio - - - Password: volumio)

sudo apt-get install -y lxde xserver-xorg - - - install Openbox Display Manager to receive a platform for calibration of the touch
Edit this file: /boot/config.txt for the Display and correct resolution:
hdmi_group=2
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0
hdmi_drive=1

Extract “xinput-calibrator…armhf” from the LCD-show-file from waveshare website

Install on Pi via Terminal: sudo dpkg -i xinput-calibrator_0.7.5-1_armhf.deb

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

sudo mkdir /etc/X11/xorg.conf.d/

sudo nano /usr/share/X11/xorg.conf.d/90-calibration.conf

put inside this newly created file:

Section „InputClass“
Identifier “calibration“
MatchProduct “ADS7846 Touchscreen“
Option “Calibration“ “170 3900 170 3900“
Option „SwapAxes“ “0“
EndSection

Add this line to the /boot/config.txt - file:
dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900

If everything is done right, you will have a menu-entry for the calibration on your Openbox-Desktop-Manager:
Menu/Preferences/Calibrate Touchscreen.

After that, make login to Openbox automatically (if you don’t want to confirm Password at every boot):

Edit the following file: /etc/lightdm/lightdm.conf
Find the entries beginning with:
[SeatDefaults]
#type=xlocal
#xdg-seat=seat0

Here you edit/uncomment this two lines to the following content:
autologin-user=volumio
autologin-user-timeout=0

AFTER that all: connect to volumio-Pi by browser (“volumio.local” or IP-adress)
Gear wheel / Plugins / Miscellanea / Display-Plugin - Install.

When you are all done, a restart will at first open the Openbox DM, and around 20 secs. later the Volumio GUI will appear and There you are!
Have Fun!
Armin

1 Like

Hi

This USED to work but I tried it now and for some reason it does no longer work… Did already try the CP change with different filename but for some reason this Linux-dummie cant get it nailed. Any help appreciated.

I assumed to get it working the ONLY real thing needed is the waveshare35a overlay file in the subdir and the config.txt file adapted like:
sudo cp waveshare-dtoverlays/waveshare35a-overlay.dtb /boot/overlays/waveshare35a.dtbo
echo dtoverlay=waveshare35a >> /boot/config.txt

That’s done. But this time I keep having a white screen… very weird. Do I forget anything?

cheers
Piet

Guys I could make it work using

dtoverlay=waveshare35a:rotate=0

as described above.
But as predicted, it needs calibration.
I could run the calibration program as following:

sudo su - apt install xinput_calibrator systemctl stop volumio-kiosk.service xinit /etc/X11/Xsession -- /etc/X11/xinit/xserverrc :0 & DISPLAY=:0 export DISPLAY xinput_calibrator -v
here I did the calibration and it returned:

copy the snippet below into '/etc/X11/xorg.conf.d/99-calibration.conf' (/usr/share/X11/xorg.conf.d/ in some distro's) Section "InputClass" Identifier "calibration" MatchProduct "ADS7846 Touchscreen" Option "MinX" "3857" Option "MaxX" "62292" Option "MinY" "3664" Option "MaxY" "63373" Option "SwapXY" "0" # unless it was already set to 1 Option "InvertX" "0" # unless it was already set Option "InvertY" "0" # unless it was already set EndSection

so I did:

[code]cat << eom > /usr/share/X11/xorg.conf.d/99-calibration.conf

Section “InputClass”
Identifier “calibration”
MatchProduct “ADS7846 Touchscreen”
Option “MinX” “3857”
Option “MaxX” “62292”
Option “MinY” “3664”
Option “MaxY” “63373”
Option “SwapXY” “0” # unless it was already set to 1
Option “InvertX” “0” # unless it was already set
Option “InvertY” “0” # unless it was already set
EndSection
eom
[/code]

and restarted everything…
But it ignores the calibration…

What am I doing wrong? :cry:

Hi !
It’s my 1st post here.
Want to say hello!

As i bought the Waveshare 3,5A [v4 ] display, and had it attached to RPI3B, Volumio was an obvious solution for media playing :slight_smile:
Volumio2 V 2.673
Steps to be covered, please note the order is important !
@ashthespy big thank you for pinting the direction !

HOWEVER
I had to amend the /boot/config.txt as well, it now looks as below:

initramfs volumio.initrd gpu_mem=64 max_usb_current=1 dtparam=audio=on dtparam=spi=on dtoverlay=waveshare35a:rotate=90 audio_pwm_mode=2 dtparam=i2c_arm=on disable_splash=1 hdmi_force_hotplug=0

Note the order, as adding dtoverlay at the bottom did not work for me.

As for calibration, I used provided here one:

Njoy your displays !

I got the touch capabilities of a Waveshare 5inch HDMI LCD (this one: waveshare.com/wiki/5inch_HDMI_LCD) to work with a Raspberry Pi 3B (and a HiFiBery Amp2, btw).

After trying for hours by adding and editing config files in /etc/X11/xorg.conf.d/, like people suggested on the forum, I solved the problem more or less by accident, after several reflashes of the sd card and trying all over again. It turns out I didn’t have to edit any xorg config files…

This is what I did:

  • Flash the sd card with the Volumio image.
  • Before removing the card from the computer, first edit /boot/userconfig.txt and add the lines

hdmi_group=2 hdmi_mode=87 hdmi_cvt 800 480 60 6 0 0 0 hdmi_drive=1 dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900

  • Boot the Pi from the sd card and install the Touch Display plugin in Volumio (current version is 1.1.4)
  • I can’t really recall if I needed to reboot the Pi, but the touchscreen works now :smiley:

Maybe the order of doing things (first the settings in /boot/userconfig.txt and only after that installing the plugin) did the trick…?

Hello. And Bye.

Hi everybody, hi piotr,

I tried the instructions from piotr, and after this step:

The screen works fine.
Then I did the two remaining steps (modify /boot/config.txt and /usr/share/X11/xorg.conf.d/99-callibration.conf)
However after a reboot i’m stuck at the command line “volumio login:” screen.
What am I doing wrong? Shouldn’t the touch display plugin manage the autologin?

Thanks for your help!

Hi notrash,

please check from a browser running on another device (mobile, PC…) if the touch display plugin is enabled. If that should be the case disable and reenable it and watch for error messages.

You may also connect to Volumio via SSH and check for the status of volumio-kiosk.service by executing systemctl status -l volumio-kiosk.service Please post the result.

As you wrote that the screen already worked fine before you modified /boot/config.txt and 99-calibration.conf: What was the purpose of these modifications then? What happens if you revert them?

Do you have the same screen as piotr re. are you sure you use the correct overlay for your screen?

Hi gvolt, thanks for the quick reply.

Disabling and re-enabling the plugin leads to the error message:

systemctl status -l volumio-kiosk.service

shows:

plugin off:

● volumio-kiosk.service - Volumio Kiosk Loaded: loaded (/lib/systemd/system/volumio-kiosk.service; disabled) Active: inactive (dead)
plugin on:

[code]● volumio-kiosk.service - Volumio Kiosk
Loaded: loaded (/lib/systemd/system/volumio-kiosk.service; disabled)
Active: failed (Result: exit-code) since Tue 2020-05-05 17:01:12 UTC; 32s ago
Process: 1388 ExecStart=/usr/bin/startx /etc/X11/Xsession /opt/volumiokiosk.sh – -nocursor (code=exited, status=1/FAILURE)
Main PID: 1388 (code=exited, status=1/FAILURE)

May 05 17:00:58 volumio startx[1388]: at http://wiki.x.org
May 05 17:00:58 volumio startx[1388]: for help.
May 05 17:00:58 volumio startx[1388]: (EE) Please also check the log file at “/var/log/Xorg.0.log” for additional information.
May 05 17:00:58 volumio startx[1388]: (EE)
May 05 17:00:58 volumio startx[1388]: (EE) Server terminated with error (1). Closing log file.
May 05 17:01:12 volumio startx[1388]: xinit: giving up
May 05 17:01:12 volumio startx[1388]: xinit: unable to connect to X server: Cannot assign requested address
May 05 17:01:12 volumio startx[1388]: xinit: server error
May 05 17:01:12 volumio systemd[1]: volumio-kiosk.service: main process exited, code=exited, status=1/FAILURE
May 05 17:01:12 volumio systemd[1]: Unit volumio-kiosk.service entered failed state.[/code]

What I meant with ‘screen worked’ was that I could see the volumio interface. Calibration was wrong - so i thought I needed the two following steps.

I have a slight different screen than piotr: “Waveshare 3.5inch RPi LCD (B) v2”
so I modified the steps accordingly:

cd ~ git clone https://github.com/swkim01/waveshare-dtoverlays sudo cp waveshare-dtoverlays/waveshare35b-v2.dtbo /boot/overlays/waveshare35b-v2.dtbo echo dtoverlay=waveshare35b-v2 >> /boot/config.txt sudo reboot
-> Install the touch_display plugin and enable it from the webUI.

sudo systemctl stop volumio-kiosk.service sudo sed -i "s+/dev/fb0+/dev/fb1+" /usr/share/X11/xorg.conf.d/99-fbturbo.conf cat /usr/share/X11/xorg.conf.d/99-fbturbo.conf sudo systemctl start volumio-kiosk.service

[code]sudo nano /boot/config.txt

initramfs volumio.initrd
gpu_mem=64
max_usb_current=1
dtparam=audio=on
dtparam=spi=on
dtoverlay=waveshare35b-v2:rotate=90
audio_pwm_mode=2
dtparam=i2c_arm=on
disable_splash=1
hdmi_force_hotplug=0[/code]

[code]sudo nano /usr/share/X11/xorg.conf.d/99-callibration.conf

Section “InputClass”
Identifier “calibration”
MatchProduct “ADS7846 Touchscreen”
Option “TransformationMatrix” “0 -1 1 1 0 0 0 0 1”
Option “SwapAxes” “0”
EndSection[/code]

Ok, the Xserver fails to start which also leads to the error message you saw on enabling the plugin.

Could you please show the result of ls -al /tmp/.X11-unix

total 0 drwxrwxrwt 2 root root 40 May 5 17:00 . drwxrwxrwt 11 root root 400 May 5 17:01 ..

I just tried to find out if your display needs the modification of 99-fbturbo.conf which changed the framebuffer from fb0 to fb1. I did not find the information right now, but you may try reverting that change nonetheless.

:astonished: that worked
Thank you so much!

[code]Section “Device”
Identifier “Allwinner A10/A13 FBDEV”
Driver “fbturbo”
Option “fbdev” “/dev/fb0”

    Option          "SwapbuffersWait" "true"

EndSection[/code]

[code]ls -al /tmp/.X11-unix

total 0
drwxrwxrwt 2 root root 60 May 5 18:34 .
drwxrwxrwt 12 root root 420 May 5 18:34 …
srwxrwxrwx 1 root root 0 May 5 18:34 X0[/code]

:smiley:

My pleasure!

Is there any way to modify the GUI to fit small screens better? (e.g. scaling, smaller symbols)
I found some css tweaks - but they don’t work.

Did you already find these tweaks? I did not try them myself so I can’t comment on them.

Be aware that modifying those .css files will have the effect that system updates would not work anymore. You would have to delete userdata to be able to update and then apply the changes again.

I found a description how to use the chrome kiosk scaling to fit the GUI better to small screens here

I just did a fresh install (volumio-2.779) and followed all the steps as described in my post above.

However - no matter what i change in “/usr/share/X11/xorg.conf.d/99-calibration.conf” - it has no effect to my touchscreen.
Was there some recent change to volumio or the touch plugin? This worked before.
My touch is still 90° rotated with respect to the screen.

What post are you referring to and what are you trying to achieve / what is not working? Scaling?

Depends what changes respectively possible effects of changes you have in mind :wink: The last version of the plugin is 1.1.8 and has already been published on May 25, version 1.1.7 had been published on Mar 7. The changes from 1.1.7 to 1.1.8 were not related to scaling or calibration. What version of the plugin have you been using before the fresh install (I assume you are now using version 1.1.8)?

Hi,
thanks for the reply. I refer to the posts from 5th of may.

I just tried to make a fresh install of volumio and set up the touch plugin. But I can’t get the touch input to match the screen (GUI). Whatever I do in “99-calibration.conf” has no effect.
I’m now using 1.1.8 and from the dates I assume I used 1.1.7 before the fresh install.
Was there any change on how/where to handle the “TransformationMatrix”?