Waveshare 5.0 - project-owner/PeppyPlayers.doc GitHub Wiki
Here is the display description on the Waveshare web site. The display is available on Amazon.
This disk image is based on the Headless Disk Image and has the following additional software and configuration:
- Waveshare 5.0" 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.
Waveshare has several versions of 5" display. Despite the statement on their web site that all displays shipped after 2016 should have firmware version 2.1 I received display with firmware version 1.1. In this case driver installation is required. If you have display with firmware version 2.1 then more likely the touchscreen functionality will not be available with this disk image. Unfortunately it's not so easy to define the firmware version number for the particular display. The only way is to ask seller or switch the display on.
Here are the steps which were used to create the Disk Image for the Waveshare 5.0" touchscreen.
- 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.
Edit the player configuration file
nano Peppy/config.txt
Set parameters:
width = 800
height = 480
hdmi = True
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 = large
Edit Spectrum Analyzer screensaver configuration:
nano Peppy/screensaver/spectrum/config.txt
Set property:
screen.size = large
Edit the system configuration file:
sudo nano /boot/config.txt
Set the parameters:
max_usb_current=1
hdmi_group=2
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0
hdmi_drive=1
disable_splash=1
Install the display driver:
git clone https://github.com/waveshare/LCD-show.git
cd LCD-show/
./LCD5-show
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 (can be /dev/fb0):
sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate
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/fb0 --noverbose -a /home/pi/Peppy/splash/splash-800.png
Start service:
sudo mv splash.service /etc/systemd/system
sudo systemctl enable splash
sudo systemctl start splash
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.
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
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'
Edit the configuration file:
sudo nano /boot/cmdline.txt
Change parameter
fbcon=map:10
to
fbcon=map:2
sudo reboot
Test player functionality.
Cleanup:
sudo rm -rf LCD-show/ .bash_history .wget-hsts
sudo poweroff