Custom Component for Waveshare ESP32-S3 4.2" RLCD (ST7305)

I recently picked up the Waveshare ESP32-S3 4.2inch RLCD Development Board. While I initially bought it under the impression it was natively supported, I quickly realized there wasn’t a built-in driver for the ST7305 controller in ESPHome.

After some deep-dive vibe coding, I’ve completed a custom driver component to get this display up and running. I wanted to share it here in case anyone else is looking to use these ultra-low-power reflective displays in their ESPHome projects.

GitHub Repository: ESPHome-ST7305-RLCD

Key Features:

  • Full support for the Waveshare ESP32-S3 4.2" RLCD
  • Should support other panels using the ST7305 (untested)
  • Low-power optimization
  • Easy integration via external_components

Quick Implementation:
To use it in your YAML, just point to the repo:

external_components:
  - source: github://kylehase/ESPHome-ST7305-RLCD
    components: [ st7305_rlcd ]

display:
  - platform: st7305_rlcd
    # Add your pin configuration here

Feel free to submit issues or PRs on GitHub. Hope this helps someone avoid the headache I had!

4 Likes

Cool, nicely done. Planning on submitting it to ESPHome?

1 Like

Honestly, I’m a little unconfident since it’s vibe coded. It works for me, and supposedly uses the ESPHome coding standards, but I’m hesitant to submit it.

I’ll consider it in the future after I learn more about ESP component coding.

1 Like

It seems to work, so far.
My first refresh is often garbage, the second then works fine, so I guess it’s probably a race condition at some point.

Other than that, so far so good, haven’t had a look at the code yet… I got the panel 2 weeks ago, and haven’t even had the time to look at it anyways so far.

I have not had any luck getting this to work at all.
My screen just shows static and won’t even show the test screen.

any recommendations?

spi:
  clk_pin: GPIO11
  mosi_pin: GPIO12 #Yes

# External component
external_components:
  - source: github://kylehase/ESPHome-ST7305-RLCD
    components: [ st7305_rlcd ]

font:
  - file: "gfonts://Roboto"
    id: roboto
    size: 40

display:
  - platform: st7305_rlcd
    model: WAVESHARE_400X300
    rotation: 0
    id: my_display
    #width: 400
    #height: 300
    cs_pin: GPIO40 #Yes
    dc_pin: GPIO5 #Yes
    reset_pin: GPIO41 #Yes
    #te_pin: GPIO6 #Yes
    update_interval: never
    #show_test_card: true
    lambda: |-
      // Get dimensions
      int w = it.get_width();
      int h = it.get_height();

      // Print "Hello World!" in the center of the screen
      // Arguments: x, y, font_id, color, alignment, text
      it.printf(w / 2, h / 2, id(roboto), COLOR_ON, TextAlign::CENTER, "Hello World!");
      id(my_display).low_power_mode();

I finally found the fix - I took the hint and actually set an update interval - only 5s, but after setting that everything finally started working!

1 Like

yeah, something during the init is probably going too fast or something is missing.
Glad you found the hint :wink:

There is probably also something else still not right, because when entering low-power mode, the panel looses a bit of contrast (which it does not do on the demo).