I picked up this cheap screen on Ebay with case and heatsink for $20. I spent hours trying to get this to work. I probably failed at least 30 times before I got this to go. I put this document together to help other people out and help me remember in case I have to go back and reinstall Octoprint. I picked up bits from the internet until I got something to work. The drivers from goodtft and waveshare will crash raspbian buster. The drivers are built in and you don’t to install the manufacturer drivers.
First of all enable SPI by using the terminal command:
Navigate to ‘Advanced options’ and then enable SPI
Reboot if needed through the command in the terminal:
The touch screen should turn on and be white colored.
If your still running the Buster beta upgrade to the latest stable kernel
apt-get update –allow-releaseinfo-change
Give the following command to update and upgrade Raspian:
sudo apt-get update
sudo apt-get upgrade
Now to modify the configuration file to configure the display
sudo nano /boot/config.txt
then add this line to the bottom
give Ctrl+X, Y, and Enter. (This saves the file)
Give the command:
Unplug your HDMI cable if you have it plugged in
You now see Linux booting up on the 3.5 inch touch screen.
Log into you Octoprint and install the touch UI plugin. Run the following command to install X and touch screen auto login/boot into touch mode
git clone https://github.com/BillyBlaze/OctoPrint-TouchUI-autostart.git ~/TouchUI-autostart/
You should now see Octoprint fire up and go into touch screen mode
At this point your Octoprint should be loaded but your mouse and touch screen will probably be moving backwards. In the newer (Jessi, Buster) versions of Raspbian they changed input control from
evdev to libinput. You need to install evdev or it will ignore your
sudo apt-get install xserver-xorg-input-evdev
You can now modify your 99-calibration.conf file
sudo nano /usr/share/X11/xorg.conf.d/99-calibration.conf
Copy and past below
MatchProduct “ADS7846 Touchscreen”
Option “Calibration” “3936 227 268 3880”
Option “InvertY” “true”
Option “InvertX” “false”
Save and reboot
Your Raspberry Pi 4 should come up now. Touchscreen should be working in the right direction.