Here is another solution - no glitching observed:
psram:
speed: 80MHz
external_components:
- source: github://clydebarrow/esphome@mipi-spi
components: [spi, mipi_spi]
refresh: 1h
spi:
- type: octal
id: octal_spi
clk_pin: 47
data_pins:
- 9
- ignore_strapping_warning: true
number: 46
- ignore_strapping_warning: true
number: 3
- 8
- 18
- 17
- 16
- 15
display:
- platform: mipi_spi
id: w32_disp
model: wt32-sc01-plus
data_rate: 10MHz
lvgl:
Adorem
(aka Christophe)
March 9, 2025, 8:56am
43
Cool!
Tested with the hello world demo and no glitching observed.
I will use this version with my screen and tell you if I see some issues.
Just for my understanding this will replace later your current pr#8230?
Yes, that is the intention.
1 Like
Adorem
(aka Christophe)
March 16, 2025, 7:33pm
45
Hello @clydebarrow ,
FYI I give a try to:
external_components:
- source: github://pr#8383
components: [mipi_spi]
refresh: 1h
- source: github://pr#8386
components: [spi]
refresh: 1h
spi:
- type: octal
id: octal_spi
clk_pin: 47
data_pins:
- 9
- ignore_strapping_warning: true
number: 46
- ignore_strapping_warning: true
number: 3
- 8
- 18
- 17
- 16
- 15
i2c:
frequency: 400kHz
sda: 6
scl: 5
touchscreen:
- platform: ft63x6
id: my_touchscreen
interrupt_pin: 7
display: w32_disp
psram:
speed: 80MHz
display:
- platform: mipi_spi
id: w32_disp
model: wt32-sc01-plus
reset_pin: GPIO4
auto_clear_enabled: false
update_interval: never
show_test_card: false
lvgl:
# Will show a "hello world" page as is. Add your LVGL config here.
And this works fine with the vertical screen.
Then I try to rotate the screen with:
display:
- platform: mipi_spi
...
rotation: 270°
With this the touch [0,0] is on top right (instead of top left).
Then I try to:
touchscreen:
- platform: ft63x6
...
transform:
swap_xy: true
mirror_x: true
mirror_y: false
With this the X is fine (values between 0-480) but the Y not with values from 0 to 212.
Then to workaround this I need to:
touchscreen:
- platform: ft63x6
...
calibration:
x_min: 0
x_max: 480
y_min: 0
y_max: 320
This is probably not normal.
I found the issue - the ft63x6 driver hardcodes the x and y max values, not taking into account the axis swapping. So what you are doing is the best fix for now, but I will create a fix.
1 Like
Adorem
(aka Christophe)
March 17, 2025, 1:34pm
48
Great, tested with:
external_components:
- source: github://pr#8417
components: [ft63x6]
refresh: 1h
Then I can remove from:
touchscreen:
- platform: ft63x6
id: my_touchscreen
interrupt_pin: GPIO7
transform:
swap_xy: true
mirror_x: true
mirror_y: false
calibration:
x_min: 0
x_max: 479
y_min: 0
y_max: 319
the calibration:
part.
The transform:
is still required. I assume this is normal and can’t be assumed from the display setting rotation: 270°
.
Right?
Thank you again for all this!
Adorem
(aka Christophe)
March 17, 2025, 6:44pm
49
Hum I don’t know why but I have now a rendering issue with objects alligned on others objects.
I write this as an example:
lvgl:
widgets:
- obj:
id: lvgl_1
height: 20%
width: 25%
border_color: lime
border_width: 5
align: CENTER
pad_all: 0
- obj:
id: lvgl_2
height: 20%
width: 25%
border_color: red
border_width: 5
align_to:
id: lvgl_1
align: OUT_RIGHT_TOP
pad_all: 0
- obj:
id: lvgl_3
height: 20%
width: 15%
border_color: blue
border_width: 5
align_to:
id: lvgl_1
align: OUT_LEFT_TOP
pad_all: 0
And expect to have the green rectangle on the center and the red on his right and the blue on his left.
But both goes to the top left of the screen:
Unless you really know what you are doing, I would avoid using align_to
. It is only useful in certain corner cases. Use wrappers and layouts.
You mean the touchscreen transform? Yes, this is required. There is no reliable way to derive that from the display rotation because in many cases the touchscreen has one axis mirrored with respect to the display so the transform that the touchscreen needs for a given rotation is not the same as the display transform.
It would be possible to make it work automagically for the default case, but I think it’s probably better not to try, as it will fail sometimes and cause more confusion.
Another approach would be to add specific models to the touchscreen component which, like the display models, could have that knowledge baked in, but that’s for another day.
Rofo
(Ro)
March 22, 2025, 4:08pm
51
Not for the first time, the latest esphome update (2025.3.0) has slightly broken my touchscreen config for my WT32-SC01 PLUS.
Originally, I was using the following config, which worked fine:-
touchscreen:
- platform: ft63x6
id: device_touchscreen
interrupt_pin: GPIO7
transform:
swap_xy: true
mirror_x: true
(I have the screen in landscape mode, with the cable to the left).
However, after making some code changes and recompiling, I’ve had to change my config as follows to keep the touchscreen areas working correctly:-
touchscreen:
- platform: ft63x6
id: device_touchscreen
interrupt_pin: GPIO7
transform:
swap_xy: true
mirror_x: false
mirror_y: true
calibration:
x_min: 0
x_max: 479
y_min: 0
y_max: 319
Basically mirror_x and mirror_y have flipped, and I now need the calibration entries, otherwise y starts from 107, not 0.
1 Like
Can someone post his complete setup yaml (esp config, display, touch) to get a starting point?
Trying to get my WT32-SC01 PLUS working with ESPHome (2025.3.3) + LVGL …
I’d like to know this as well, my current build works but it’s a couple months old and now it won’t build without errors.
I tried to compile with this code:
external_components:
- source: github://pr#6537
components: [ io_bus, i80, spi, ili9xxx ]
i80:
- id: i80bus
dc_pin: GPIO0
wr_pin: GPIO47
data_pins:
- GPIO9
- GPIO46
- GPIO3
- GPIO8
- GPIO18
- GPIO17
- GPIO16
- GPIO15
display:
- platform: ili9xxx
model: ST7789V
bus_type: i80
reset_pin: GPIO4
data_rate: 20MHZ
pixel_mode: 18bit
color_order: bgr
invert_colors: true
dimensions:
width: 480
height: 320
transform:
swap_xy: true
auto_clear_enabled: false
But got this error:
Trying the other PR I get the error:
Platform not found: ‘display.mipi_spi’.
esphome:
name: wt32-sc01-plus
esp32:
board: esp32-s3-devkitc-1
framework:
type: esp-idf
sdkconfig_options:
CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y"
CONFIG_ESP32S3_DATA_CACHE_64KB: "y"
CONFIG_SPIRAM_FETCH_INSTRUCTIONS: y
CONFIG_SPIRAM_RODATA: y
logger:
power_supply:
- id: backlight
enable_on_boot: true
pin:
ignore_strapping_warning: true
number: GPIO45
i2c:
frequency: 400kHz
sda: 6
scl: 5
touchscreen:
- platform: ft63x6
id: my_touchscreen
interrupt_pin: 7
transform:
swap_xy: true
mirror_y: true
mirror_x: false
psram:
speed: 80MHz
external_components:
- source: github://clydebarrow/esphome@mipi-spi
components: [spi, mipi_spi, const]
refresh: 1h
spi:
- type: octal
id: octal_spi
clk_pin: 47
data_pins:
- 9
- ignore_strapping_warning: true
number: 46
- ignore_strapping_warning: true
number: 3
- 8
- 18
- 17
- 16
- 15
display:
- platform: mipi_spi
id: w32_disp
model: wt32-sc01-plus
data_rate: 10MHz
rotation: 90
lvgl:
AWESOME! Works with 2025.3.3.
Thanks a lot Clyde.
Just one more question regarding the external components:
external_components:
- source: github://clydebarrow/esphome@mipi-spi
components: [spi, mipi_spi, const]
refresh: 1h
Will they be available for a while or what is the current plan for native ESPHome integration?
Thanks again for your great support.
Ok thanks for the info.
I am loading JPG images to be displayed in my LVGL section:
lvgl:
pages:
# PAGE: Relay
- id: p_test
bg_color: 0x000000
widgets:
- image:
src: img_test
x: 0
y: 0
width: 480
height: 320
# + ASSETS --------------------- #
image:
# Test Image
- file: "assets/wt32/img_01.jpg"
id: img_test
type: RGB565
resize: 480x320
# - ASSETS --------------------- #
But the WT32 space quickly fills up using the internal storage. Since the WT32 has an SD card reader has anybody implemented this function how to read the image from SD? I never used the SD slot in my ESPHome projects so far …
There is no native integration for the SD card. But with 16MB flash, even though you can effectively only use half if doing OTA, you should have space for 20 or so full screen images. And you can use online_image
to download images at runtime.
Thanks clyde … will look into the online_image option.
Would be cool for an official SD CARD implementation. I saw some external components try to tackle this issue … maybe I will try those.