esphome / issues

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

2024.6.0 doesn't compile for libertiny boards with debug: enabled #5920

Closed pyrodex closed 5 months ago

pyrodex commented 5 months ago

The problem

With debug: enabled since 2024.6.0 ESPHome won't compile on LibreTiny based boards. Even a clean build files doesn't help and it throws an error during compiling. Removing debug: resolves the issue.

Which version of ESPHome has the issue?

2024.6.0

What type of installation are you using?

Docker

Which version of Home Assistant has the issue?

N/A

What platform are you using?

BK72XX

Board

wb3s, generic-bk7231t-qfn32-tuya, generic-bk7231n-qfn32-tuya

Component causing the issue

debug

Example YAML snippet

substitutions:
  name: basement-floodlight
  friendly_name: Basement Flood Light
  ip_address: 192.168.26.58

esphome:
  name: ${name}

bk72xx:
  board: wb3s

logger:
api:
<<: !include common/ota.yaml

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: ${name}
  use_address: ${ip_address}
web_server:
  version: 3
  local: True
captive_portal:
debug:

# P26 = Relay
# P24 = LED
# P6 = Reset Button
# P9 = Off Button
# P8 = On Button

light:
  - platform: status_led
    name: "Switch state"
    id: stat_led
    internal: true
    pin:
      number: P24
#switch:
  - platform: binary
  #- platform: gpio
    name: "${friendly_name}"
    #id: relay
    id: light_switch
    #pin: P26 # Relay
    output: light_output
    on_turn_on:
      - logger.log: "Switch Turned On!"
      - light.turn_on: stat_led
    on_turn_off:
      - logger.log: "Switch Turned Off!"
      - light.turn_off: stat_led

output:
  - id: light_output
    platform: gpio
    pin: P26

binary_sensor:
  - platform: gpio
    id: on_button
    pin:
      number: P8 # On Button
      inverted: true
    on_click:
      - light.turn_on: light_switch
      - light.turn_on: stat_led
  - platform: gpio
    id: off_button
    pin:
      number: P9 # Off Button
      inverted: true
    on_click:
      - light.turn_off: light_switch
      - light.turn_off: stat_led
  - platform: gpio
    id: reset_button
    pin:
      number: P6 # Reset Button
      inverted: true
    #on_click:
      #- TODO

button:
  - <<: !include common/button/restart.yaml
  - <<: !include common/button/safe.yaml
sensor:
  - <<: !include common/sensor/uptime.yaml
  - <<: !include common/sensor/wifi_signal.yaml
text_sensor:
  - <<: !include common/text_sensor/version.yaml
  - <<: !include common/text_sensor/wifi_info.yaml

<<: !include common/time/iot-time.yaml

Anything in the logs that might be useful for us?

INFO ESPHome 2024.6.0
INFO Reading configuration /config/basement-floodlight.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing basement-floodlight (board: wb3s; framework: arduino; platform: libretiny @ 1.5.1)
--------------------------------------------------------------------------------
Warning! Non-Git installations are NOT SUPPORTED.
HARDWARE: BK7231T 120MHz, 256KB RAM, 1.03MB Flash
 - framework-arduino-api @ 2022.8.24+sha.237b10a 
 - framework-beken-bdk @ 0.0.0+v2021.06.07.sha.6491b8c 
 - library-flashdb @ 1.2.0+sha.d5c892f 
 - library-freertos @ 9.0.0+sha.95cc959 
 - library-freertos-port @ 2023.5.23+sha.a917d93 
 - library-lwip @ 2.1.3-bdk+sha.4ee4d34 
 - library-printf @ 6.1.0+sha.28a79bd 
 - library-uf2ota @ 5.0.0+sha.f955412 
PLATFORM VERSIONS:
 - libretiny @ 1.5.1
 - ltchiptool @ 4.11.1
CUSTOM OPTIONS:
 - fw_name = esphome
 - fw_version = 2024.6.0
Dependency Graph
|-- AsyncTCP-esphome @ 2.1.3
|-- ESPAsyncWebServer-esphome @ 3.2.2
|-- DNSServer @ 1.1.0
|-- ArduinoJson @ 6.18.5
Compiling .pioenvs/basement-floodlight/src/esphome/components/debug/debug_libretiny.cpp.o
Compiling .pioenvs/basement-floodlight/src/esphome/components/ota/ota_backend_arduino_rp2040.cpp.o
Compiling .pioenvs/basement-floodlight/src/esphome/components/ota/ota_backend_esp_idf.cpp.o
Compiling .pioenvs/basement-floodlight/src/esphome/components/output/automation.cpp.o
Compiling .pioenvs/basement-floodlight/src/esphome/components/output/float_output.cpp.o
Compiling .pioenvs/basement-floodlight/src/esphome/components/restart/button/restart_button.cpp.o
Compiling .pioenvs/basement-floodlight/src/esphome/components/safe_mode/button/safe_mode_button.cpp.o
Compiling .pioenvs/basement-floodlight/src/esphome/components/safe_mode/safe_mode.cpp.o
Compiling .pioenvs/basement-floodlight/src/esphome/components/sensor/automation.cpp.o
src/esphome/components/debug/debug_libretiny.cpp: In member function 'void esphome::debug::DebugComponent::get_device_info_(std::string&)':
src/esphome/components/debug/debug_libretiny.cpp:15:3: error: 'str' has not been declared
   15 |   str::string reset_reason = get_reset_reason_();
      |   ^~~
In file included from src/esphome/components/sensor/sensor.h:3,
                 from src/esphome/components/debug/debug_component.h:9,
                 from src/esphome/components/debug/debug_libretiny.cpp:1:
src/esphome/components/debug/debug_libretiny.cpp:21:37: error: 'reset_reason' was not declared in this scope; did you mean 'reset_reason_'?
   21 |   ESP_LOGD(TAG, "Reset Reason: %s", reset_reason.c_str());
      |                                     ^~~~~~~~~~~~
src/esphome/core/log.h:95:89: note: in definition of macro 'esph_log_d'
   95 |   esp_log_printf_(ESPHOME_LOG_LEVEL_DEBUG, tag, __LINE__, ESPHOME_LOG_FORMAT(format), ##__VA_ARGS__)
      |                                                                                         ^~~~~~~~~~~
src/esphome/components/debug/debug_libretiny.cpp:21:3: note: in expansion of macro 'ESP_LOGD'
   21 |   ESP_LOGD(TAG, "Reset Reason: %s", reset_reason.c_str());
      |   ^~~~~~~~
Compiling .pioenvs/basement-floodlight/src/esphome/components/sensor/filter.cpp.o
Compiling .pioenvs/basement-floodlight/src/esphome/components/sensor/sensor.cpp.o
Compiling .pioenvs/basement-floodlight/src/esphome/components/sntp/sntp_component.cpp.o
*** [.pioenvs/basement-floodlight/src/esphome/components/debug/debug_libretiny.cpp.o] Error 1
========================== [FAILED] Took 3.67 seconds ==========================

Additional information

No response

Cossid commented 5 months ago

It appears https://github.com/esphome/esphome/pull/6806 contained a typo in which str::string should have been std::string