2018/03/11

Running Volumio 2 on a Raspberry Pi 2 model B with a 3.5" Touchscreen


I was pleasantly surprised with how well Volumio 2 runs out of the box on my old Raspberry Pi 2 model B using an external USB DAC (in my case, Behringer UCA222). As a next step, I wanted to add a small 3.5 inch display that connects to the 26 GPIO pins of my Pi 2 B.

The setup of the 3.5" LCD screen is a bit tougher than expected, but after a lot of googling and trial and error I got the LCD touchscreen fully working with Volumio 2. It seems like the same display is sold under different brands.

These are the steps to get the display working:
  • connect to your Raspberry Pi CLI through ssh (username: volumio; password: volumio) and execute the following commands
    • download the display driver:
      git clone https://github.com/goodtft/LCD-show
    • run these few commands (handpicked from the LCD35-show script -- do NOT run the script!):
      cd LCD-show/
      sudo mkdir /etc/X11/xorg.conf.d
      sudo cp ./usr/tft35a-overlay.dtb /boot/overlays/
      sudo cp ./usr/tft35a-overlay.dtb /boot/overlays/tft35a.dtbo
      sudo cp -rf ./usr/99-calibration.conf-35-90  /etc/X11/xorg.conf.d/99-calibration.conf
      sudo mkdir -p /usr/share/X11/xorg.conf.d/
      sudo cp -rf ./usr/99-fbturbo.conf  /usr/share/X11/xorg.conf.d/
    • modify the 99-calibration.conf file and add the Driver "evdev" option
      • sudo nano /etc/X11/xorg.conf.d/99-calibration.conf
      • the file should be:
        Section "InputClass"
          Identifier "calibration"
          MatchProduct "ADS7846 Touchscreen"
          Option "Calibration" "3936 227 268 3880"
          Option "SwapAxes" "1"
          Driver "evdev"
        EndSection
      • save the file (Control-X)
    • create a new /boot/userconfig.txt (2020-05 update: this file is automatically included in  /boot/config.txt by Volumio)
      • sudo nano /boot/userconfig.txt
      • add the single line:
        dtoverlay=tft35a
      • save the file (Control-X)
    • install missing packages:
      • sudo apt update
      • sudo apt install lightdm
      • sudo apt install xserver-xorg-input-evdev
    • fix the autologin user for lightdm (updated 2020-05)
      • sudo nano /etc/lightdm/lightdm.conf
      • modify the "autologin" user from "pi" to "volumio":
        autologin-user=volumio
      • save the file (Control-X)
After a reboot, everything works fine :). 



The final product is functional, but not perfect: the boot time takes a few minutes and chromium in kiosk mode is not very snappy. This might be a limitation of the older Raspberry Pi hardware. But as a simple display and for basic pause/play interaction, it works.

You can optionally disable the sleep mode and change the orientation of display in the Touch Display Plugin settings:


The "classic" layout (settings > appearance) seems to work out a bit cleaner on a small display:



References: