5inch display ILI6122 & ILI5960 need help to add it to ESPHome

Hi Radon240 Maxim and cotthemh Herwig
my display works fine.


The problem may be in the parameter settings in elecrow-esp32-s3-tft-50.ini
In the original libraries “LovyanGFX Library” and “Ardunio_GFX Library” Bus Settings, when I searched for the background of connecting the display and the touchpad, there are different values.
I would try to compile openHASP with this other values.
As:

...
    ; Panel Settings ILI6122/LI5960
    -D TFT_WIDTH=800            ;800 /* width */,
    -D TFT_HEIGHT=480           ;480 /* height */, 

    -D TFT_HSYNC_POLARITY=0     ;0 /* hsync_polarity */,
    -D TFT_HSYNC_FRONT_PORCH=8  ;8 /* hsync_front_porch */, 
    -D TFT_HSYNC_PULSE_WIDTH=1  ;???Pio_4 /* hsync_pulse_width */ ???Ard_1 /* hsync_pulse_width */,
    -D TFT_HSYNC_BACK_PORCH=32  ;???Pio_43 /* hsync_back_porch */,???Ard_32 /* hsync_back_porch */,    
    -D TFT_VSYNC_POLARITY=0     ;0 /* vsync_polarity */,
    -D TFT_VSYNC_FRONT_PORCH=8  ;8 /* vsync_front_porch */,  
    -D TFT_VSYNC_PULSE_WIDTH=1  ;???Pio_4 /* vsync_pulse_width */ ???Ard_1 /* vsync_pulse_width */,   
    -D TFT_VSYNC_BACK_PORCH=8   ;Pio_12 /* vsync_back_porch */ ???Ard_ 8 /* vsync_back_porch */,   
    -D TFT_PCLK_ACTIVE_NEG=1    ;1 /* pclk_active_neg */,
    -D TFT_PREFER_SPEED=16000000  ;16000000 /* prefer_speed */
    -D TFT_AUTO_FLUSH=1         ;true /* auto_flush */
...

???Pio_x value is from PlatformIO Elecrow demo projects.
???Ard_x value is from Arduino Elecrow demo projects.
I did not deal with the values in more detail, because my display worked well the first time.

Here is a link to a modified download of the zipped openHASP project

modified openHASP v0.7.0 project

elecrow-s3-8048c050-ota-v0-7-0-rc8-6cf4262.bin file

Try my bin. openHASP version is v0.7.0
elecrow-s3-8048c050-ota-v0-7-0-rc8-6cf4262.bin

Hello everyone,
I saw that ESPHome has just added the driver:

Has anyone tried with an Elecrow ESP?

Hi,
Elecrow 7inch ( not 5inch ) added to openHASP.
For those who want to try, it’s the Crowpanel 7" model on the openHASP Nightly page.

https://nightly.openhasp.com/

I’ve update by OTA, from 0.7.0-rc8 to 0.7.0-rc12 version. It’s good.
If you have any issues, report them on this issue CrowPanel 7 Inch support. · Issue #684 · HASwitchPlate/openHASP · GitHub

Hi,
for those who have the 5 inch model, it has been added and will be available in the next release. :wink:
Thank to marsman7.

EDIT 2024/05/24:
Hi,
5 inch model, add to flash page. have fun !

Yes, and I’ve put together a cut down template which initialises the display, touchscreen and backlight (as a monochromatic light) here:

I’ve developed and tested this with ESPhome 2024.5.5 and a panel marked with as “Wizee-ESP32” / “WZ8048C050”

The pclk_frequency has taken some balancing - examples online have it around 16 MHz, but that seems to cause significant issues with WiFi on my board. Reducing the frequency improves things, but it becomes a balance between an audible (to me) whistle vs a slight flicker.

2 Likes

Hi caelor

Thats a start. Tried to adapt to the 7 inch version that has different pin definition. I have still issue with the output. The test card seems not to show it rather changes the whole display to different colors and the shows a black one. the lambda test circles and such you defined are not showing at all.

Any idea where I am wrong? here my yaml

esphome:
  name: elecrow7
  friendly_name: elecrow7

  platformio_options:
    # see https://community.home-assistant.io/t/esp32-with-esp-idf-framework-running-into-a-boot-loop/567305/11
    board_build.flash_mode: dio

    # see https://community.home-assistant.io/t/esp32-s3-devkitc-1-n16r8-using-psram-howto/652601
    build_flags: "-DBOARD_HAS_PSRAM"

esp32:
  board: esp32-s3-devkitc-1
  framework:
    #type: arduino
    type: esp-idf

psram:
  mode: octal
  speed: 80MHz

# Enable logging
logger:
  level: DEBUG

# Enable Home Assistant API
api:
  encryption:
    key: "iwLC0gi1Rn....BNMEE8e7pcP9h5qc="

ota:
  password: "9228f9283....4488bb2"

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

  # see https://www.reddit.com/r/Esphome/comments/13ee5n8/comment/jjptvux/
  power_save_mode: none

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Elecrow7 Fallback Hotspot"
    password: "CM6QPAXp0Eww"

captive_portal:

i2c:
  sda: 19
  scl: 20
  scan: true

display:
  - platform: rpi_dpi_rgb
    id: disp0
    data_pins:
      red:
        - 14
        - 21
        - 47
        - 48
        - 45
      green:
        - 9
        - 46
        - 3
        - 8
        - 16 
        - 1
      blue:
        - 15
        - 7
        - 6
        - 5
        - 4
    de_pin: 41
    hsync_pin: 39
    vsync_pin: 40
    pclk_pin: 0

    hsync_front_porch: 210
    hsync_pulse_width: 4
    hsync_back_porch: 43
    vsync_front_porch: 22
    vsync_pulse_width: 4
    vsync_back_porch: 12

    pclk_inverted: true
    pclk_frequency: 8500000

    color_order: RGB

    auto_clear_enabled: false
    update_interval: 5s
    dimensions:
      width: 800
      height: 480

    show_test_card: true

    lambda: |-
      auto black = Color(0, 0, 0);
      auto red = Color(255, 0, 0);
      auto green = Color(0, 255, 0);
      auto blue = Color(0, 0, 255);
      auto white = Color(255, 255, 255);
      it.filled_circle(20, 32, 15, black);
      it.filled_circle(40, 32, 15, red);
      it.filled_circle(60, 32, 15, green);
      it.filled_circle(80, 32, 15, blue);
      it.filled_circle(100, 32, 15, white);

touchscreen:
  platform: gt911
  id: touch0
  display: disp0
  interrupt_pin: 12

output:
  - platform: ledc
    pin: 2
    id: backlight_pin

light:
  - platform: monochromatic
    output: backlight_pin
    name: "Backlight Level"
    restore_mode: RESTORE_DEFAULT_ON

sensor:
  - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
    name: "WiFi Signal dB"
    id: wifi_signal_db
    update_interval: 60s
    entity_category: "diagnostic"

and here the schematics

any hint is welcome.