esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
406 stars 26 forks source link

Arduino as ESP-IDF component #2369

Open olicooper opened 10 months ago

olicooper commented 10 months ago

Describe the problem you have/What new integration you would like

Arduino can be loaded as a component over ESP-IDF as described here: https://docs.espressif.com/projects/arduino-esp32/en/latest/esp-idf_component.html and here: https://github.com/platformio/platform-espressif32/issues/24

It would be great if ESPHome would allow this configuration:

esp32:
  board: esp32dev
  framework:
    type: arduino, esp-idf

Please describe your use case for this integration and alternatives you've tried:

I would like to customise the sdkconfig compilation flags for ESP-IDF. It would also be useful for people who are migrating their code to pure ESP-IDF.

Additional context

I am trying to set custom pins for the PSRAM built in to the Sonoff NSPanel. It has 16MB PSRAM (see this link for more info), but the pins are non standard, so I need to set these flags:

CONFIG_D0WD_PSRAM_CLK_IO=5 # default: 17
CONFIG_D0WD_PSRAM_CS_IO=18 # default: 18

I have tested this using pure esp-idf and I can detect the PSRAM, but Arduino doesn't allow setting these options due to the bootloader being precompiled. The only alternative it to create a custom bootloader using https://github.com/espressif/esp32-arduino-lib-builder but I think esphome wouldn't be able to include this.

olicooper commented 10 months ago

I noticed work being done on PSRAM support here, this issue seems related (needing to change the PSRAM pins e.g. CONFIG_D0WD_PSRAM_CLK_IO)

alfwro13 commented 9 months ago

if I understand this correctly this would be a great workaround for esphome features that currently only run on arduino framework (i.e. media_player component)

Bascht74 commented 3 months ago

Hi @olicooper ,

could you share the yaml-configuration, that you used trying out the esp-idf framework with the nspanel?

Thx,

Sebastian