Getting OctoPi 0.16 TouchUI to run on Adafruit PiTFT



If you have a 3D printer, you probably have discovered how useful the Octoprint software is. You can view, monitor and control your print jobs remotely from your home, office or around the world via a web browser. I use my garage as my workshop, and I keep my MonoPrice Mini Select 3D printer there, checking on print jobs from the office in my house. Using Octoprint saves a lot of steps.

Besides controlling the printer remotely, you can also install a display on the host raspberry pi. If you install the Octoprint plugin TouchUI, you can set up a touch-screen display to monitor and control your printer while standing next to it. Very convenient!

I had an OctoPi/Octoprint server that I installed on my 3D printer circa 2017. Since that version was based on Raspbian Jessie, and the latest Raspbian is now Buster, it cried out for an update to the latest OctoPi. Currently, that's version 0.16 based on Raspbian Stretch Lite.

Note: The information in this article is current as of September 9, 2019.

There are a lot of recipes, using various models of 3.5 inch TFT displays, on how to install a fresh copy of OctoPi, the purpose-built SD card image for Octoprint, and set up TouchUI for a TFT. This post is specifically about using the Adafruit PiTFT 3.5 inch Resistive Touch (PiTFT) display. When originally building this in 2017, I used the Adafruit Learning Guide: 3.5" PiTFT OctoPrint Rig. That was originally published in 2016 and... software keeps changing. Thus the need for this post.

Also note that you can install OctoPi and TouchUI on a raspberry pi without a display, and it will still be useful. In that case, you can use a phone or tablet to bring up the Octoprint web page and toggle TouchUI active. Just stop after installing the TouchUI, in the steps below, and reboot. You may have to toggle TouchUI as active, using an icon in the upper-right of the web page.

I'm detailing the steps that worked for me to get a TouchUI working on the PiTFT. If you are using another 3.5inch resistive touch screen, like WaveShare or Elecrow, look elsewhere for how to set it up. Plastibots.com has a set of instructions for the Elecrow, a cheaper alternative to the PiTFT.

Here we go!
  • Download OctoPi and follow the instructions on the download page to get going.
    • Make sure you have set up a working instance of Octoprint (connect to your Octoprint server from a web browser) before installing the ToucUI plugin
    • You'll need basic information on your printer to set up a profile for it in Octoprint
  • Do sudo apt-get update to make sure you have all the latest packages
  • Follow the instuctions on the github for Billy Blaze to copy & manually install the TouchUI from the supplied URL
    • From the Octoprint/Tools, Click on Plugin Manager; scroll down to click on "Get More" and on the next window paste in the URL and click Install. 
  • Next, I found out I needed to run a command from this page that was marked DEPRECATED
    • #4 Install all required packages:
    •  sudo apt-get install --no-install-recommends xinit xinput xserver-xorg xserver-xorg-video-fbdev x11-xserver-utils matchbox unclutter chromium-browser  
     
Run the Easy Install from Adafruit:

  • I used the following parameters:  
      • Configuration: #4 - PiTFT 3.5" resistive touch (320x480)
      • Rotation: #3 270 degrees (landscape)
        • This will orient the screen so the USB-Micro power jack is on top, when the rig is standing vertically in a 3D printed case
      • Would you like the console to appear on the PiTFT display? [y/n] - n
      • say Yes to the question: Would you like the HDMI display to mirror to the PiTFT display?
  • Follow the instructions from Adafruit HELP/FAQ
    • My PiTFT's rotation/calibration isn't working in X11:

    •  sudo apt-get install xserver-xorg-input-evdev  
      
    • if you do have a 40-libinput.conf in that same directory, you must remove it even if/once evdev is installed, since it will override the 10-evdev.conf otherwise
  • Follow the Billy Blaze instructions to Boot to Browser
  • Follow the Billy Blaze Troubleshooting instructions to calibrate the screen for X
 su $TOUCHUI_USER -c "xinput set-prop 'stmpe-ts' 'Coordinate Transformation Matrix' 0 -1 1 1 0 0 0 0 1"  
Usage Tip:
Since the screen is so small, I found it a little tricky to touch-select icons displayed from TouchUI. Use a stylus, the smaller the tip the better. Position the stylus point on the exact center of the icon, such as the camera or temperature. A little practice, and you'll eventually get the hang of it.

This Targus Stylus worked well for me.




Comments

Popular Posts