esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 34 forks source link

RPI_DPI_RGB display will not compile #5664

Closed LilDucky closed 4 months ago

LilDucky commented 5 months ago

The problem

I am attempting to configure the RPI_DPI_RGB display driver for the ESP32-8048S070 development board. This has an ESP32-S3, 7 inch RGB display, GT911 touch screen and a plethora of other handy features.

The problem When compiling a basic YAML configuration I get the following error.

src/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp: In member function 'virtual void esphome::rpi_dpi_rgb::RpiDpiRgb::setup()':
src/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp:10:3: error: 'esp_lcd_rgb_panel_config_t' was not declared in this scope
   esp_lcd_rgb_panel_config_t config{};
   ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp:10:3: note: suggested alternative: 'esp_lcd_panel_init'
   esp_lcd_rgb_panel_config_t config{};
   ^~~~~~~~~~~~~~~~~~~~~~~~~~
   esp_lcd_panel_init
src/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp:11:3: error: 'config' was not declared in this scope
   config.flags.fb_in_psram = 1;
   ^~~~~~
src/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp:11:3: note: suggested alternative: 'confstr'
   config.flags.fb_in_psram = 1;
   ^~~~~~
   confstr
src/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp:35:19: error: 'esp_lcd_new_rgb_panel' was not declared in this scope
   esp_err_t err = esp_lcd_new_rgb_panel(&config, &this->handle_);
                   ^~~~~~~~~~~~~~~~~~~~~
src/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp:35:19: note: suggested alternative: 'esp_lcd_panel_set_gap'
   esp_err_t err = esp_lcd_new_rgb_panel(&config, &this->handle_);
                   ^~~~~~~~~~~~~~~~~~~~~
                   esp_lcd_panel_set_gap
*** [.pioenvs\displaytest\src\esphome\components\rpi_dpi_rgb\rpi_dpi_rgb.o] Error 1
Compiling .pioenvs\displaytest\src\esphome\core\helpers.o

Which version of ESPHome has the issue?

latest and dev. Clean install of python, ESPHome etc did not change the issue

What type of installation are you using?

pip

Which version of Home Assistant has the issue?

NA

What platform are you using?

ESP32-IDF

Board

ESP32-8048S070

Component causing the issue

RPI_DPI_RGB display driver

Example YAML snippet

substitutions:
  esphome_name: displaytest

esphome:
  name: "${esphome_name}"

esp32:
  board: esp32dev
  variant: esp32s3
  #  board: ESP32-8048S070
  framework:
    type: esp-idf
    version: recommended

psram:
  mode: octal
  speed: 80MHz

# Enable logging
logger:

display:
  - platform: rpi_dpi_rgb
    id: S070
    data_pins:
        red:
            - 45        #r1
            - 48        #r2
            - 47        #r3
            - 21        #r4
            - 14        #r5
        green:
            - 9         #g0
            - 46        #g1
            - 3         #g2
            - 8         #g3
            - 16        #g4
            - 1         #g5
        blue:
            - 15        #b1
            - 7         #b2
            - 6         #b3
            - 5         #b4
            - 4         #b5
    de_pin:
        number: 41
    pclk_pin: 42
    hsync_pin: 39
    vsync_pin: 40
    hsync_pulse_width: 30
    hsync_front_porch: 210
    hsync_back_porch: 16
    vsync_pulse_width: 13
    vsync_front_porch: 22
    vsync_back_porch: 10
    update_interval: never
    auto_clear_enabled: false
    color_order: RGB
    dimensions:
        width: 800
        height: 480
    pclk_frequency: 16MHz
    pclk_inverted: true
    rotation: 90

Anything in the logs that might be useful for us?

