Setting up Adafruit 3.5" TFT w/ Repetier Server

After trying to setup Octoprint with a plugin called Octoprint TFT where you can control everything from a small touchscreen I realized the amount of aspirin needed to resurrect that plugin wasn't going to go well. One of the members of the Prusa group I admin mentioned that it's easier and works better on Repetier Server.

Easier??? NO. Better? YES!

Documentation was impossible to find to properly make this work even though I found a forum post here that described setting up a different brand screen then finding others having the same issues I was having but the issue not being resolved. 

Spent the better part of 3-4 hours setting it up using what I learned from the Octoprint plugin and viola a tiny Repetier Server that I can control from the front of my printer. 



Step 1: Install latest RPi version of Repetier Server following normal directions
Step 2: Edit config.txt file 

Edit Config.txt file on Boot

Change LCD rotate to 0

lcd_rotate=0


Scroll to this section and make these changes, uncomment 3 lines and single line addition

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
dtparam=i2s=on
dtparam=spi=on
dtoverlay=pitft35-resistive,rotate=90,speed=20000000,fps=20

Save txt file

Step 3: Eject MicroSD card and load up the PI as normal
Step 4: Setup Repetier Server via web interface
Step 5: SSH into your pi

Step 6: Expand the filesystem

sudo raspi-config

Select: 7 Advanced Options => A1 Expand Filesystem

Reboot

Step 7: Install Adafruit Drivers


chmod +x adafruit-pitft.sh

sudo ./adafruit-pitft.sh

Option 4 (rotated 90 degrees)
Option 1
Yes

Reboot

Step 8: Modify screen config

sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf

Add the following

Section "Device"

Identifier "adafruitTFT"

Driver     "fbdev"

Option     "fbdev" "/dev/fb1"

EndSection

^x
Y

Step 9: Set Screen Size

sudo nano /usr/share/X11/xorg.conf.d/40-libinput.conf

I added Option "TransformationMatrix" "0 1 0 -1 0 1 0 0 1" in InputClass section dedicated to touchscreens

Section "InputClass"
        Identifier "libinput touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
        Option "TransformationMatrix" "0 1 0 -1 0 1 0 0 1"
EndSection

^x
Y

Step 10: sudo reboot

Should be ready to go but if you need to calibrate the screen here is the step for that

Step 11: Screen Calibration

Manually calibrate screen

sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/touchscreen ts_calibrate

Head to screen and manually touch each point to calibrate the screen

Reboot and done.


Comments

  • As it is not a question I moved it to tips and tricks. It is a good example of how to install a display driver. That is as I can see the only real problem with our pi image. It is for hdmi output and depending on the display you use, you might need to install vendor drivers and point x window system to the correct screen.
  • edited December 2018
    @Repetier

    What's the process in pointing x windows to the correct screen? If you wouldn't mind typing it up like I'm 5 that's would be awesome since I lack the ability to understand how this all works. Coding is my weakness. I prefer hardware. ????
  • edited December 2018
    it´s in Step 8  : Option     "fbdev" "/dev/fb1"
    the fb1 points to lcd , fb0 would point to hdmi

    to understand it´s best to read lots of threads( know it from my own experience )

    f.e. look at this


Sign In or Register to comment.