본문 바로가기
IT/Platform

[RPi] Zero 2W ILI9488 또 도전

by 블랙오닉스 2024. 6. 20.

2024.06.20

모니터 대신 TFT3.5를 사용

비슷한 것을 찾았다.

https://forums.raspberrypi.com/viewtopic.php?t=166753

 

https://raspberrypi.stackexchange.com/questions/44179/rpi-2-and-3-95-tft-ili9488

 

RPi 2 and 3.95 TFT ili9488

I have bought a 3.95 inch TFTLCD for Raspberry Pi (ILI9488 from mcufriend) and I can't get it to work. I am just mildly experienced with Raspberry and Linux, but the way this type of screen was sho...

raspberrypi.stackexchange.com

 


2024.06.22

Copilot 답변

  1. Connect the SPI LCD:
    • Identify the pins on your SPI LCD. Typically, it will have pins for power (5V and GND), SPI communication (MOSI, MISO, SCLK), and possibly a chip select (CS) pin.
    • Connect the following pins:
      • MOSI (Master Out Slave In) on the Raspberry Pi (Pin 19) to the LCD’s SDA pin.
      • MISO (Master In Slave Out) on the Raspberry Pi (Pin 21) if needed.
      • Power (5V and GND) to the corresponding pins on the LCD.
      • Other pins as required by your specific LCD model.
  2. Install the LCD Driver:
    • Open the terminal window.
    • Type the following commands:
      git clone https://www.github.com/LCD-show.git
      cd LCD-show
      
    • This will download the necessary driver files.

일단 github 경로가 잘못되었다.

ili9488 답변

  1. Load the Drivers:
    • You can add a custom driver for the ILI9488 TFT LCD. Here’s how:
      • Open the terminal on your Raspberry Pi.
      • Navigate to the directory where you want to download the drivers (e.g., ~/fbtft).
      • Run the following commands:
        sudo modprobe fbtft
        sudo insmod fb_ili9488.ko
        sudo insmod fbtft_device.ko name=mcufriend_ili9488 debug=3
        
      • This will load the necessary drivers for your ILI9488 display1.
  2. Wiring:
    • Connect your ILI9488 TFT LCD to the Raspberry Pi using SPI:
      • GPIO6 (SCLK) on the Raspberry Pi to the SCLK pin on the LCD.
      • GPIO7 (MOSI) on the Raspberry Pi to the SDA pin on the LCD.
      • GPIO0 (CS), GPIO1 (RST), and GPIO2 (DC/RS) on the Raspberry Pi to the corresponding pins on the LCD.

개념 정리가 잘되어 있는 곳

https://chrizog.com/rpi-linux-fbtft-touchscreen-setup

 

Setting Up a TFT Touchscreen on a Raspberry Pi with a fbtft Linux Driver | Chrizog

Setting Up a TFT Touchscreen on a Raspberry Pi with a fbtft Linux Driver Having a small touchscreen in a Raspberry Pi project adds a sense of interactivity and convenience by providing a compact and intuitive user interface. You don't have to plugin your b

chrizog.com

Display는 GPIO를 사용하는 것 같고, Touch는 SPI

 

RPi 모든 정보는 여기

https://www.raspberrypi.com/documentation/computers/raspberry-pi.html

 

 

SPI hardware

Raspberry Pi Zero, 1, 2 and 3 have three SPI controllers:

  • SPI0, with two hardware chip selects, is available on the header of all Raspberry Pis; there is also an alternate mapping that is only available on Compute Modules.
  • SPI1, with three hardware chip selects, is available on all Raspberry Pi models except the original Raspberry Pi 1 Model A and Model B.
  • SPI2, also with three hardware chip selects, is only available on Compute Module 1, 3 and 3+.

https://www.haphazard.io/blog/raspberry-pi-framebuffer-fbtft-ili9341/

 

Raspberry Pi framebuffer FBTFT ILI9341

2.2" SPI TFT Display Wiring Display Raspberry Pi GPIO VCC 3.3V GND GND CS CEO RESET 25 D/C 24 SDI (MOSI) MOSI SCK SCLK LED 18 SDO (MISO) n/a Note: The above wiring scheme is the default GPIO values used by the fb_ili9341 TFT driver. These can be customized

www.haphazard.io

 


2024.06.23

insmod: ERROR: could not load module fb_ili9488.ko: No such file or directory

설치 도중 에러 발생 다시 문의

  1. Install TFT Drivers:
    • You can use the fbtft driver to support the ILI9488 display. Install it with:
      sudo pip3 install fbtft
      
    • Load the fbtft module:
      sudo modprobe fbtft_device name=adafruit28 busnum=0 rotate=90 gpios=reset:25,dc:24
      
  2. Configure Framebuffer:
    • Edit the /etc/modules file and add the following line:
      fbtft_device name=adafruit28 busnum=0 rotate=90 gpios=reset:25,dc:24

그럴싸하다.

하지만 fbtft 인스톨 할때 계속 이상한 에러 발생

blackonyx@rpi02w:~ $ sudo pip3 install fbtft
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Virtual Env. 관련인가 해서 이것 저것 해보고, OS도 full로 깔아도 똑같다.

다시 에러를 확인해보니 "try apt install python3-xyz" + "python3-full installed" 가 보인다.

 

sudo apt install python3-full

시도

 

발열때문인가 mathj?? 뭔가를 설치하다 2, 9% 쯤에서 멈춘다.