Main Menu

search

You are here

rPi TFT LCD

[last updated: 2019-11-16]
raspberry Pi home page
camera module on rPi Zero
-----

  • In the end, nothing worked, and I was unable to get this display working. Surely my own "operator error" rather than a problem with the device...

  • I will be using a Geekreit 3.5" TFT LCD screen (from Banggood)
    Bottom of board is labeled: 3.5inch RPi LCD (A) V23
    480 x 320 Pixel
    XPT2046 Touch Controller
    One source said the Geekreit screen is basically a copy/clone of a Waveshare device, so one installation attempt below follows their guide.
    I could not find a Waveshare-branded device listed on the Waveshare site.
  • I will install LCD software/drivers onto model B rPi
  • To start: attached TFT LCD screen, and HDMI cable
    booted, with video output going to HDMI
    backlight on LCD screen came on, but nothing else
  • First attempt failed: using (link to:) Adafruit TFT install instructions because of incompatibility with the 3.5" display.
  • Second attempt failed:
    • From the (link to:) Waveshare installation procedure:
    • $ sudo raspi-config
      then select: Advanced Options > expand file system
        Message said can't do it, that if I'm using NOOBS my file system is already expanded.

      select: boot option > desktop/CLI > Desktop autologin
      <Tab> <Tab> <Finish> > reboot

    • get the driver:
      $ git clone https://github.com/waveshare/LCD-show.git
      $ cd LCD-show/
      $ chmod +x LCD35-show
      $ ./LCD35-show
      appeared to execute without error, then automatically rebooted
    • "It should be ready to use." Did the download without the LCD attached, so did shutdown, installed LCD, and powered up.
    • However, it bombed. Boot started OK, but ended up with blue dialog box saying "Mode Not Supported." Not sure, but somewhere I may have switched SD cards and this one, SD06, that I downloaded the driver onto, may not have had the config options done...
  • Third attempt failed: repeat of second attempt, fresh/re-built SD card (SD-07 w/ stretch), being more careful to follow procedure exactly, but same result.
  • Fourth attempt failed: with fresh SD-08 w/ stretch, following procedure from (link to:) mov2k6 'Out-of-stock' site.. This approach is also designed for the Waveshare LCD screen.
    • open the config.txt file from /boot:
      $ sudo nano /boot/config.txt
      Add the following entry:
        dtparam=i2c_arm=on (uncomment)
        dtparam=spi=on (uncomment)
        dtoverlay=ads7846,penirq=25,speed=10000,penirq_pull=2,xo

      Save and exit (ctrl-x, y, Enter).

    • Open modules from /etc:
      $ sudo nano /etc/modules
      Add the following entry (everything must be on one line):
        ads7846_device model=7846 cs=1 gpio_pendown=25 speed=1000000 keep_vref_on=1 swap_xy=1 pressure_max=255 x_plate_ohms=150 x_min=184 x_max=3869 y_min=141 y_max=3959

      Save and exit (ctrl-x, y, Enter)

    • Create folder xorg.conf.d inside /etc/X11:
      $ sudo mkdir /etc/X11/xorg.conf.d
    • Create a file named 99-calibration.conf inside /etc/X11/xorg.conf.d:
      $ sudo nano /etc/X11/xorg.conf.d/99-calibration.conf
      Add the following entry:
        Section “InputClass”
        Identifier “calibration”
        MatchProduct “ADS7846 Touchscreen”
        Option “Calibration” “3853 170 288 3796”
        Option “SwapAxes” “1”
        EndSection

      Save and exit (ctrl-x, y, Enter).

    • Download the LCD driver from Waveshare:
      $ wget htt[p]://www.waveshare.com/w/upload/0/00/LCD-show-170703.tar.gz
      • Actual command text is "http" but drupal editor gave error and would not proceed until I changed it to "htt[p]".
    • Unzip the archive and go inside the archive folder:
      $ tar xvf LCD-show-170703.tar.gz
      $ cd LCD-show/
    • Make script file executable:
      $ chmod +x LCD35-show
    • Run the script that will switch the rPi output from hdmi to the lcd:
      $ ./LCD35-show
      The rPi should automatically reboot when the script finishes.
      The next boot should be done using the LCD, instead of hdmi. (???)
      • Everything worked to here,
        But...boot hung up. First time at 'time synchronization', pulled plug and rebooted and this time hung at 'Update UTMP'
    • This completes the procedure. It should work now.
        Note: If you want to switch back to hdmi, run the following commands:
        $ cd LCD-show/
        $ ./LCD-hdmi
  • Fifth attempt failed:
    • Remove SD card from rPi, insert into PC with SD card reader.
    • Per notes in Hestiapi:
      edit /boot/config.txt:
      $ sudo nano /boot/config.txt
      Uncomment this to enable the lirc-rpi module:
      #dtoverlay=lirc-rpi
    • Reinsert SD into rPi and power up to boot.
      It did progress farther, as far as I could tell, in that it got through all of the boot process that prints text to the screen,
      but then again hung but this time with a black screen. No green activity LED. Pulled plug.
  • Sixth attempt aborted:
    • Searching for explanation of what lirc is, to understand the Hestiapi suggestion. Found that lirc is a module for "infrared remote control", to read and write such signals. No clue how the Hestiapi hardware uses such things, but pretty sure the TFT LCD does not, so will re-comment that line in boot/config.
    • I am going to attempt to install the driver onto the SD card while it's in a SD reader on my Linux PC:
      • To start, I see there is a media/jay/root/home/pi/LCD-show directory, where the drivers are located. I also see that the driver ...tar.gz is located here.
      • I also see that a couple of the tutorials say to remove this directory (if it exists), presumably to guarantee that new drivers that are downloaded aren't confused with old ones.
        Accordingly I'll start by deleting this folder (actually moved it to desktop HD).
      • Opened terminal:
        $ cd /media/jay/root/home/pi
          Notes (guesses) here about wget vs. git clone:
          Earlier procedure used wget ... tar.gz and downloaded a tar.gz into home/pi directory,
          which then was un-tar'd with tar xvf...
          Other instructions say to use git clone, which then apparently is already un-tar'd.

        I'll use git clone:
        $ git clone htt[ps]://github.com/goodtft/LCD-show.git
        Appears to have been successful, as LCD-show directory was created in root/home/pi
        Proceeding:
        $ chmod -R 755 LCD-show
        $ cd LCD-show/
        ... uh, perhaps didn't think this through...
        because... $ sudo ./LCD35-show will result in re-booting, and I don't want to do this on my desktop, which is where I'm doing all this, OTOH, putting the SD car back into the rPi hangs on boot so I never get a chance to open a terminal...

      • So... aborting this attempt.
  • Seventh attempt ...
    • Reformatting & repartitioning SD-08
    • ...
  • Then ... attempt:

------------------------

.

.

.

eof