esphome / issues

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

Can Not Compile WLED Module #6239

Open Nicknakin opened 1 month ago

Nicknakin commented 1 month ago

The problem

Attempting to add wled: at the top level and as an effect to a light results in a compilation error.

Which version of ESPHome has the issue?

2024.8.3

What type of installation are you using?

pip

Which version of Home Assistant has the issue?

No response

What platform are you using?

RP2040

Board

pico-w

Component causing the issue

led strip

Example YAML snippet

esphome:
  name: nicksmatrix
  #web_server:
  #  port: 80

rp2040:
  board: rpipicow
  framework:
    platform_version: https://github.com/maxgerhardt/platform-raspberrypi.git

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "secretpassword"

ota:
  platform: esphome
  password: "secretpassword"

wifi:
  ssid: "WiFi"
  password: "secretpassword

  manual_ip:
    static_ip: 10.0.0.215
    gateway: 10.0.0.1
    subnet: 255.255.254.0  

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

wled:

light:
  - platform: rp2040_pio_led_strip
    rgb_order: GRB
    chipset: WS2812B
    pin: GPIO21
    num_leds: 256
    pio: 0
    name: "NeoPixel Light"
    default_transition_length: 0.1s
    effects:
      - addressable_fireworks:
      - addressable_color_wipe:
      - wled:

Anything in the logs that might be useful for us?

INFO ESPHome 2024.8.3
INFO Reading configuration nicksmatrix.yaml...
INFO Generating C++ source...
INFO Generating PIO assembly code
INFO Compiling app...
src/esphome/components/wled/wled_light_effect.cpp: In member function 'virtual void esphome::wled::WLEDLightEffect::stop()':
src/esphome/components/wled/wled_light_effect.cpp:47:9: error: invalid use of incomplete type 'class UDP'
   47 |     udp_->stop();
      |         ^~
In file included from src/esphome/components/wled/wled_light_effect.cpp:3:
src/esphome/components/wled/wled_light_effect.h:11:7: note: forward declaration of 'class UDP'
   11 | class UDP;
      |       ^~~
src/esphome/components/wled/wled_light_effect.cpp: In member function 'virtual void esphome::wled::WLEDLightEffect::apply(esphome::light::AddressableLight&, const esphome::Color&)':
src/esphome/components/wled/wled_light_effect.cpp:62:24: error: 'WiFiUDP' was not declared in this scope
   62 |     udp_ = make_unique<WiFiUDP>();
      |                        ^~~~~~~
src/esphome/components/wled/wled_light_effect.cpp:62:32: error: no matching function for call to 'make_unique<<expression error> >()'
   62 |     udp_ = make_unique<WiFiUDP>();
      |            ~~~~~~~~~~~~~~~~~~~~^~
In file included from /home/nick/.platformio/packages/toolchain-rp2040-earlephilhower/arm-none-eabi/include/c++/12.3.0/memory:75,
                 from src/esphome/core/string_ref.h:5,
                 from src/esphome/core/entity_base.h:5,
                 from src/esphome/components/light/light_state.h:4,
                 from src/esphome/components/light/addressable_light_effect.h:7,
                 from src/esphome/components/wled/wled_light_effect.h:6:
/home/nick/.platformio/packages/toolchain-rp2040-earlephilhower/arm-none-eabi/include/c++/12.3.0/bits/unique_ptr.h:1089:5: note: candidate: 'template<class _Tp, class ... _Args> std::__detail::__invalid_make_unique_t<_Tp> std::make_unique(_Args&& ...)' (deleted)
 1089 |     make_unique(_Args&&...) = delete;
      |     ^~~~~~~~~~~
/home/nick/.platformio/packages/toolchain-rp2040-earlephilhower/arm-none-eabi/include/c++/12.3.0/bits/unique_ptr.h:1089:5: note:   template argument deduction/substitution failed:
src/esphome/components/wled/wled_light_effect.cpp:62:32: error: template argument 1 is invalid
   62 |     udp_ = make_unique<WiFiUDP>();
      |            ~~~~~~~~~~~~~~~~~~~~^~
