I modeled a new case in Sketchup that accommodates the Pi 4B connectors, the fan, and a folding camera mast. The case also needed vents which I created in 3D text with the name of my big printer, X3REX. I blinged it up by turning the hole in the "R" into a D and I printed that in a contrasting color, just for fun. I also liked the idea of yellow and magenta, as if it's radioactive. Routing the fan wires to prevent them from hitting the fan took a few attempts and changes in the case design, but ultimately, I got them out of the way. The new case design is available on Tingiverse. I assembled everything and got ready for the software installation.
I chose to just download a system image from Octoprint.org as the basis for this project. Just follow the installation instructions on the Download page to create the bootable microSD card and configure the network. I put the SD card into the Pi and booted it up and was happy that no smoke came out. The Octoprint image is for a headless system, so there was just a login prompt on the display. I plugged in a keyboard and mouse, logged in, and moved on to install the PiTFT drivers. As I stated in the opening paragraph, it was much easier than it was 4 years ago. Since the operating system is already installed, you can jump down to the Installer script section of the Adafruit PiTFT Easy Install page. The installer walks you through display selection, screen rotation, and if you want to the console to appear on the PiTFT rather than HDMI output. If you mess this up, don't worry, just run the script again and choose the correct configuration.
Getting the tactile buttons to work was a whole different story since the Adafruit site doesn't have any information on this any longer. Fortunately, I had that in my earlier blog post, so I simply copied the python script and updated the /etc/rc.local file to run it at boot up. But it didn't work! I took a look at the file and saw that it was trying to execute os.system("sudo sh -c \"echo '0' > /sys/class/gpio/gpio508/value\""), which was not a valid command. I went back to the Adafruit site, digging deep into the PiTFT support documentation and found a page on Backlight Control. Here i found that turning on and off backlight was accomplished with sudo sh -c 'echo "1" > /sys/class/backlight/soc\:backlight/brightness' . I replaced the lines in my original python script with these lines, and button 3 on the PiTFT now switches the backlight on and off. Since the original power down script no longer worked, I edited button 1 in the python script to execute sudo halt. The new python script and instructions are available on my GitHub project.