C:\Users\simon\esphome>esphome compile DisplayTest1.yml
INFO ESPHome 2024.3.1
INFO Reading configuration DisplayTest1.yml...
INFO Generating C++ source...
INFO Compiling app...
Processing displaytest (board: esp32dev; framework: espidf; platform: platformio/espressif32@5.4.0)
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (5.4.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
 - framework-espidf @ 3.40406.240122 (4.4.6)
 - tool-cmake @ 3.16.4
 - tool-esptoolpy @ 1.40400.0 (4.4.0)
 - tool-idf @ 1.0.1
 - tool-mconf @ 1.4060000.20190628 (406.0.0)
 - tool-ninja @ 1.9.0
 - toolchain-esp32ulp @ 2.35.0-20220830
 - toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Creating a new virtual environment for IDF Python dependencies
Installing ESP-IDF's Python dependencies
Collecting urllib3<2
  Downloading urllib3-1.26.18-py2.py3-none-any.whl.metadata (48 kB)
     -------------------------------------- 48.9/48.9 kB 415.8 kB/s eta 0:00:00
Collecting cryptography<35.0.0,>=2.1.4
  Downloading cryptography-3.4.8-cp36-abi3-win_amd64.whl.metadata (5.1 kB)
Collecting future>=0.18.3
  Downloading future-1.0.0-py3-none-any.whl.metadata (4.0 kB)
Collecting pyparsing<2.4.0,>=2.0.3
  Downloading pyparsing-2.3.1-py2.py3-none-any.whl.metadata (1.0 kB)
Collecting kconfiglib~=13.7.1
  Using cached kconfiglib-13.7.1-py2.py3-none-any.whl.metadata (39 kB)
Collecting idf-component-manager~=1.0
  Downloading idf_component_manager-1.5.2-py2.py3-none-any.whl.metadata (12 kB)
Collecting cffi>=1.12 (from cryptography<35.0.0,>=2.1.4)
  Using cached cffi-1.16.0-cp312-cp312-win_amd64.whl.metadata (1.5 kB)
Collecting packaging (from idf-component-manager~=1.0)
  Using cached packaging-24.0-py3-none-any.whl.metadata (3.2 kB)
Collecting requests<3 (from idf-component-manager~=1.0)
  Using cached requests-2.31.0-py3-none-any.whl.metadata (4.6 kB)
Collecting requests-file<2 (from idf-component-manager~=1.0)
  Downloading requests_file-1.5.1-py2.py3-none-any.whl.metadata (596 bytes)
Collecting requests-toolbelt (from idf-component-manager~=1.0)
  Downloading requests_toolbelt-1.0.0-py2.py3-none-any.whl.metadata (14 kB)
Collecting schema (from idf-component-manager~=1.0)
  Downloading schema-0.7.5-py2.py3-none-any.whl.metadata (34 kB)
Collecting six (from idf-component-manager~=1.0)
  Using cached six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting tqdm<5 (from idf-component-manager~=1.0)
  Downloading tqdm-4.66.2-py3-none-any.whl.metadata (57 kB)
     ---------------------------------------- 57.6/57.6 kB 1.5 MB/s eta 0:00:00
Collecting colorama (from idf-component-manager~=1.0)
  Using cached colorama-0.4.6-py2.py3-none-any.whl.metadata (17 kB)
Collecting pyyaml>5.2 (from idf-component-manager~=1.0)
  Using cached PyYAML-6.0.1-cp312-cp312-win_amd64.whl.metadata (2.1 kB)
Collecting cachecontrol>0.12.6 (from cachecontrol[filecache]>0.12.6; python_version >= "3.6"->idf-component-manager~=1.0)
  Downloading cachecontrol-0.14.0-py3-none-any.whl.metadata (3.1 kB)
Collecting contextlib2>0.6.0 (from idf-component-manager~=1.0)
  Downloading contextlib2-21.6.0-py2.py3-none-any.whl.metadata (4.1 kB)
Collecting click (from idf-component-manager~=1.0)
  Using cached click-8.1.7-py3-none-any.whl.metadata (3.0 kB)
Collecting msgpack<2.0.0,>=0.5.2 (from cachecontrol>0.12.6->cachecontrol[filecache]>0.12.6; python_version >= "3.6"->idf-component-manager~=1.0)
  Downloading msgpack-1.0.8-cp312-cp312-win_amd64.whl.metadata (9.4 kB)
Collecting filelock>=3.8.0 (from cachecontrol[filecache]>0.12.6; python_version >= "3.6"->idf-component-manager~=1.0)
  Downloading filelock-3.13.3-py3-none-any.whl.metadata (2.8 kB)
Collecting pycparser (from cffi>=1.12->cryptography<35.0.0,>=2.1.4)
  Using cached pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
Collecting charset-normalizer<4,>=2 (from requests<3->idf-component-manager~=1.0)
  Using cached charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl.metadata (34 kB)
Collecting idna<4,>=2.5 (from requests<3->idf-component-manager~=1.0)
  Using cached idna-3.6-py3-none-any.whl.metadata (9.9 kB)
Collecting certifi>=2017.4.17 (from requests<3->idf-component-manager~=1.0)
  Using cached certifi-2024.2.2-py3-none-any.whl.metadata (2.2 kB)
Downloading urllib3-1.26.18-py2.py3-none-any.whl (143 kB)
   ---------------------------------------- 143.8/143.8 kB 1.2 MB/s eta 0:00:00
Downloading cryptography-3.4.8-cp36-abi3-win_amd64.whl (1.6 MB)
   ---------------------------------------- 1.6/1.6 MB 1.9 MB/s eta 0:00:00
Downloading future-1.0.0-py3-none-any.whl (491 kB)
   ---------------------------------------- 491.3/491.3 kB 2.8 MB/s eta 0:00:00
Downloading pyparsing-2.3.1-py2.py3-none-any.whl (61 kB)
   ---------------------------------------- 61.8/61.8 kB 3.4 MB/s eta 0:00:00
Using cached kconfiglib-13.7.1-py2.py3-none-any.whl (145 kB)
Downloading idf_component_manager-1.5.2-py2.py3-none-any.whl (160 kB)
   ---------------------------------------- 160.3/160.3 kB 3.2 MB/s eta 0:00:00
Downloading cachecontrol-0.14.0-py3-none-any.whl (22 kB)
Using cached cffi-1.16.0-cp312-cp312-win_amd64.whl (181 kB)
Downloading contextlib2-21.6.0-py2.py3-none-any.whl (13 kB)
Using cached PyYAML-6.0.1-cp312-cp312-win_amd64.whl (138 kB)
Using cached requests-2.31.0-py3-none-any.whl (62 kB)
Downloading requests_file-1.5.1-py2.py3-none-any.whl (3.7 kB)
Downloading tqdm-4.66.2-py3-none-any.whl (78 kB)
   ---------------------------------------- 78.3/78.3 kB 2.1 MB/s eta 0:00:00
Using cached click-8.1.7-py3-none-any.whl (97 kB)
Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB)
Using cached packaging-24.0-py3-none-any.whl (53 kB)
Downloading requests_toolbelt-1.0.0-py2.py3-none-any.whl (54 kB)
   ---------------------------------------- 54.5/54.5 kB 1.4 MB/s eta 0:00:00
