I made the mistake of buying a cheap 3.5in 480x320 TFT display from a Chinese retailer. its unbranded, customer service is awful, no software was sent with it. I was sent a file in Chinese that was supposedly the driver. it never could fully download. the connection always timed out it took so long. ive looked into the Waveshare driver but unsure if it would work or not. any ideas? image is attached.
I've bought the same display. Here are my successful attempts to make it work on a RaspberryPi 3 B+ running Raspbian Stretch.
1. First attempt, involving specific device tree specification and configuration overwriting
From XPT2046 Touch Screen instructions for Raspbery Pi 3 thread, I found a GitHub repository with working configurations for several screens and useful instructions: goodtft/LCD-show.
Clone the repo onto the RaspberryPi:
git clone https://github.com/goodtft/LCD-show.git
Run config file specific to that screen:
cd LCD-show chmod +x LCD35-show sudo ./LCD35-show
Let the RaspberryPi automatically reboot.
2. Second attempt, with out-of-the-box device tree spec and manual configuration editing
From How to configure a 3.5 inch 320x480 pixel touchscreen for Raspberry Pi PDF document and PiScreen Driver Install Instructions from ozzmaker.com, I got the screen working without installing anything:
At the end of
/boot/config.txt, add the following line:
At the end of the line in
/boot/cmdline.txt, add the following characters (ellipsis marks the line and shall not be inserted, but the comma shall):
Option "fbdev" "/dev/fb1"
/usr/share/X11/xorg.conf.dcreate a new file
Section "InputClass" Identifier "calibration" MatchProduct "ADS7846 Touchscreen" Option "TransformationMatrix" "1 0 0 0 -1 1 0 0 1" EndSection
If you are editing from your Pi, reboot.
I only wanted it for showing my terminal, so I found a great article that also happens to do this, without installing any new drivers.
Key information: This device's controller is an ILI9486, which is compatible with ILI9481. The driver for ILI9481 was already in my Raspberry Pi. Here's what I did to make it work:
sudo modprobe --first-time fbtft_device name=ili9481 debug=1 rotate=270 bgr=1 con2fbmap 1 1
The first command loads the ILI9481 driver as an Frame Buffer for Small LCD TFT device (fbtft) and rotates it 270 degrees.
The second command sets the console (tty1) to map its output to the framebuffer (buffer 1). That's why the parameters are
1 1. You can map any tty to the LCD.
I don't care about the touch-screen, so I didn't set it up. All I need this is to show me the IP address of the Raspberry Pi so I can connect through SSH. (This is an issue you may encounter only if you find your RPi connecting to WiFi where you cannot control the IP address assignments and with ridiculously short lease times.)