Problem with waveshare 5inch display not showing anything

Hello,
I just bought the Waveshare ESP32-S3-Touch-LCD-5 1024-600 and I success in the installation from the ESPhome but I can’t see in my display the circles and other drawing that I code with the lambda function.
I just see the display with some sort of noise all in the bottom of it (from left to right).

Do you have any suggestions?

This is how my code look like right now:

esphome:
  name: meter-display
  friendly_name: Meter Display
  platformio_options: 
    build_flags: "-DBOARD_HAS_PSRAM"
    board_build.esp-idf.memory_type: qio_opi
    board_build.flash_mode: dio

esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: esp-idf
    sdkconfig_options:
      CONFIG_FREERTOS_HZ: "1000"
      CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240: y
      CONFIG_SPIRAM_SPEED_120M: y
      CONFIG_SPIRAM_FETCH_INSTRUCTIONS: y
      CONFIG_SPIRAM_RODATA: y
      CONFIG_ESP32S3_DATA_CACHE_64KB: y
      CONFIG_COMPILER_OPTIMIZATION_PERF: y

logger:

api:
  encryption:
    key: "cm7vOJaVoc/h3lMyOonw7o/IW9wBEM4UQLGCiX0pHII="

ota:
  - platform: esphome
    password: "a434ab3e87f61f9de38aa7f85f9e494c"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

psram:
  mode: octal
  speed: 80MHz

i2c:
  sda: GPIO8
  scl: GPIO9
  scan: true
  id: bus_a


touchscreen:
  platform: gt911
  id: main_touch
  interrupt_pin: GPIO4

display:
  - platform: rpi_dpi_rgb
    id: main_display
    auto_clear_enabled: false
    color_order: RGB
    update_interval: never
    pclk_frequency: 16MHz
    dimensions:
      width: 1024
      height: 600
    de_pin:
      number: 5
    hsync_pin:
      number: 46
      ignore_strapping_warning: true
    vsync_pin:
      number: 3
      ignore_strapping_warning: true
    pclk_pin: 7
    hsync_back_porch: 30
    hsync_front_porch: 210
    hsync_pulse_width: 30
    vsync_back_porch: 4
    vsync_front_porch: 4
    vsync_pulse_width: 4
    data_pins:
      red:
        - 1         #r3
        - 2         #r4
        - 42        #r5
        - 41        #r6
        - 40        #r7
      blue:
        - 14        #b3
        - 38        #b4
        - 18        #b5
        - 17        #b6
        - 10        #b7
      green:
        - 39        #g2
        - 0         #g3
        - 45        #g4
        - 48        #g5
        - 47        #g6
        - 21        #g7
    lambda: |-
      auto red = Color(255, 0, 0);
      auto green = Color(0, 255, 0);
      auto blue = Color(0, 0, 255);
      auto white = Color(255, 255, 255);
      id(main_display).filled_circle(50, 50, 40, red);
      id(main_display).filled_circle(100, 50, 40, green);
      id(main_display).filled_circle(150, 50, 40, blue);
      id(main_display).filled_circle(200, 50, 40, white);
      it.line(0, 0, 100, 50);
      it.rectangle(5, 20, 30, 42);
      it.filled_rectangle(40, 40, 30, 42);
      it.circle(20, 40, 10);
      it.filled_circle(20, 75, 10);
      it.triangle(25, 5, 100, 5, 80, 25);
      it.filled_triangle(115, 5, 95, 25, 125, 70);
      it.filled_regular_polygon(170, 45, 20, EDGES_HEXAGON);
      it.regular_polygon(170, 45, 40, EDGES_OCTAGON, VARIATION_FLAT_TOP);

Thank You very much in advance for all of your support.

Regards
Matteo

Well, without LVGL configured, update_interval: never and auto_clear_enabled: false nothing will ever be drawn to the screen.

I’d suggest removing the lambda, and use one of these configs instead

  1. Simple static display:
    # rest of display config above
    auto_clear_enabled: false
    show_test_card: true
    update_interval: 10s
  1. Dynamic display with LVGL:
    # rest of display config above
    auto_clear_enabled: false
    show_test_card: false
    update_interval: never

lvgl:

Thank You very much for your precious answer!
auto_clear_enabled: false was already there and so it is for update_interval: never. What make the difference was to set “10s”. Now works the test card and also the lambda.

Can you explain me why? Do I have to mantain the 10s interval update?

Now or tomorrow I will give it a try to show some lvgl stuff.

Thank You

That depends entirely on your requirements. But (unless you use lvgl) it will have to be something other than never.

In my mind I want to use lvgl. So if I use that your advice is to use update_interval: never?

It’s always a good idea to read the docs before asking questions, otherwise you will have run out of goodwill when you actually need some help.

The graphic display should be configured with auto_clear_enabled: false and update_interval: never, and should not have any lambda set.

Seems pretty clear to me. And it’s just the third paragraph in the ESPHome LVGL Graphics page - you don’t even have to read very far.