Skip to content

TFT Installation Tips

CJeffyB edited this page Mar 26, 2018 · 3 revisions

From a base installation of OctoPi, various TFTs may have problems displaying the interface. (This may be due, in part, to the base OctoPi install having no X components at all.)

The steps I followed to get the Adafruit PiTFT Plus working were:

  1. Install the TFT with Adafruit's script:
> cd ~
> wget https://raw.githubusercontent.com/adafruit/Adafruit-PiTFT-Helper/master/adafruit-pitft-helper2.sh
> chmod +x adafruit-pitft-helper2.sh
> sudo ./adafruit-pitft-helper2.sh
* When asked if you want the console to appear on the PiTFT display, answer "yes".
  1. Install the prerequisites for OctoPrint-TFT:
> sudo apt install xserver-xorg
> sudo apt install xinit
> sudo apt install libgtk-3-0
> sudo apt install xserver-xorg-video-fbdev
* (These commands can be entered individually, or as a single `apt install`.)
* (The last item, `xserver-xorg-video-fbdev` was needed because OctoPrint does not include the required display driver.)
  1. Install OctoPrint-TFT:
> wget https://github.com/mcuadros/OctoPrint-TFT/releases/download/v0.1.2/octoprint-tft_0.1.2-1.jessie_armhf.deb
> sudo dpkg -i octoprint-tft_0.1.2-1.jessie_armhf.deb
  1. Create the X config file for the TFT:
> sudo nano /usr/share/X11/xorg.conf.d/99-pitft.conf
* Paste the following contents:
Section "Device"
Identifier "PiTFT"
Driver "fbdev"
Option "fbdev" "/dev/fb1"
EndSection
  1. Remove an old / incorrect config file:
> sudo mv /usr/share/X11/xorg.conf.d/99-fbturbo.conf ~
  1. Change the OctoPrint-TFT service to output to framebuffer 1, rather than 0:
> sudo nano /lib/systemd/system/octoprint-tft.service

and edit the command line from:

ExecStart=/usr/bin/xinit /usr/bin/OctoPrint-TFT -- :0 -nolisten tcp -nocursor

to

ExecStart=/usr/bin/xinit /usr/bin/OctoPrint-TFT -- :1 -nolisten tcp -nocursor
  1. Make sure things are linked properly:
> sudo ln -sf /lib/systemd/system/octoprint-tft.service /etc/systemd/system/display-manager.service
> systemctl set-default graphical.target
  1. Reboot and everything should work!

The above steps should also work for the Waveshare 3.5inch RPi LCD (A) 320×480 display, just be sure to replace the Adafruit install script in the first step with the driver from the Waveshare site.

Clone this wiki locally