0. Install DietPi
Set up internet connection.
1. Activate LCD:
dietpi-config
select “1 : Display Options”
select “3 : LCD Panel addon”
select “waveshare32”
exit and reboot
2. Setup Waveshare driver
(git can also be installed using dietpi-software)
sudo apt install git
git clone https://github.com/waveshare/LCD-show.git
cd LCD-show/
sudo ./LCD35-show
wait for reboot
3. Check /boot/config.txt
sudo nano /DietPi/config.txt
Make these changes if needed (I didn’t need to):
change “framebuffer_width=320” to “framebuffer_width=480”
change “framebuffer_height=240” to “framebuffer_height=320”
change “dtoverlay=waveshare32” to “dtoverlay=waveshare35a”
sudo reboot
4. Install fbturbo
sudo apt install xserver-xorg-video-fbturbo
5. Remove fbturbo config
This should be done after every time LCD35-show is executed:
mv /usr/share/X11/xorg.conf.d/99-fbturbo.conf /usr/share/X11/xorg.conf.d/99-fbturbo.~~
6. Install LXDE
Using dietpi-software
utility.
now sudo startx
should display the LXDE desktop.
7. autostart
sudo dietpi-autostart
Set it to: 2: Automatic login
(First I set it to 16-LightDM login mask, but didn’t work. Although I suspect it made some useful changes)
If needed: Calibrate Touch
Click the “Menu” button on the taskbar, and choose “Preference” → “Calibrate Touchscreen”.
Finish the touch calibration following the prompts.
Copy the given config and write to:
sudo nano /etc/X11/xorg.conf.d/99-waveshare32_calibration.conf
Backlight Control
Type A LCD has no extra pads or pins to control the backlight. There is a hack to cut some traces and add some wires
[Waveshare 3.5" LCD hack for backlight control · pskowronek/home-air-quality-and-assistant Wiki · GitHub]
For now, I didn’t need to automatically control the brightness. Just soldering a 1k pot did the job for me.
Sources
Other than this post, here are what I read and used to make things work, some may not be directly related:
[https://www.waveshare.com/wiki/3.5inch_RPi_LCD_(A)_Manual_Configuration]
[HiR Information Report: Small TFT displays for Kali on the Raspberry Pi]
[3.5inch RPi LCD (A) Manual Configuration - Waveshare Wiki ]
[HiR Information Report: Small TFT displays for Kali on the Raspberry Pi]