Raspberry Pi, TFT Easy Install(Adafruit TFT LCD)

2021. 8. 10. 15:16카테고리 없음

반응형

사용할 TFT LCD

Adafruit TFT LCD 설치 패키지 다운로드

  • Raspberry Pi에서 아래 명령 수행
$ cd ~
$ sudo apt-get install -y git python3-pip
$ sudo pip3 install --upgrade adafruit-python-shell click
$ git clone https://github.com/adafruit/Raspberry-Pi-Installer-Scripts.git
$ cd Raspberry-Pi-Installer-Scripts

Adafruit TFT LCD 설정 

  • Raspberry Pi에서 아래 명령을 수행해서, 해당하는 TFT LCD Type을 선택한다.
  • Select configuration
    • 사용하고 있는 TFT Type 선택( 인치 및 정전식인지 감압식인지.. )
$ sudo python3 adafruit-pitft.py

Select configuration:
[1] PiTFT 2.4", 2.8" or 3.2" resistive (240x320) (320x240)
[2] PiTFT 2.2" no touch (320x240)
[3] PiTFT 2.8" capacitive touch (320x240)
[4] PiTFT 3.5" resistive touch (480x320)
[5] PiTFT Mini 1.3" or 1.54" display (240x240) - WARNING! WILL UPGRADE YOUR KERNEL TO LATEST
[6] ST7789V 2.0" no touch (320x240) - WARNING! WILL UPGRADE YOUR KERNEL TO LATEST
[7] MiniPiTFT 1.14" display (240x135) - WARNING! WILL UPGRADE YOUR KERNEL TO LATEST
[8] TFT 1.3" Bonnet + Joystick (240x240) - WARNING! WILL UPGRADE YOUR KERNEL TO LATEST
[9] Uninstall PiTFT
[10] Quit without installing

4
  • Select rotation
Select rotation:
[1] 90 degrees (landscape)
[2] 180 degrees (portrait)
[3] 270 degrees (landscape)
[4] 0 degrees (portrait)

ITFT Checking init system...
Found systemd
/boot is mounted
PITFT System update
Updating apt indexes............
Reading package lists...
.........
PITFT Installing Python libraries & Software...
Installing Pre-requisite Software...This may take a few minutes!

Would you like the console to appear on the PiTFT display? ( LCD에 Console이 출력되게 할 것인가? )

Would you like the HDMI display to mirror to the PiTFT display? ( LCD에 HDMI Display에 출력될 내용이 보이게 할 것인가? )

PITFT Checking init system...
Found systemd
/boot is mounted
PITFT System update
Updating apt indexes............
Reading package lists...
.........
PITFT Installing Python libraries & Software...
Installing Pre-requisite Software...This may take a few minutes!
PITFT Reading package lists...
PITFT Building dependency tree...
PITFT Reading state information...
PITFT bc is already the newest version (1.07.1-2).
PITFT build-essential is already the newest version (12.6).
PITFT device-tree-compiler is already the newest version (1.4.7-4).
PITFT evtest is already the newest version (1:1.33-2).
PITFT fbi is already the newest version (2.10-3).
PITFT git is already the newest version (1:2.20.1-2+deb10u3).
PITFT libts-bin is already the newest version (1.19-1).
PITFT python3-dev is already the newest version (3.7.3-1).
PITFT python3-smbus is already the newest version (4.1-1).
PITFT libraspberrypi-dev is already the newest version (1:1.20210831-1).
PITFT python3-pip is already the newest version (18.1-5+rpt1).
PITFT python3-spidev is already the newest version (20200602~200721-1~buster).
PITFT 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
PITFT Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
PITFT Requirement already satisfied: evdev in /usr/local/lib/python3.7/dist-packages (1.4.0)
PITFT Updating /boot/config.txt...
Already have an adafruit-pitft-helper section in /boot/config.txt.
Removing old section...
PITFT Updating SysFS rules for Touchscreen...
PITFT Updating TSLib default calibration...
Would you like the console to appear on the PiTFT display? [y/n] n
PITFT Making sure console doesn't use PiTFT
Removing console fbcon map from /boot/cmdline.txt
Screen blanking time reset to 10 minutes
Would you like the HDMI display to mirror to the PiTFT display? [y/n] y
PITFT Adding FBCP support...
Installing cmake...
Downloading rpi-fbcp...
Uncompressing rpi-fbcp...
Building rpi-fbcp...
Installing rpi-fbcp...
Remove fbcp from /etc/rc.local, if it's there...
We have systemd, so install fbcp systemd unit...
Setting raspi-config to boot to desktop w/o login...
Configuring boot/config.txt for forced HDMI
PITFT Updating X11 default calibration...
PITFT Success!

Settings take effect on next boot.

REBOOT NOW? [Y/n]

Trouble Shooting

아래와 같은 에러 시, 해결 방법

  • dpkg: unrecoverable fatal error, aborting: files list file for package 'libboost-python1.58.0' is missing final newline
  • PITFT E: Sub-process /usr/bin/dpkg returned an error code (2))
PITFT Installing Python libraries & Software...
Installing Pre-requisite Software...This may take a few minutes!
PITFT E: Sub-process /usr/bin/dpkg returned an error code (2)

dpkg: unrecoverable fatal error, aborting:
 files list file for package 'libboost-python1.58.0' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)

- 디스크 에러, 메모리 에러 등, 여러가지 기타 이유로 패키지 파일 목록이 잘못 되었을 때 나오는 에러로, 아래와 같이 해결 하였다.

$ cd /var/lib/dpkg/info
$ sudo rm libboost-python*

$ sudo apt update
$ sudo apt upgrade

 

반응형