Hi everyone,
I am trying to configure this waveshare display (1024x600) 5inch with esphome but I can’t find out the right display declaration (driver) to use.
Any advice?
If u need I can provide the link to the tech spcecification
Thank you
Matteo
Hi everyone,
I am trying to configure this waveshare display (1024x600) 5inch with esphome but I can’t find out the right display declaration (driver) to use.
Any advice?
If u need I can provide the link to the tech spcecification
Thank you
Matteo
That would be helpful, probably necessary.
Here the link to the product:
Here the link to the waveshare wiki:
Ps: I owned the 1024 x 600 one
Thank you very much in advance for any help
Regards
Matteo
Looks to be similar to the 4.3 board in configuration. There are topics here discussing it.
In the wiki it points to the ST7262 datasheet so I guess that is what it has.
Hi there,
Thank you very much for the support.
Right now I was able to validate the configuration of most of the code verifying all the pins and other stuff in the tech documentation of the product. What I was not able to find is the PIN about the backlight. For the CrowPanel 5.0" HMI ESP32 display (by Elecrow) I find this snippet code:
psram:
mode: octal
speed: 80MHz
output:
- platform: ledc
pin: 2
frequency: 1220
id: gpio_backlight_pwm
light:
- platform: monochromatic
output: gpio_backlight_pwm
name: Display Backlight
id: back_light
restore_mode: ALWAYS_ON
I have a lot of doubt about the Pin, probably is not 2 and about the others parameters.
Could you please help?
Thank You in advance
Regards
The backlight will be the DISP pin in the I/O table - pin 2 on the CH422 expander. It won’t be usable with PWM so you’ll just have to use a binary light.
Thank you for the support. Clear for the pin.
I don’t know what to do with the code. Is it right in that way? I mean the one in my previous post.
Thanks
Hello,
I want to ask you if you got it working.
Thanks in advance!
Hello,
yes. I do.
Matteo
Hello, could you please share the code? I’m having trouble configuring it. I have a version with 1024x600 pixels. I can get the screen to work without touch functionality or the touch to work without the display. Your help would be greatly appreciated!
@Arkady0 or @Scarpetta3
I have got the same display, brought it accidently should of got one that was better supported by ESPhome. Would you be able to share your YAML as this is my first time and I haven’t been able to get it to work?
@Arkady0 @bryce-evenden
I bought one of those, also in the hopes that ESPHome would support it out of the box, and in fact it almost does. The changes required to the configs that work for the supported boards are not that huge and I have put the version that works for me on Codeberg.
Compared to the config I started out with one or two of the EXIO pins were different but the most relevant part was the pixel clock and the vsync/hsync timings. The key to getting those right was just looking at the Waveshare-provided demo code in “waveshare_rgb_lcd_port.c” that had all the relevant numbers.
I haven’t done any in-depth testing yet but this config shows the lvgl demo page without a hitch and correctly reads the touchscreen, so I’m not really expecting any significant problems.
I don’t use ESPHome all that much and the fact that I combine the devices with OpenHAB and not Home Assistant likely makes me the odd duck out, but if anyone has any pointers on where to start/read up I’m willing to try to polish this to the extent that it could be added to esphome as a supported board/display model/whatever is appropriate.
Hello,
sorry for my late reply but it’s a very busy time for me.
My code, with some extra snippet for lvgl and sensors, for the display is like this:
esphome:
name: meter-display
friendly_name: Meter Display
platformio_options:
build_flags:
- "-DBOARD_HAS_PSRAM"
- "-DLV_CONF_INCLUDE_SIMPLE"
- "-DLV_USE_CHART=1"
board_build.esp-idf.memory_type: qio_opi
board_build.flash_mode: dio
board_build.partitions: /config/esphome/partizioni_8mb.csv
esp32:
board: esp32-s3-devkitc-1
flash_size: 8MB
framework:
type: esp-idf
sdkconfig_options:
CONFIG_FREERTOS_HZ: "1000"
CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240: y
CONFIG_SPIRAM_MODE_OCT: y
CONFIG_IDF_EXPERIMENTAL_FEATURES: 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: "XXXXXXXXXXXXXXXXXXXX"
time:
- platform: homeassistant
id: homeassistant_time
ota:
- platform: esphome
password: "XXXXXXXXXXXXXXXXXXXXX"
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
reset_pin:
ch422g: ch422g_hub
number: 1
on_touch:
- lambda: |-
ESP_LOGI("Touch", "Touch detected at x=%d, y=%d", touch.x, touch.y);
// Se la retroilluminazione è spenta, la riaccendiamo
if (!id(backlight_switch).state) {
id(backlight_switch).turn_on();
ESP_LOGI("Backlight", "Backlight turned ON due to touch");
// Abilita auto-off se necessario
id(auto_off_enabled) = true;
id(auto_off_timeout) = 60; // qui puoi usare il valore dello slider se vuoi
}
display:
- platform: rpi_dpi_rgb
id: main_display
auto_clear_enabled: false
show_test_card: false
update_interval: never
color_order: RGB
pclk_frequency: 16MHz
dimensions:
width: 1024
height: 600
reset_pin:
ch422g: ch422g_hub
number: 3
de_pin:
number: 5
hsync_pin:
number: 46
ignore_strapping_warning: true
vsync_pin:
number: 3
ignore_strapping_warning: true
pclk_pin: 7
pclk_inverted: true
hsync_back_porch: 40
hsync_front_porch: 220
hsync_pulse_width: 30
vsync_back_porch: 8
vsync_front_porch: 4
vsync_pulse_width: 4
data_pins:
red:
- 1
- 2
- 42
- 41
- 40
blue:
- 14
- 38
- 18
- 17
- 10
green:
- 39
- 0
- 45
- 48
- 47
- 21
font:
- !include fonts/montserrat_16_special.yaml
- !include fonts/montserrat_18_special.yaml
- !include fonts/montserrat_20_special.yaml
- !include fonts/montserrat_24_special.yaml
- !include fonts/montserrat_30_special.yaml
- !include fonts/montserrat_32_special.yaml
- !include fonts/montserrat_36_special.yaml
- !include fonts/montserrat_48_special.yaml
- !include fonts/montserrat_64_special.yaml
- !include fonts/montserrat_72_special.yaml
- !include fonts/montserrat_300_special.yaml
- !include fonts/awesome_16.yaml
- !include fonts/awesome_48.yaml
- !include fonts/awesome_128.yaml
ch422g:
- id: ch422g_hub
# Backlight
output:
- platform: ledc
pin: GPIO44
id: backlight
light:
- platform: monochromatic
output: backlight
name: backlight
id: backlight_light
restore_mode: ALWAYS_ON
switch:
- platform: homeassistant
name: "Madia"
entity_id: switch.madia
id: ha_madia
- platform: gpio
name: backlight switch
id: backlight_switch
pin:
ch422g: ch422g_hub
number: 2
internal: true
restore_mode: ALWAYS_ON
- platform: template
name: antiburn
icon: mdi:television-shimmer
optimistic: true
entity_category: "config"
turn_on_action:
- logger.log: "Starting Antiburn"
- if:
condition: lvgl.is_paused
then:
- lvgl.resume:
- lvgl.widget.redraw:
- lvgl.pause:
show_snow: true
turn_off_action:
- logger.log: "Stopping Antiburn"
- if:
condition: lvgl.is_paused
then:
- lvgl.resume:
- lvgl.widget.redraw:
sensor:
- !include sensors/pm1.yaml
- !include sensors/pm25.yaml
- !include sensors/pm4.yaml
- !include sensors/pm10.yaml
- !include sensors/co2.yaml
- !include sensors/voc.yaml
- !include sensors/nox.yaml
- !include sensors/temp.yaml
- !include sensors/humidity.yaml
binary_sensor:
- !include binary_sensors/bagno_finestrato.yaml
lvgl:
displays: main_display
buffer_size: 100%
pages:
- !include pages/page1_homepage.yaml
- !include pages/page0_pagesettings.yaml
- !include pages/page2_roomselect.yaml
- !include pages/page3_functionselect_zg.yaml
- !include pages/page4_functionselect_cdl.yaml
- !include pages/page5_functionselect_cd.yaml
- !include pages/page6_functionselect_cs.yaml
- !include pages/page7_functionselect_bc.yaml
- !include pages/page8_functionselect_bf.yaml
- !include pages/page9_functionselect_r.yaml
- !include pages/page10_monitor_zg.yaml
- !include pages/page17_control_zg.yaml
- !include pages/page24_graphic_zg.yaml
Hello @clydebarrow,
thank you very much for the link to the PR.
Can I ask you please to validate the display snippet that I change as follow (comment on dimensions and hsync/vsync):
external_components:
- source: github://pr#11206
components: [mipi_rgb]
refresh: 1h
display:
- platform: mipi_rgb
id: main_display
model: WAVESHARE-5-1024X600
auto_clear_enabled: false
show_test_card: false
update_interval: never
color_order: RGB
pclk_frequency: 16MHz
# dimensions:
# width: 1024
# height: 600
reset_pin:
ch422g: ch422g_hub
number: 3
de_pin:
number: 5
hsync_pin:
number: 46
ignore_strapping_warning: true
vsync_pin:
number: 3
ignore_strapping_warning: true
pclk_pin: 7
pclk_inverted: true
# hsync_back_porch: 40
# hsync_front_porch: 220
# hsync_pulse_width: 30
# vsync_back_porch: 8
# vsync_front_porch: 4
# vsync_pulse_width: 4
data_pins:
red:
- 1
- 2
- 42
- 41
- 40
blue:
- 14
- 38
- 18
- 17
- 10
green:
- 39
- 0
- 45
- 48
- 47
- 21
Thank You very much in advance
Regards
Matteo
Not sure what you mean by validate, but you can delete everything in the display config after the model line - see the example in the PR comment.
Thank You very much for your answer!! Everything is clear and it’s working great!
If possible, I’d like to take advantage of your kindly availability for some more questions about this piece of hardware.
Thank You very much
Regards
Matteo
I figured I’d jump in here as I’m currently using the ESP32-S3-Touch-LCD 5B to make a smart thermostat with ESPHome. With the help of this thread and other similar ones I’ve gotten the screen connected to ESPHome, the backlight turning on and off and some basic LVGL buttons and widgets functioning. The last thing I need to figure out is the best way to turn on & off the boiler which only requires to close a low voltage (24v) switch. In the past I’ve accomplished this with an ESP32 GPIO and a relay. I’m not against doing it that way again but I’m having issues on finding solid info on what pins to use. I’m having a hard time reading the schematics. Any solid info on what pins to use would be greatly appreciated.
Possibly I could also go the DI/DO route talked about in point 4 of Scarpetta3’s post but again I’m not fully understanding how this is implemented. If this could be explained it would be appreciated.
Thanks