New boards Wishlist
add support for CYD 2432S028 with ILI9342
Hello
Unfortunately the CYD 2.8" version I have has display model ILI9342: is it possible to add it to the supported list?
Here is the configuration that works in ESPHome with lvgl
--- SPI: the CYD uses TWO SPI buses (TFT and Touch) ---
spi:
- id: tft clk_pin: GPIO14 mosi_pin: GPIO13 miso_pin: GPIO12
- id: touch clk_pin: GPIO25 mosi_pin: GPIO32 miso_pin: GPIO39
Optional I2C header on the board if you later add sensors
i2c: sda: GPIO27 scl: GPIO22 scan: true
Backlight + onboard RGB LED
output:
- platform: ledc pin: GPIO21 id: backlight_pwm
- platform: ledc pin: GPIO4 id: output_red inverted: true
- platform: ledc pin: GPIO16 id: output_green inverted: true
- platform: ledc pin: GPIO17 id: output_blue inverted: true
light:
- platform: monochromatic id: backlight name: "${friendly_name} Backlight" output: backlight_pwm restore_mode: ALWAYS_ON
- platform: rgb id: led name: "${friendly_name} LED" red: output_red green: output_green blue: output_blue restore_mode: ALWAYS_OFF
--- Display: ILI9342 in portrait (rotation: 0) ---
display:
- platform: ili9xxx id: main_display model: ILI9342 spi_id: tft cs_pin: GPIO15 dc_pin: GPIO2 rotation: 90 # portrait invert_colors: false color_palette: 8BIT # keep on ESPHome 2025.2+ without PSRAM update_interval: never auto_clear_enabled: false
--- Touchscreen: your parameters verbatim ---
touchscreen:
- platform: xpt2046
id: main_touchscreen
display: main_display # <-- ensures mapped coordinates
spi_id: touch
cs_pin: 33
interrupt_pin: 36
threshold: 400
calibration:
x_min: 280
x_max: 3860
y_min: 340
y_max: 3860
transform:
mirror_x: true # baseline for CYD portrait; tweak if needed
mirror_y: false
swap_xy: false
on_touch:
- lambda: |- lv_obj_set_pos(id(cross), touch.x, touch.y); ESP_LOGI("cal", "x=%d y=%d raw_x=%d raw_y=%d", touch.x, touch.y, touch.x_raw, touch.y_raw);
--- LVGL UI (portrait) ---
lvgl: buffer_size: 25% displays: - main_display
Discussion 8
Add a commentThanks for the report and the working configuration, that made this quick to add.
Release 0.3.26 adds the CYD ESP32-2432S028 ILI9342 as an experimental board. Update the app, then pick it under New screen. It is the regular CYD with only the display controller changed: the ILI9342 scans the glass lying down, so the firmware has it swap its axes and everything else (layout, touch, the calibration on the first start) works as on the ILI9341 CYD.
It is built but not yet tried on an ILI9342, so I'd love to hear how it runs:
DISPLAY_INVERT_COLORS: "true"undersubstitutions:in the Override YAML.Got a screen running? Tell others which board you have and what works on the Tessera website. It helps everyone pick a screen that works.
Like my work? Consider buying me a coffee, much appreciated!
Original on GitHub
So far it looks ok, it worked on first attempt, good job. Font is not great for this screen. I can also tell you that it is working from a remote network connected via WireGuard vpn (I added the configuration in the esphome yaml file). I found a bug on the lights and switch entities: it seems it is unable to control them but it gets the status updates from home assistant when they are turn on and off
Original on GitHub
Great to hear it worked on the first attempt, and thanks for the photo! Nice to know it also runs over WireGuard.
Lights and switches: when the state updates but taps do nothing, it's almost always one setting in Home Assistant. Go to Settings > Devices & services > ESPHome, click Configure on this screen and turn on Allow the device to perform Home Assistant actions. Without it the screen can read states, but Home Assistant refuses its actions. Could you check that and let me know if the taps work afterwards?
Font: looking at your photo, the text in the tiles is quite small. Part of that comes from the portrait layout, which gives each tile less width, but there is room to make the letters bigger on this screen. I'll look into that. If it's something else that bothers you about the font, a close-up photo of a tile would help.
Got a screen running? Tell others which board you have and what works on the Tessera website. It helps everyone pick a screen that works.
Like my work? Consider buying me a coffee, much appreciated!
Original on GitHub
On screen I also noticed the BLUE and RED are swapped. Now actions are working, it was missing that option. Here is the close up of the last tile fir reference
Original on GitHub
I got it working with the correct color order by adding
display:
to the xxxxx.local.yaml
Original on GitHub
ok, that worked the colors are correct now.
@MaxGramser here is the landscape orientation with double length tile but I can't see much of a difference
Original on GitHub
Thanks both! @ComputerZOO, your
color_order: rgbis exactly right: ESPHome sends colours in BGR order unless told otherwise, which suits the regular CYD, and this ILI9342 panel wants RGB.Release 0.4.6 (firmware 0.6.0) is out and builds that into the ILI9342 board, so every screen with this display gets the right colours without an override. After updating you can remove the
display:block from your Override YAML; keeping it does no harm either.@SimoneBnc, the same release makes the tile names bigger where a tile has room for them: one column of tiles on a CYD standing up, and a double-width tile like your SDM120 one lying down. Your photo is still the old size; after the update that name is noticeably larger. Narrow tiles, like the two columns of a CYD lying down, keep the size they had, because a larger name would get cut off there.
Update the app, then update the screen. A photo after the update would be great to see how it reads on your panel.
Got a screen running? Tell others which board you have and what works on the Tessera website. It helps everyone pick a screen that works.
Like my work? Consider buying me a coffee, much appreciated!
Original on GitHub
Yes, it is bigger now.
Original on GitHub