Downloading schema-0.7.5-py2.py3-none-any.whl (17 kB)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Using cached certifi-2024.2.2-py3-none-any.whl (163 kB)
Using cached charset_normalizer-3.3.2-cp312-cp312-win_amd64.whl (100 kB)
Downloading filelock-3.13.3-py3-none-any.whl (11 kB)
Using cached idna-3.6-py3-none-any.whl (61 kB)
Downloading msgpack-1.0.8-cp312-cp312-win_amd64.whl (75 kB)
   ---------------------------------------- 75.3/75.3 kB 4.1 MB/s eta 0:00:00
Using cached pycparser-2.22-py3-none-any.whl (117 kB)
Installing collected packages: pyparsing, urllib3, six, pyyaml, pycparser, packaging, msgpack, kconfiglib, idna, future, filelock, contextlib2, colorama, charset-normalizer, certifi, tqdm, schema, requests, click, cffi, requests-toolbelt, requests-file, cryptography, cachecontrol, idf-component-manager
Successfully installed cachecontrol-0.14.0 certifi-2024.2.2 cffi-1.16.0 charset-normalizer-3.3.2 click-8.1.7 colorama-0.4.6 contextlib2-21.6.0 cryptography-3.4.8 filelock-3.13.3 future-1.0.0 idf-component-manager-1.5.2 idna-3.6 kconfiglib-13.7.1 msgpack-1.0.8 packaging-24.0 pycparser-2.22 pyparsing-2.3.1 pyyaml-6.0.1 requests-2.31.0 requests-file-1.5.1 requests-toolbelt-1.0.0 schema-0.7.5 six-1.16.0 tqdm-4.66.2 urllib3-1.26.18
Installing windows-curses package
Collecting windows-curses
  Downloading windows_curses-2.3.2-cp312-cp312-win_amd64.whl.metadata (2.7 kB)
Downloading windows_curses-2.3.2-cp312-cp312-win_amd64.whl (80 kB)
   ---------------------------------------- 80.5/80.5 kB 562.4 kB/s eta 0:00:00
Installing collected packages: windows-curses
Successfully installed windows-curses-2.3.2
Installing windows-curses package
Processing c:\users\simon\.platformio\packages\framework-espidf\tools\kconfig_new\esp-windows-curses
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Requirement already satisfied: windows-curses in c:\users\simon\.platformio\penv\.espidf-4.4.6\lib\site-packages (from esp-windows-curses==0.1) (2.3.2)
Building wheels for collected packages: esp-windows-curses
  Building wheel for esp-windows-curses (pyproject.toml): started
  Building wheel for esp-windows-curses (pyproject.toml): finished with status 'done'
  Created wheel for esp-windows-curses: filename=esp_windows_curses-0.1-py3-none-any.whl size=1167 sha256=57bc264f68a456a3c5d059b9d8173938c7f67a48a75d1d857e04ce408f895a48
  Stored in directory: c:\users\simon\appdata\local\pip\cache\wheels\1b\d0\81\36fe1ca212effe933ad1e6540447a1d8ba214c3aeadacd3299
