ILI9341 Display not working

I know this has probably been covered, but for the life of me I can not get any suggestions to work. I have an ESP32 DEVKITV1 to an ILI9341, and all I can get is the backlight to light the screen. I can not get any color or text to display at all. Please tell me where I am screwing up.

# SPI per ILI9341 table (MOSI=GPIO23, SCK=GPIO18)
spi:
  id: spihwd
  clk_pin: GPIO18
  mosi_pin: GPIO23
  # MISO is not used/not connected on your module
  interface: hardware

# Define a PWM output on the ESP32
output:
  - platform: ledc
    pin: GPIO27
    #inverted: true
    id: gpio_27_backlight_pwm

# Define a monochromatic, dimmable light for the backlight
light:
  - platform: monochromatic
    output: gpio_27_backlight_pwm
    name: "Display Backlight"
    id: back_light
    restore_mode: ALWAYS_ON

# Colors & fonts unchanged
color:
  - id: my_red
    red: 100%
    green: 0%
    blue: 0%
  - id: my_orange
    red: 100%
    green: 50%
    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_teal
    red: 0%
    green: 100%
    blue: 100%
  - id: my_gray
    red: 70%
    green: 70%
    blue: 70%
  - id: my_white
    red: 100%
    green: 100%
    blue: 100%
  - id: my_black
    red: 0%
    green: 0%
    blue: 0%

font:
  - file: "gfonts://Roboto"
    id: font_48
    size: 48
  - file: "gfonts://Roboto"
    id: font_36
    size: 36
  - file: "gfonts://Roboto"
    id: font_24
    size: 24
  - file: "gfonts://Roboto"
    id: font_12
    size: 12

# --- ILI9341 DISPLAY ---
display:
  - platform: ili9xxx
    model: TFT 2.4
    spi_id: spihwd
    color_palette: 8BIT
    #color_order: RGB
    #cs_pin: GPIO15
    dc_pin: GPIO2
    reset_pin: GPIO13
    invert_colors: false
    #show_test_card: true

    update_interval: 2s

    lambda: |-
      const int W = it.get_width();
      const int H = it.get_height();
      it.fill(Color::BLACK);

      // White border
      it.rectangle(0, 0, W, H, id(my_white));

      // Color bars (using RGB constructor)
      it.filled_rectangle(0,        0, W/3,     H, Color(1.0, 0.0, 0.0));   // Red
      it.filled_rectangle(W/3,      0, W/3,     H, Color(0.0, 1.0, 0.0));   // Green
      it.filled_rectangle(2*W/3,    0, W - 2*W/3, H, Color(0.0, 0.0, 1.0)); // Blue

      // Text on top
      it.print(8, 8, id(font_24), id(my_white), "ILI9341 TEST");

Post a link to the display you have.

Also - does your ESP32 have PSRAM and have you explicitly labelled it in yaml?

I have not enabled PSRAM in my yaml.

This is the board: Amazon.com: ESP-WROOM-32 ESP32 ESP-32S Development Board 2.4GHz Dual-Mode WiFi + Bluetooth Dual Cores Microcontroller Processor Integrated with Antenna RF AMP Filter AP STA Compatible with Arduino IDE (3PCS) : Electronics

This is the display: Amazon.com: HiLetgo ILI9341 2.8" SPI TFT LCD Display Touch Panel 240X320 with PCB 5V/3.3V STM32 : Industrial & Scientific

EDIT: Also noticed that in your yaml model is TFT 2.4. Maybe change to:

display:
  - platform: ili9xxx
    model: ILI9341

Nothing jumps out. With the 8 bit colour palette you shouldn’t need PSRAM.

Have you tried connecting MISO and using the CS pin? I always have these enabled on mine, don’t have the time to check if it works without at the moment sorry. Other than that, post a photo of your wiring showing cables clearly.

These displays are fairly well labeled, so it’s probably not wrong pins. They are pretty cheap though, I have used a few and of 4 I have one failed out of the box.

1 Like

Also note: ILI9XXX component is being replaced by the MIPI SPI component - maybe consider trying that:

You nailed it. I could swear I did exactly what you suggested in one of my tries.

# --- ILI9341 DISPLAY ---
display:
  - platform: ili9xxx
    model: ILI9341
    spi_id: spihwd
    color_palette: 8BIT
    color_order: RGB
    dc_pin: GPIO2
    reset_pin: GPIO13
    cs_pin: GPIO15
    invert_colors: false
    #show_test_card: true

    update_interval: 2s