esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

ILI9488 does not work in ESPHOME on lolin_d32 board but with same hardware works in arduino IDE with TFT_eSPI library. #4489

Open wiigor opened 1 year ago

wiigor commented 1 year ago

The problem

I have an ILI9488 display. I used this tutorial to make the display work using arduino IDE and this library: TFT_eSPI. The display works correctly and displays all examples from the library.

Now without changing any hardware connections using the same hardware setup I try to run the display using esphome. And the screen does not work. It flickers after flash or reboot but does not display the text given i nthe lambda also in the log seems to be a possible error related to the display:

: [16:29:18][C][ili9xxx:068]: => Failed to init Memory: YES! Could this be the reason the display does not work?

Which version of ESPHome has the issue?

2023.3.2

What type of installation are you using?

pip

Which version of Home Assistant has the issue?

2023.3.2

What platform are you using?

ESP32

Board

lolin_d32

Component causing the issue

ILI9xxx TFT LCD Series

Example YAML snippet

esphome:
  name: air-quality-meter2

esp32:
  board: lolin_d32
  # board: esp32dev                                                                                                                                                                                                                                                                                                                    
  framework:
    type: arduino

# Enable logging
logger:
  level: VERBOSE

# Enable Home Assistant API
#api:
  #password: ""

ota:
  password: ""

wifi: !include includes/wifisp.yaml

# captive_portal:

mqtt:
  broker: 192.168.1.100

font:
  - file: "fonts/arialn.ttf"
    id: my_font
    size: 20
  - file: "fonts/Helvetica.ttf"
    id: helvetica_48
    size: 48
  - file: "fonts/Helvetica.ttf"
    id: helvetica_24
    size : 24
  - file: "fonts/Helvetica.ttf"
    id: helvetica_S
    size: 14

color:
  - id: my_red
    red: 100%
    green: 0%
    blue: 0%
  - id: my_yellow
    red: 100%
    green: 100%
    blue: 0%
  - id: my_green
    red: 0%
    green: 100%
    blue: 0%
  - id: my_blue
    red: 0%
    green: 0%
    blue: 100%
  - id: my_gray
    red: 50%
    green: 50%
    blue: 50%

i2c:
  sda: 21
  scl: 22
  scan: true

spi:
  clk_pin: 18
  mosi_pin: 23

display:
  - platform: ili9xxx
    model: ILI9488
    cs_pin: 15
    dc_pin: 2
    reset_pin: 4
    lambda: |-
      it.fill(Color::BLACK);
      it.print(0, 0, id(my_font), id(my_red), TextAlign::TOP_LEFT, "Hello World!");

Anything in the logs that might be useful for us?

[16:29:18][C][spi:101]: SPI bus:
[16:29:18][C][spi:102]:   CLK Pin: GPIO18
[16:29:18][C][spi:104]:   MOSI Pin: GPIO23
[16:29:18][C][spi:106]:   Using HW SPI: YES
[16:29:18][C][ili9xxx:047]: ili9xxx
[16:29:18][C][ili9xxx:047]:   Rotations: 0 °
[16:29:18][C][ili9xxx:047]:   Dimensions: 480px x 320px
[16:29:18][C][ili9xxx:056]:   Color mode: 8bit 332 mode
[16:29:18][C][ili9xxx:060]:   18-Bit Mode: YES
[16:29:18][C][ili9xxx:063]:   Reset Pin: GPIO4
[16:29:18][C][ili9xxx:064]:   DC Pin: GPIO2
[16:29:18][C][ili9xxx:068]:   => Failed to init Memory: YES!
[16:29:18][C][ili9xxx:070]:   Update Interval: 1.0s
[16:29:18][C][psram:020]: PSRAM:
[16:29:18][C][psram:021]:   Available: NO
[16:29:18][C][mdns:108]: mDNS:
[16:29:18][C][mdns:109]:   Hostname: air-quality-meter2
[16:29:18][V][mdns:110]:   Services:
[16:29:18][V][mdns:112]:   - _http, _tcp, 80
[16:29:18][V][mdns:114]:     TXT: version = 2023.3.2`

Additional information

Working config of the TFT_eSPI library in arduino IDE that leads the screen to work with the same hardware configuration:

define ILI9488_DRIVER // WARNING: Do not connect ILI9488 display SDO to MISO if other devices share the SPI bus (TFT SDO does NOT tristate when CS is high)

`// ###### EDIT THE PIN NUMBERS IN THE LINES FOLLOWING TO SUIT YOUR ESP32 SETUP ######

// For ESP32 Dev board (only tested with ILI9341 display) // The hardware SPI can be mapped to any pins

define TFT_MISO 19

define TFT_MOSI 23

define TFT_SCLK 18

define TFT_CS 15 // Chip select control pin

define TFT_DC 2 // Data Command control pin

define TFT_RST 4 // Reset pin (could connect to RST pin)`

The display with the lolin_d32 board works great using all examples in arduino IDE using TFT_eSPI .

wiigor commented 1 year ago

This issue of another user seems to be the same issue: https://forum.hacf.fr/t/esphome-et-ecran-3-5-3-5-tft-spi-480-320-v2-0/22401

He also gets the => Failed to init Memory: YES! message. if the replaces the board by a ili9341 then it works

rakoan commented 1 year ago

i have the same issue with a ili9488 (+model: ILI9488 in the yaml). Changing the lcd screen to an ili9341 (+ changing with model: ILI9341 in the yaml ) with the same pin connections works perfectly.

Gyosa3 commented 1 year ago

Hi, same problem here, using a "3.5inch RPi Display" device with an ESP32S v4 and display fails to initialise. When using ILI9341 there is no "Failed to init memory" message but it obviously does not work.

any fix would be appreciated !

nielsnl68 commented 1 year ago

@Gyosa3 could you give more details about which display you have (link to the display) and how you connecting it and what is exactly the YAML file look like. Any logs are also welcome,