/home/nick/.platformio/packages/toolchain-rp2040-earlephilhower/arm-none-eabi/include/c++/12.3.0/bits/unique_ptr.h:1079:5: note: candidate: 'template<class _Tp> std::__detail::__unique_ptr_array_t<_Tp> std::make_unique(size_t)'
 1079 |     make_unique(size_t __num)
      |     ^~~~~~~~~~~
/home/nick/.platformio/packages/toolchain-rp2040-earlephilhower/arm-none-eabi/include/c++/12.3.0/bits/unique_ptr.h:1079:5: note:   candidate expects 1 argument, 0 provided
/home/nick/.platformio/packages/toolchain-rp2040-earlephilhower/arm-none-eabi/include/c++/12.3.0/bits/unique_ptr.h:1064:5: note: candidate: 'template<class _Tp, class ... _Args> std::__detail::__unique_ptr_t<_Tp> std::make_unique(_Args&& ...)'
 1064 |     make_unique(_Args&&... __args)
      |     ^~~~~~~~~~~
/home/nick/.platformio/packages/toolchain-rp2040-earlephilhower/arm-none-eabi/include/c++/12.3.0/bits/unique_ptr.h:1064:5: note:   template argument deduction/substitution failed:
src/esphome/components/wled/wled_light_effect.cpp:62:32: error: template argument 1 is invalid
   62 |     udp_ = make_unique<WiFiUDP>();
      |            ~~~~~~~~~~~~~~~~~~~~^~
src/esphome/components/wled/wled_light_effect.cpp:64:14: error: invalid use of incomplete type 'class UDP'
   64 |     if (!udp_->begin(port_)) {
      |              ^~
src/esphome/components/wled/wled_light_effect.h:11:7: note: forward declaration of 'class UDP'
   11 | class UDP;
      |       ^~~
src/esphome/components/wled/wled_light_effect.cpp:71:37: error: invalid use of incomplete type 'class UDP'
   71 |   while (uint16_t packet_size = udp_->parsePacket()) {
      |                                     ^~
src/esphome/components/wled/wled_light_effect.h:11:7: note: forward declaration of 'class UDP'
   11 | class UDP;
      |       ^~~
src/esphome/components/wled/wled_light_effect.cpp:74:14: error: invalid use of incomplete type 'class UDP'
   74 |     if (!udp_->read(&payload[0], payload.size())) {
      |              ^~
src/esphome/components/wled/wled_light_effect.h:11:7: note: forward declaration of 'class UDP'
   11 | class UDP;
      |       ^~~
/home/nick/.platformio/packages/toolchain-rp2040-earlephilhower/arm-none-eabi/include/c++/12.3.0/bits/unique_ptr.h: In instantiation of 'void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = UDP]':
/home/nick/.platformio/packages/toolchain-rp2040-earlephilhower/arm-none-eabi/include/c++/12.3.0/bits/unique_ptr.h:396:17:   required from 'std::unique_ptr<_Tp, _Dp>::~unique_ptr() [with _Tp = UDP; _Dp = std::default_delete<UDP>]'
src/esphome/components/wled/wled_light_effect.cpp:31:88:   required from here
/home/nick/.platformio/packages/toolchain-rp2040-earlephilhower/arm-none-eabi/include/c++/12.3.0/bits/unique_ptr.h:93:23: error: invalid application of 'sizeof' to incomplete type 'UDP'
   93 |         static_assert(sizeof(_Tp)>0,
      |                       ^~~~~~~~~~~
*** [.pioenvs/nicksmatrix/src/esphome/components/wled/wled_light_effect.cpp.o] Error 1
In file included from src/esphome.h:56,
                 from src/main.cpp:3:
src/esphome/components/wled/wled_light_effect.h:37:22: error: template argument 1 is invalid
   37 |   std::unique_ptr<UDP> udp_;
      |                      ^
src/esphome/components/wled/wled_light_effect.h:37:22: error: template argument 2 is invalid
*** [.pioenvs/nicksmatrix/src/main.cpp.o] Error 1
================================================================================================================= [FAILED] Took 2.94 seconds =================================================================================================================

Additional information

No response

ssieb commented 1 month ago

Looks like WiFiUDP isn't supported on pico. I'm guessing that the wled component needs to use something else.