esphome / issues

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

Cannot compile with v2023.10.6 #5083

Closed rafafuenza closed 9 months ago

rafafuenza commented 9 months ago

The problem

No Issues before but with the last few updates I havent been able to compile this particular node.

src/esphome/components/api/api_server.h:115:96: error: invalid use of '::' Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>(); ^ src/esphome/components/api/api_server.h:115:96: error: expected ';' at end of member declaration src/esphome/components/api/api_server.h:115:102: error: expected unqualified-id before '>' token

and the list of errors goes on... always with api_server.h.

Which version of ESPHome has the issue?

2023.10.6

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2023.10.5

What platform are you using?

ESP32

Board

nodemcuv2

Component causing the issue

api_server.h

Example YAML snippet

esphome:
  name: wordclock
  friendly_name: wordclock_1
  includes:
    - wordclock.h
  on_boot:
    priority: 800
    then:
      - light.turn_on: 
          id: fastledlight

esp8266:
  board: nodemcuv2
  framework:
    version: 2.7.4

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "qpyJxtctmirRbNR3SXDT1f/7P99zxrLq3Ue7o/tz5KA="

ota:
  password: "67506f30187199231f751e134f0e593a"

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Word-Clock Fallback Hotspot"
    password: !secret wifi_password

captive_portal:

light:
  - platform: fastled_clockless
    id: fastledlight
    chipset: WS2812
    pin: GPIO03
    num_leds: 144
    rgb_order: BRG
    name: "Word Clock"
    restore_mode: ALWAYS_OFF
    on_turn_on:
      - light.turn_on:
          id: fastledlight
          red: 100%
          green: 53%
          blue: 5%

time:
  - platform: homeassistant
    timezone: UTC−03:00
    id: current_time

sensor:
  - platform: adc
    pin: A0
    name: "Wordclock LDR"
    update_interval: 10s
    id: "ldr"
    filters:
      - multiply: 3.3

  - platform: template
    name: "Wordclock Brillo"
    update_interval: 10s
    unit_of_measurement: "%"
    lambda:
      |- 
        if (id(ldr).state>=1) 
        {
          return 100;
        }
        else
        {
          return id(ldr).state * 100;
        }

  - platform: wifi_signal
    id: wifi_signal_db
    internal: true
    update_interval: 60s

  - platform: copy # Reports the WiFi signal strength in %
    source_id: wifi_signal_db
    name: "WiFi Signal Percent"
    filters:
      - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
    unit_of_measurement: "Signal %"
    entity_category: "diagnostic"

switch:
  - platform: template
    name: wc_timbre
    id: wc_timbre
    restore_mode: ALWAYS_OFF
    optimistic: true

  - platform: restart
    name: restart

select:
  - platform: template
    name: brightness type
    optimistic: true
    options:
      - ldr
      - light
    initial_option: ldr
    id: selecttype

custom_component:
- lambda: |-
    auto wordclock = new Wordclock();
    return {wordclock};

Anything in the logs that might be useful for us?

INFO ESPHome 2023.10.6
INFO Reading configuration /config/esphome/wc.yaml...
WARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
WARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.
INFO Generating C++ source...
INFO Compiling app...
Processing wordclock (board: nodemcuv2; framework: arduino; platform: platformio/espressif8266@2.6.3)
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
Dependency Graph
|-- ESPAsyncTCP-esphome @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.1.0
|-- DNSServer @ 1.1.1
|-- ESP8266WiFi @ 1.0
|-- ESP8266mDNS @ 1.2
|-- noise-c @ 0.1.4
|-- FastLED @ 3.3.2
Compiling .pioenvs/wordclock/src/esphome/components/api/api_connection.cpp.o
Compiling .pioenvs/wordclock/src/esphome/components/api/api_server.cpp.o
Compiling .pioenvs/wordclock/src/esphome/components/api/list_entities.cpp.o
Compiling .pioenvs/wordclock/src/esphome/components/api/proto.cpp.o
Compiling .pioenvs/wordclock/src/esphome/components/api/subscribe_state.cpp.o
In file included from src/esphome/components/api/api_connection.h:6:0,
                 from src/esphome/components/api/api_connection.cpp:1:
src/esphome/components/api/api_server.h:115:96: error: invalid use of '::'
   Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
                                                                                                ^
src/esphome/components/api/api_server.h:115:96: error: expected ';' at end of member declaration
src/esphome/components/api/api_server.h:115:102: error: expected unqualified-id before '>' token
   Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
                                                                                                      ^
src/esphome/components/api/api_server.h:116:99: error: invalid use of '::'
   Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
                                                                                                   ^
src/esphome/components/api/api_server.h:116:99: error: expected ';' at end of member declaration
src/esphome/components/api/api_server.h:116:105: error: expected unqualified-id before '>' token
   Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
                                                                                                         ^
src/esphome/components/api/api_server.h:115:83: error: template argument 1 is invalid
   Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
                                                                                   ^
src/esphome/components/api/api_server.h:116:86: error: template argument 1 is invalid
   Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
                                                                                      ^
In file included from src/esphome/components/api/api_server.cpp:1:0:
src/esphome/components/api/api_server.h:115:96: error: invalid use of '::'
   Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
                                                                                                ^
src/esphome/components/api/api_server.h:115:96: error: expected ';' at end of member declaration
src/esphome/components/api/api_server.h:115:102: error: expected unqualified-id before '>' token
   Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
                                                                                                      ^
src/esphome/components/api/api_server.h:116:99: error: invalid use of '::'
   Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
                                                                                                   ^
