Faulty CYD or config error?

Hi, just received my first Cheap Yellow Display from Aliexpress. I’ve configured it but the display is garbled. I’ve tried using “show_test_card: true”, printing a simple “Hello World” text and using LVGL. Screen images
are attached. Have I misconfigured something or is the display faulty?

Here’s the yaml:

esphome:
  name: cyd
  friendly_name: CYD

esp32:
  board: esp32dev
  framework:
    type: arduino

logger:

api:
  encryption:

ota:
  - platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
    
# Create a font to use, add and remove glyphs as needed. 
font:
  - file: 'fonts/Arimo-Regular.ttf'
    id: arimo20
    size: 20
    glyphs: "!\"%()+=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ abcdefghijklmnopqrstuvwxyzåäö"

# Create a Home Assistant blue color
color:
  - id: ha_blue
    hex: 51c0f2

i2c: # these are on the CN1 connector and can be used for external I2C devices
  - sda: 27
    scl: 22
    scan: true

# Setup SPI for the display. The ESP32-2432S028R uses separate SPI buses for display and touch
spi: 
  - id: tft
    clk_pin: 14
    mosi_pin: 13
    miso_pin: 12
  - id: touch
    clk_pin: 25
    mosi_pin: 32
    miso_pin: 39

# Setup a pin to control the backlight
output:
  - id: backlight_pwm
    platform: ledc
    pin: 21
  - id: output_red
    platform: ledc
    pin: 4
    inverted: true
  - id: output_green
    platform: ledc
    pin: 16
    inverted: true
  - id: output_blue
    platform: ledc
    pin: 17
    inverted: true

light:
  - id: backlight
    platform: monochromatic
    output: backlight_pwm
    name: Display Backlight
    restore_mode: ALWAYS_ON
    
  - id: led
    platform: rgb
    red: output_red
    green: output_green
    blue: output_blue
    restore_mode: ALWAYS_OFF

# sensor:
#   - platform: adc
#     pin: 34
#     name: "Brightness"
#     update_interval: 60s

touchscreen:
  - id: main_touchscreen
    platform: xpt2046
    spi_id: touch
    cs_pin: 33
    interrupt_pin: 36
    threshold: 400
    calibration:
      x_min: 294
      x_max: 3814
      y_min: 194
      y_max: 3734
    transform:
      mirror_x: true
  
display:
 -  platform: ili9xxx
    id: esp_display
    model: ili9342
    spi_id: tft
    cs_pin: GPIO15
    dc_pin: GPIO2
    #invert_display: true (changed to below with ESPhome 2023.12.0)
    invert_colors: true
    color_palette: 8BIT
    #update_interval: never  # The interval to re-draw the screen. Defaults to 1s.
    #auto_clear_enabled: false
    rotation: 90 #One of 0, 90, 180 or 270.
    dimensions: 
      width: 320
      height: 240
    #show_test_card: true

#lvgl:
# - buffer_size: 25%

    lambda: |-
      it.rectangle(0, 0, 320, 240, id(ha_blue));   
      it.print(160, 140, id(arimo20), id(ha_blue), TextAlign::BOTTOM_CENTER, "Hello World!");
 



Quite surely configuration problem.
Try different model like 9341, try without dimensions etc…

1 Like

Thanks, I’ll try that idea.

That worked, thanks!