Skip to content

Waveshare 2.8

project-owner edited this page Jun 23, 2023 · 13 revisions

Overview

Here is the display description on the Waveshare web site. The display is available on Amazon.

waveshare-2.8

Disk Image Content

This disk image is based on the Headless Disk Image and has the following additional software and configuration:

  • Waveshare 2.8" LCD driver was installed and configured.
  • libts-bin library for touchscreen calibration.
  • Peppy Player was configured to work with GUI displayed in Waveshare LCD, Peppy Player splash screen was configured.

Installation and Configuration

Here are the steps which were used to create the Disk Image for the Waveshare 2.8" touchscreen.

Install the Headless Disk Image

  • Connect display to the GPIO connector.
  • Download the Headless Disk Image
  • Write downloaded disk image to 8GB MicroSD card.
  • Insert a MicroSD card to a Raspberry Pi, power on, login using putty.

Configure Peppy Player for display

Edit the player configuration file

nano Peppy/config.txt

Set parameters:

width = 320
height = 240
headless = False

Copy changed file to the defaults:

cp Peppy/config.txt Peppy/defaults/

Edit VU Meter screensaver configuration:

nano Peppy/screensaver/peppymeter/config.txt

Set property:

meter.size = small

Edit Spectrum Analyzer screensaver configuration:

nano Peppy/screensaver/spectrum/config.txt

Set property:

screen.size = small

Configure the touchscreen functionality

Install the display driver:

git clone https://github.com/waveshare/LCD-show.git
cd LCD-show/
./LCD28-show lite

The Pi will be rebooted during installation.
Create the rules file:

sudo nano /etc/udev/rules.d/95-ads7846.rules

with content:

SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{name}=="ADS7846 Touchscreen", SYMLINK+="input/touchscreen"

Install touchscreen library and reboot:

sudo apt-get install libts-bin
sudo reboot

Calibrate the touchscreen:

sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate

Install the Splash Screen

sudo apt-get install fbi
wget https://raw.githubusercontent.com/project-owner/Peppy.doc/master/files/splash.service

Edit the service file:

nano splash.service

change the line to:

ExecStart=/usr/bin/fbi -d /dev/fb1 --noverbose -a /home/pi/Peppy/splash/splash-320.png

Start splash service

sudo mv splash.service /etc/systemd/system
sudo systemctl enable splash
sudo systemctl start splash

Configure Audio

After display driver installation the system switches to HDMI audio. To switch back to the on-board audio run:

sudo raspi-config

Select System Options/Audio/Headphones.

Configure peppyalsa plugin

Change the audio card number from 0 (HDMI) to 1 (Headphones):

nano .asoundrc-equal-peppyalsa

Change the properties:

type hw card 0
...
slave.pcm "plughw:0,0"

to

type hw card 1
...
slave.pcm "plughw:1,0"

Switch to edited file and test audio:

cp .asoundrc-equal-peppyalsa .asoundrc
speaker-test -t wav

Restore the player startup (removed after display driver installation)

Edit the startup script:

sudo nano /etc/rc.local

Add the player startup command before the line exit 0:

su pi -c 'cd /home/pi/Peppy; openvt -s -- python3 peppy.py'

Remove console messages during booting

Edit the configuration file:

sudo nano /boot/cmdline.txt

Change parameter from:

fbcon=map:10

to

fbcon=map:2

Reboot / Test / Cleanup

sudo reboot

Test player functionality.
Cleanup:

rm -rf LCD-show/ .bash_history .wget-hsts
sudo poweroff