src/esphome/components/api/api_server.h:116:99: error: expected ';' at end of member declaration
src/esphome/components/api/api_server.h:116:105: error: expected unqualified-id before '>' token
   Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
                                                                                                         ^
src/esphome/components/api/api_server.h:115:83: error: template argument 1 is invalid
   Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
                                                                                   ^
src/esphome/components/api/api_server.h:116:86: error: template argument 1 is invalid
   Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
                                                                                      ^
In file included from src/esphome/components/api/api_connection.h:6:0,
                 from src/esphome/components/api/list_entities.cpp:5:
src/esphome/components/api/api_server.h:115:96: error: invalid use of '::'
   Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
                                                                                                ^
src/esphome/components/api/api_server.h:115:96: error: expected ';' at end of member declaration
src/esphome/components/api/api_server.h:115:102: error: expected unqualified-id before '>' token
   Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
                                                                                                      ^
src/esphome/components/api/api_server.h:116:99: error: invalid use of '::'
   Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
                                                                                                   ^
src/esphome/components/api/api_server.h:116:99: error: expected ';' at end of member declaration
src/esphome/components/api/api_server.h:116:105: error: expected unqualified-id before '>' token
   Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
                                                                                                         ^
src/esphome/components/api/api_server.h:115:83: error: template argument 1 is invalid
   Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
                                                                                   ^
src/esphome/components/api/api_server.h:116:86: error: template argument 1 is invalid
   Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
                                                                                      ^
cc1plus: warning: unrecognized command line option "-Wno-nonnull-compare" [enabled by default]
*** [.pioenvs/wordclock/src/esphome/components/api/list_entities.cpp.o] Error 1
cc1plus: warning: unrecognized command line option "-Wno-nonnull-compare" [enabled by default]
*** [.pioenvs/wordclock/src/esphome/components/api/api_connection.cpp.o] Error 1
cc1plus: warning: unrecognized command line option "-Wno-nonnull-compare" [enabled by default]
*** [.pioenvs/wordclock/src/esphome/components/api/api_server.cpp.o] Error 1
In file included from src/esphome/components/api/api_connection.h:6:0,
                 from src/esphome/components/api/subscribe_state.cpp:2:
src/esphome/components/api/api_server.h:115:96: error: invalid use of '::'
   Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
                                                                                                ^
src/esphome/components/api/api_server.h:115:96: error: expected ';' at end of member declaration
src/esphome/components/api/api_server.h:115:102: error: expected unqualified-id before '>' token
   Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
                                                                                                      ^
src/esphome/components/api/api_server.h:116:99: error: invalid use of '::'
   Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
                                                                                                   ^
src/esphome/components/api/api_server.h:116:99: error: expected ';' at end of member declaration
src/esphome/components/api/api_server.h:116:105: error: expected unqualified-id before '>' token
   Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
                                                                                                         ^
src/esphome/components/api/api_server.h:115:83: error: template argument 1 is invalid
   Trigger<std::string, std::string> *client_connected_trigger_ = new Trigger<std::string, std::string>();
                                                                                   ^
src/esphome/components/api/api_server.h:116:86: error: template argument 1 is invalid
   Trigger<std::string, std::string> *client_disconnected_trigger_ = new Trigger<std::string, std::string>();
                                                                                      ^
cc1plus: warning: unrecognized command line option "-Wno-nonnull-compare" [enabled by default]
*** [.pioenvs/wordclock/src/esphome/components/api/subscribe_state.cpp.o] Error 1
========================== [FAILED] Took 1.85 seconds ==========================

Additional information

No response

ssieb commented 9 months ago

I expect that's because you're overriding the arduino platform version. That version is not compatible.

rafafuenza commented 9 months ago

I expect that's because you're overriding the arduino platform version. That version is not compatible.

Since the version 2023.10.x? It runs fine on 2023.9.3!

can you expand your awnser? Thanks!!

ssieb commented 9 months ago

Things change. There's a big warning right at the top of your compile log.

rafafuenza commented 9 months ago

Things change. There's a big warning right at the top of your compile log.

How can I fix it? I have to use framework 2.7.4 because of thi issue: https://esphome.io/components/light/fastled.html#clockless

ssieb commented 9 months ago

You have to remove the arduino version from your config. If that makes fastled not work, then you can either try https://github.com/esphome/esphome/pull/4257 or switch to using neopixel instead.

rafafuenza commented 9 months ago

You have to remove the arduino version from your config. If that makes fastled not work, then you can either try esphome/esphome#4257 or switch to using neopixel instead.

I will try to do that! thaks

sebasgra39 commented 9 months ago

@rafafuenza have you been able to solve this? I'm facing the same issue and https://github.com/esphome/esphome/pull/4257 didn't change anything. BR Sebastian

nemeier commented 9 months ago

I'm using fastled_clockless that requires 2.7.4, is this project dead?

ssieb commented 9 months ago

@sebasgra39 what's the problem? Using that PR had to have changed something. Come ask on discord if you need more help or else use the neopixel component instead. @nemeier is what project dead?

nemeier commented 9 months ago

@sebasgra39 @nemeier is what project dead? fastled_clockless :)

I ask in another way, will fastled_clockless get running soon or do you expect to discontinue fastled_clockless?

Necrosaurus commented 5 months ago

I had same problem, I had been stuck on framework: version: 2.7.4 for about a year, waiting for progress on fastled. Then after a recent esphome update, I couldn't install anything on my esp8266. so switched to neopixel, removed framework: version: 2.7.4 and problem went away.