Help needed to get this tiny screen working - ESP32-c6 1.47in display

Just to add to this thread my success. This was sitting in a box for a while and I finally this morning tried to get it running. This thread was invaluable, realise being a slight late adopter has its advantages.

I started by creating a device in ESPHome Builder and using a generic ‘esp32-c6-devkitc-1’ as that is now supported natively. After successfully connecting wirelessly, I then added the code from @PsY4 above, the following sections:

esphome:
platformio_options:
→ section entirely

esp32:
→ section entirely

output section for the lcd_backlight control

number:
→ section entirely (realising I can just hard code this)
display:
→ section entirely

Note: in order for the device to work after re-booting or re-applying power it has to be added into home assistant in the devices menu.

Working really well, many thanks all.

2 Likes

There’s been a lot of changes in HA around this area.
I posted code that worked really well from about March until May, and then with June it updated and broke the LCD screen output…
Will repost to confirm when found a working version.

What image did you use for the background.png?

As of esphome 2025.9.1, the following code is what you need to get the screen running.

Curiously it doesn’t go well together with threads so I guess we are stuck with Wi-Fi for now.

esp32:
  board: esp32-c6-devkitc-1
  variant: esp32c6
  framework:
    type: esp-idf
spi:
  clk_pin: GPIO7
  mosi_pin: GPIO6
  miso_pin: GPIO5
display:
  - platform: st7789v
    model: Waveshare 1.47in 172X320
    dc_pin:
      number: GPIO15
      ignore_strapping_warning: true
    cs_pin: GPIO14
    reset_pin: GPIO21
    backlight_pin: GPIO22
    platform_version: 6.9.0

I am afraid that version is not available anymore.
And the latest is far away from a 6.* :
https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21-2/platform-espressif32.zip)

I can compile and upload my config, but nothing shows up on the screen. Just many “Display update running” in the logs, and a “[W][api.connection:1880]: Home Assistant 2025.4.0 (192.168.1.15): Reading failed CONNECTION_CLOSED errno=128” every 30 seconds.

I think I will put it to a drawer for a couple of months.

1 Like

Does anyone know what this fla means?

“-DBOARD_HAS_PSRAM”

Actually the board doesn’t have PSRAM, right?

Post your yaml and compile log (formatted please).

I thought about borrowing this yaml:

Not done anything with it yet.

I got it working from here ST7789V TFT LCD - ESPHome - Smart Home Made Simple

This is my file that reads the time and displays locally. I couldn’t get the remote
Still very raw with lots of comments

#esp32c6-lcd-147a  Waveshare C6 LCD 1.47in
#
# 260101 : working on display except for time.
# 251231 : config
# https://esphome.io/components/display/st7789v/ see Waveshare 1.47in 172X320
# LCD driver ST7789V3 (LBS147TC-IF15) 172(H)RGB x320(V)
#

substitutions:
  logger_dbg: "DEBUG"


esphome:
  name: esp32c6-lcd-147a
  friendly_name: ESP32C6-LCD-1.47A

esp32:
  board: esp32-c6-devkitc-1
  variant: esp32c6
  framework:
    type: esp-idf

spi:
  clk_pin: GPIO7
  mosi_pin: GPIO6
  miso_pin: GPIO5



# Enable logging
logger:
  level: $logger_dbg
  logs:
    component: ERROR

# Enable Home Assistant API
api:
  reboot_timeout: 0s
  encryption:
    key: "c3lJs2O148U6z6VivWPGDzpHcLsrN3k36Gq5VMz+Lno="

ota:
  - platform: esphome
    password: "b709958b1b0c68620096a78dc60b5cd1"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp32C6-Lcd-147A"
    password: "Y1OQtMqYFbu5"

captive_portal:
    
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%

font:
  - file: "fonts/Helvetica.ttf"
    id: helvetica_48
    size: 48
  - file: "fonts/Helvetica.ttf"
    id: helvetica_24
    size: 24
  - file: "fonts/Helvetica.ttf"
    id: helvetica_12
    size: 12

binary_sensor:
  - platform: status
    name: "Node Status"
    id: system_status
  - platform: gpio
    pin:
      number: GPIO09 
      inverted: true
      mode:
        input: true
        pullup: true
    name: "T-Display Button Input 0"
    id: tdisplay_button_input_0