Successfully built esp-windows-curses
Installing collected packages: esp-windows-curses
Successfully installed esp-windows-curses-0.1
Reading CMake configuration...
Generating assembly for certificate bundle...
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ off, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pioenvs\displaytest\src\esphome\components\display\display.o
Compiling .pioenvs\displaytest\src\esphome\components\display\display_buffer.o
Compiling .pioenvs\displaytest\src\esphome\components\display\rect.o
Compiling .pioenvs\displaytest\src\esphome\components\esp32\core.o
Compiling .pioenvs\displaytest\src\esphome\components\esp32\gpio.o
Compiling .pioenvs\displaytest\src\esphome\components\esp32\preferences.o
Compiling .pioenvs\displaytest\src\esphome\components\logger\logger.o
Compiling .pioenvs\displaytest\src\esphome\components\logger\logger_esp32.o
Compiling .pioenvs\displaytest\src\esphome\components\logger\logger_esp8266.o
Compiling .pioenvs\displaytest\src\esphome\components\logger\logger_host.o
Compiling .pioenvs\displaytest\src\esphome\components\logger\logger_libretiny.o
Compiling .pioenvs\displaytest\src\esphome\components\logger\logger_rp2040.o
Compiling .pioenvs\displaytest\src\esphome\components\psram\psram.o
Compiling .pioenvs\displaytest\src\esphome\components\rpi_dpi_rgb\rpi_dpi_rgb.o
Compiling .pioenvs\displaytest\src\esphome\core\application.o
Compiling .pioenvs\displaytest\src\esphome\core\color.o
Compiling .pioenvs\displaytest\src\esphome\core\component.o
Compiling .pioenvs\displaytest\src\esphome\core\component_iterator.o
Compiling .pioenvs\displaytest\src\esphome\core\controller.o
Compiling .pioenvs\displaytest\src\esphome\core\entity_base.o
src/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp: In member function 'virtual void esphome::rpi_dpi_rgb::RpiDpiRgb::setup()':
src/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp:10:3: error: 'esp_lcd_rgb_panel_config_t' was not declared in this scope
   esp_lcd_rgb_panel_config_t config{};
   ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp:10:3: note: suggested alternative: 'esp_lcd_panel_init'
   esp_lcd_rgb_panel_config_t config{};
   ^~~~~~~~~~~~~~~~~~~~~~~~~~
   esp_lcd_panel_init
src/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp:11:3: error: 'config' was not declared in this scope
   config.flags.fb_in_psram = 1;
   ^~~~~~
src/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp:11:3: note: suggested alternative: 'confstr'
   config.flags.fb_in_psram = 1;
   ^~~~~~
   confstr
src/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp:35:19: error: 'esp_lcd_new_rgb_panel' was not declared in this scope
   esp_err_t err = esp_lcd_new_rgb_panel(&config, &this->handle_);
                   ^~~~~~~~~~~~~~~~~~~~~
src/esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp:35:19: note: suggested alternative: 'esp_lcd_panel_set_gap'
   esp_err_t err = esp_lcd_new_rgb_panel(&config, &this->handle_);
                   ^~~~~~~~~~~~~~~~~~~~~
                   esp_lcd_panel_set_gap
*** [.pioenvs\displaytest\src\esphome\components\rpi_dpi_rgb\rpi_dpi_rgb.o] Error 1
Compiling .pioenvs\displaytest\src\esphome\core\helpers.o
================================================================ [FAILED] Took 77.70 seconds ================================================================

Additional information

No response

LilDucky commented 4 months ago

Built a docker instance of ESPhome and get the same issue trying to build.

Does not look platform related to me.

clydebarrow commented 4 months ago

You need to choose a board that has an ESP32-S3. esp32dev is an ESP32, not an S3. The variant setting does not override that.

martijnbuts commented 4 months ago

@LilDucky Did you test the config again with the esp32-s3 board and does the screen work now? I can compile the config with esp32: board: esp32-s3-devkitc-1 variant: esp32s3 framework: type: esp-idf platform_version: 6.6.0 version: 5.1.2

board: ESP32-8048S070

sdkconfig_options: 

but i do not get a correct screen image esp32-large-display (2).txt

LilDucky commented 4 months ago

@LilDucky Did you test the config again with the esp32-s3 board and does the screen work now? I can compile the config with esp32: board: esp32-s3-devkitc-1 variant: esp32s3 framework: type: esp-idf platform_version: 6.6.0 version: 5.1.2 #board: ESP32-8048S070 sdkconfig_options:

but i do not get a correct screen image esp32-large-display (2).txt

It compiles for me but I get a band of random pixels across the bottom 10mm of the display.

martijnbuts commented 4 months ago

@LilDucky Did you test the config again with the esp32-s3 board and does the screen work now? I can compile the config with esp32: board: esp32-s3-devkitc-1 variant: esp32s3 framework: type: esp-idf platform_version: 6.6.0 version: 5.1.2 #board: ESP32-8048S070 sdkconfig_options: but i do not get a correct screen image esp32-large-display (2).txt

It compiles for me but I get a band of random pixels across the bottom 10mm of the display.

Please try this config, it works for me https://github.com/clowrey/esphome-sunton-esp32-8048s070c