Using HY28B / Texy 2.8 TFT with Raspbian Jessie 2017-04-10

I have been lazy… I admit…I havent updated my Pis in over a year!

So, with great eager I started yesterday, by downloading the latest Rasbian 2017-04-10 image thinking, well, this will be quick (:
How wrong was I!  I only just finished up with the first one!

 

Why this long? Well, the underpants-devs (aka linux developers = pimply guys sitting in their underpants in their mom’s basement) again went and changed a tonne of stuff without updating the docs and tutorials we all rely on. Fuck you linux devs… fuck you

 

Anyway, figured I’ll document what worked for me – maybe it helps someone else with the HY28B, Texy 2.8, or other ILI9325 based TFTs

 

  1. Write a fresh SD with the latest Rasbian Jessie (This worked with 2017-04-10… if the underpants-devs have their way, please consider this already broken, again) (fuck you underpants-devs)
  2. Put a blank file called ‘ssh’ in the boot partition before you eject the SD.   Yip those underpants-kids figured they’ll vent some of their anger about all the teasing at school, on you, by disabling SSH until you do! Urrrg.  “security” “iot” fuck… Anyway, if Rasbian sees /boot/ssh it enables SSH…
  3. Once finally booted up, SSH into the Pi
  4.  sudo nano /boot/config.txt
  5. add a new overlay:
     dtoverlay=hy28b,rotate=90,resetgpio=25,ledgpio=18
  6. Edit the kernel command line
    sudo nano /boot/cmdline.txt
  7. at the end of the line, add:
     fbcon=map:10 fbcon=font:VGA8X8
  8. Change the font:
    sudo dpkg-reconfigure console-setup
  9. Go through the following menu choices:
    Encoding to use on the console: <UTF-8>
    Character set to support: <Guess optimal character set>
    Font for the console: Terminus (default is VGA)
    Font size: 6×12 (framebuffer only)
  10. Install packages needed for touch
    sudo apt-get update
    sudo apt-get install libts-bin evtest xinput
  11. Install the ‘evdev’ touch drivers
     sudo apt-get install xserver-xorg-input-evdev
  12. To calibrate the touch panel for non-X based use
    sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event0 ts_calibrate
  13. Edit
    sudo nano /usr/share/X11/xorg.conf.d/99-fbturbo.conf

    and change the line

    Option "fbdev" "/dev/fb0"

    to

    Option "fbdev" "/dev/fb1"
  14. Enable X Windows
    sudo raspi-config
  15. Enable boot to GUI
  16. Reboot
  17. At this point the Desktop should launch in the TFT but touch calibration will be way messed up
  18. Install calibration tool:
    sudo apt-get install -y xinput-calibrator
  19. Change the input driver to evdev
    sudo nano /usr/share/X11/xorg.conf.d/40-libinput.conf
  20. At the bottom, look for the section dealing with “touchscreen” (ie ignore touchpad, pointer and keyboard)
  21. In the touchpad section, change the driver to evdev
  22. Section "InputClass"
     Identifier "libinput touchscreen catchall"
     MatchIsTouchscreen "on"
     MatchDevicePath "/dev/input/event*"
     #commented out# Driver "libinput"
     Driver "evdev"
    EndSection
  23. Reboot
  24. When the UI comes up, use a mouse to open a terminal and run
    'sudo xinput_calibrator'
  25. Copy the
    Section....EndSection

    output from the terminal and paste in a new file:

    /usr/share/X11/xorg.conf.d/99-calibration.conf

    For Example:

    Section "InputClass"
      Identifier "calibration"
      MatchProduct "ADS7846 Touchscreen"
      Option "Calibration" "338 3879 198 3667"
      Option "SwapAxes" "1"
    EndSection
  26. Reboot one last time.
  27. When it comes up, touchscreen should at last be working!
  28. Install packages needed for Kiosk
     sudo apt-get install -y x11-xserver-utils unclutter
  29. Create/edit the file located here:
    nano /home/pi/.config/lxsession/LXDE-pi/autostart

    So that the file has this in it:

    @lxpanel --profile LXDE-pi
    @pcmanfm --desktop --profile LXDE-pi
    #@xscreensaver -no-splash
    #@point-rpi
    @xset s off
    @xset -dpms
    @xset s noblank
    @sed -i 's/"exited_cleanly": false/"exited_cleanly": true/' ~/.config/chromium/Default/Preferences
    @chromium-browser --incognito --noerrdialogs --kiosk bloggerbrothers.com
    @unclutter -idle 0.1 -root