# Sync time with Home Assistant.
time:
  - platform: homeassistant
    id: esptime

text_sensor:  #shows on web page
#https://esphome.io/components/text_sensor/uptime.html
  - platform: uptime
    name: "Uptime ddhhmmss"
    #friendly_name: "Uptime ddhhmmss"

################################################################################
# Sensors
################################################################################
sensor:
  # https://esphome.io/components/sensor/uptime.html
  - platform: uptime
    name: UptimeSecs
    id: uptime_secs
    type: seconds
  #  update_interval: 60s
    entity_category: diagnostic

display:
  - platform: st7789v
    model: Waveshare 1.47in 172X320
    dc_pin:
      number: GPIO15
      ignore_strapping_warning: true
    cs_pin: GPIO14
    reset_pin: GPIO21
    backlight_pin: GPIO22
    rotation: 90
    lambda: |-
      it.rectangle(0,  0, it.get_width(), it.get_height(), id(my_blue));
      it.rectangle(0, 20, it.get_width(), it.get_height(), id(my_blue));   // header bar

      it.strftime((240 / 2), (140 / 3) * 1 + 5, id(helvetica_24), id(my_gray), TextAlign::CENTER, "%Y-%m-%d", id(esptime).now());
      it.strftime((240 / 2), (140 / 3) * 2 + 5, id(helvetica_48), id(my_gray), TextAlign::CENTER, "%H:%M:%S", id(esptime).now());
      it.print(5, 5, id(helvetica_12), id(my_yellow), TextAlign::TOP_LEFT, "ESPHome");

      // Comment out the above lines to see the image without text overlaid
      // it.image(0, 0, id(my_image));

      if (id(system_status).state) {
        it.print(235, 5, id(helvetica_12), id(my_green), TextAlign::TOP_RIGHT, "Online");
      }
      else {
        it.print(235, 5, id(helvetica_12), id(my_red), TextAlign::TOP_RIGHT, "Offline");
      }
1 Like

After a week of trying different configs I finally landed on some mentioning that display driver st7789v is obsolete and need to use mipi_spi. After going through waveshare C++ samples was able to generate proper display config

this is just snippet of my config, but display and WiFi work together and I can control brightness of the display

esphome:
  name: ${device_internal_name}
  friendly_name: ${device_friendly_name}
  on_boot:
    then:
      - light.turn_on:
          id: back_light
          brightness: 50%

################################################################################
# ESP32 platform
################################################################################
esp32:
  board: esp32-c6-devkitc-1
  variant: esp32c6
  flash_size: 4MB
  framework:
    type: esp-idf


################################################################################
# SPI
################################################################################
spi:
  clk_pin: GPIO7
  mosi_pin: GPIO6
  miso_pin: GPIO5

################################################################################
# DISPLAY
################################################################################
# Define a PWM output on the ESP32
output:
  - platform: ledc
    pin: GPIO22
    id: backlight_pwm

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

display:
  - platform: mipi_spi
    model: custom
    dc_pin: GPIO15
    cs_pin: GPIO14
    reset_pin: GPIO21
    color_order: bgr
    color_depth : 16
    pixel_mode: 18bit
    invert_colors: true
    transform:
      swap_xy: true
      mirror_x: false
      mirror_y: false
    dimensions:
      width: 320
      height: 172
      offset_height: 34
      offset_width: 0
    init_sequence:
      # LCD_Driver\Vernon_ST7789T\Vernon_ST7789T.c
      - [ 0xb0, 0x00, 0xe8]
      - [ 0xB2,0x0c, 0x0c, 0x00, 0x33, 0x33 ]
      - [ 0xb7, 0x75 ]
      - [ 0xbb, 0x1a ]
      - [ 0xc0, 0x80 ]
      - [ 0xc2, 0x01, 0xff ]
      - [ 0xc3, 0x13 ]
      - [ 0xb4, 0x20 ]
      - [ 0xc6, 0x0f ]
      - [ 0xd0, 0xa4, 0xa1 ]
      - [ 0xE0, 0xD0, 0x0D, 0x14, 0x0D, 0x0D, 0x09, 0x38, 0x44, 0x4E, 0x3A, 0x17, 0x18, 0x2F, 0x30 ]
      - [ 0xE1, 0xD0, 0x09, 0x0F, 0x08, 0x07, 0x14, 0x37, 0x44, 0x4D, 0x38, 0x15, 0x16, 0x2C, 0x2E ]
      - [ 0x21 ]
      - [ 0x29 ]
      - [ 0x2c ]


I have used the code and it creates the stripes across the display. With st7789v platform they were not there.

I would try changing " data_rate" from here

Also the board I used it is this one Amazon.com: Waveshare ESP32-C6 1.47inch Display Development Board, 172×320, 262K Color, 160MHz Running Frequency Single-Core Processor, Supports Wi-Fi 6 & BLE, with Colorful RGB LED, ESP32 with Display : Electronics, so there can be some model differences that need finetuning

I used original 40MHz, default 10MHz and 1MHz. It has no influence on the picture. Mine device is from Aliexpress, but it looks the same.
Odd thing is that with old library it works flawlessly - except the slow refresh, but that is the same with mipi_spi.
It looks that the drawing is split to several sectors and it can be artifact from that.

[14:11:06.349][V][display.mipi_spi:510]: Drawing from line 0 took 9ms
[14:11:06.351][V][display.mipi_spi:515]: x_low 0, y_low 0, x_high 319, y_high 20
[14:11:06.353][V][display.mipi_spi:297]: Set addr 0/0, 319/21
[14:11:06.354][V][display.mipi_spi:244]: Command 2B, length 4, bytes 00.22.00.37
[14:11:06.356][V][display.mipi_spi:244]: Command 2A, length 4, bytes 00.00.01.3F
[14:11:06.359][V][display.mipi_spi:244]: Command 2C, length 0, bytes
[14:11:06.369][V][display.mipi_spi:532]: Write to display took 17ms
[14:11:06.370][D][display:428]: Display update running
[14:11:06.377][V][display.mipi_spi:510]: Drawing from line 21 took 7ms
[14:11:06.378][V][display.mipi_spi:515]: x_low 0, y_low 21, x_high 319, y_high 41
[14:11:06.380][V][display.mipi_spi:297]: Set addr 0/20, 319/41
[14:11:06.381][V][display.mipi_spi:244]: Command 2B, length 4, bytes 00.36.00.4B
[14:11:06.384][V][display.mipi_spi:244]: Command 2A, length 4, bytes 00.00.01.3F
[14:11:06.386][V][display.mipi_spi:244]: Command 2C, length 0, bytes
[14:11:06.395][V][display.mipi_spi:532]: Write to display took 17ms
[14:11:06.397][D][display:428]: Display update running
[14:11:06.405][V][display.mipi_spi:510]: Drawing from line 42 took 8ms
[14:11:06.406][V][display.mipi_spi:515]: x_low 0, y_low 42, x_high 319, y_high 62
[14:11:06.408][V][display.mipi_spi:297]: Set addr 0/42, 319/63
[14:11:06.410][V][display.mipi_spi:244]: Command 2B, length 4, bytes 00.4C.00.61
[14:11:06.412][V][display.mipi_spi:244]: Command 2A, length 4, bytes 00.00.01.3F
[14:11:06.413][V][display.mipi_spi:244]: Command 2C, length 0, bytes
[14:11:06.424][V][display.mipi_spi:532]: Write to display took 17ms
[14:11:06.426][D][display:428]: Display update running
[14:11:06.434][V][display.mipi_spi:510]: Drawing from line 63 took 8ms
[14:11:06.435][V][display.mipi_spi:515]: x_low 0, y_low 63, x_high 319, y_high 83
[14:11:06.437][V][display.mipi_spi:297]: Set addr 0/62, 319/83
[14:11:06.440][V][display.mipi_spi:244]: Command 2B, length 4, bytes 00.60.00.75
[14:11:06.440][V][display.mipi_spi:244]: Command 2A, length 4, bytes 00.00.01.3F
[14:11:06.443][V][display.mipi_spi:244]: Command 2C, length 0, bytes
[14:11:06.452][V][display.mipi_spi:532]: Write to display took 17ms
[14:11:06.454][D][display:428]: Display update running
[14:11:06.471][V][display.mipi_spi:510]: Drawing from line 84 took 8ms
[14:11:06.471][V][display.mipi_spi:515]: x_low 0, y_low 84, x_high 319, y_high 104
[14:11:06.471][V][display.mipi_spi:297]: Set addr 0/84, 319/105
[14:11:06.471][V][display.mipi_spi:244]: Command 2B, length 4, bytes 00.76.00.8B
[14:11:06.471][V][display.mipi_spi:244]: Command 2A, length 4, bytes 00.00.01.3F
[14:11:06.471][V][display.mipi_spi:244]: Command 2C, length 0, bytes
[14:11:06.479][V][display.mipi_spi:532]: Write to display took 15ms
[14:11:06.480][D][display:428]: Display update running
[14:11:06.489][V][display.mipi_spi:510]: Drawing from line 105 took 9ms
[14:11:06.490][V][display.mipi_spi:515]: x_low 0, y_low 105, x_high 319, y_high 125
[14:11:06.492][V][display.mipi_spi:297]: Set addr 0/104, 319/125
[14:11:06.494][V][display.mipi_spi:244]: Command 2B, length 4, bytes 00.8A.00.9F
[14:11:06.496][V][display.mipi_spi:244]: Command 2A, length 4, bytes 00.00.01.3F
[14:11:06.498][V][display.mipi_spi:244]: Command 2C, length 0, bytes
[14:11:06.507][V][display.mipi_spi:532]: Write to display took 17ms
[14:11:06.509][D][display:428]: Display update running
[14:11:06.517][V][display.mipi_spi:510]: Drawing from line 126 took 8ms
[14:11:06.518][V][display.mipi_spi:515]: x_low 0, y_low 126, x_high 319, y_high 146
[14:11:06.520][V][display.mipi_spi:297]: Set addr 0/126, 319/147
[14:11:06.521][V][display.mipi_spi:244]: Command 2B, length 4, bytes 00.A0.00.B5
[14:11:06.524][V][display.mipi_spi:244]: Command 2A, length 4, bytes 00.00.01.3F
[14:11:06.526][V][display.mipi_spi:244]: Command 2C, length 0, bytes
[14:11:06.535][V][display.mipi_spi:532]: Write to display took 17ms
[14:11:06.537][D][display:428]: Display update running
[14:11:06.545][V][display.mipi_spi:510]: Drawing from line 147 took 8ms
[14:11:06.546][V][display.mipi_spi:515]: x_low 0, y_low 147, x_high 319, y_high 167
[14:11:06.549][V][display.mipi_spi:297]: Set addr 0/146, 319/167
[14:11:06.550][V][display.mipi_spi:244]: Command 2B, length 4, bytes 00.B4.00.C9
[14:11:06.552][V][display.mipi_spi:244]: Command 2A, length 4, bytes 00.00.01.3F
[14:11:06.554][V][display.mipi_spi:244]: Command 2C, length 0, bytes
[14:11:06.563][V][display.mipi_spi:532]: Write to display took 17ms
[14:11:06.573][D][display:428]: Display update running
[14:11:06.575][V][display.mipi_spi:510]: Drawing from line 168 took 9ms
[14:11:06.577][V][display.mipi_spi:515]: x_low 0, y_low 168, x_high 319, y_high 188
[14:11:06.578][V][display.mipi_spi:297]: Set addr 0/168, 319/189
[14:11:06.580][V][display.mipi_spi:244]: Command 2B, length 4, bytes 00.CA.00.DF
[14:11:06.582][V][display.mipi_spi:244]: Command 2A, length 4, bytes 00.00.01.3F
[14:11:06.584][V][display.mipi_spi:244]: Command 2C, length 0, bytes
[14:11:06.593][V][display.mipi_spi:532]: Write to display took 16ms
[14:11:06.595][V][display.mipi_spi:537]: Total update took 255ms

Thanks for all your fine examples.

regarding the stripes you might want to take a look at MIPI SPI Display Driver - ESPHome - Smart Home Made Simple

  • draw_rounding (Optional): The rounding factor for drawing operations. Defaults to 2. Some chips require a higher value to avoid display artifacts. Must be a power of 2.

draw_rounding: 1 solved the stripes for me :wink: