SzczepanLeon / esphome-components

153 stars 54 forks source link

[V4.0] Compile error with default config #120

Closed ThomDietrich closed 1 month ago

ThomDietrich commented 2 months ago

Hey there, thanks for the 4.0 update! I ran into this error and am not sure what's going on.

With ESPHome 2024.9.0 and this config:

esphome:
  platformio_options:
    board_build.flash_mode: dio
    board_build.mcu: esp32c3
  project:
    name: "M5Stack.M5Stamp-C3U"
    version: "0.0"

esp32:
  board: esp32-c3-devkitm-1
  variant: esp32c3
  framework:
    type: arduino

time:
  - platform: sntp
    id: time_sntp
    timezone: Europe/Berlin

external_components:
  - source: github://SzczepanLeon/esphome-components@main
    refresh: 0d
    components: [ wmbus ]

wmbus:
  # frequency: 868.950
  # Pin 1 - GND
  # Pin 2 - VCC - Power supply 1.8 V-3.6V DC
  gdo0_pin: GPIO3 # GDO0 - Information output pin
  cs_pin: GPIO4 # CSN - Chip selection pin, for starting a SPI communication
  clk_pin: GPIO5 # SCK - SPI clock pin
  mosi_pin: GPIO6 # MOSI - SPI data input pin
  miso_pin: GPIO7 # MISO/GDO1 - SPI data output pin
  gdo2_pin: GPIO8 # GDO2 - Information output pin
  # led_pin: GPIO0
  # led_blink_time: "1s"
  # all_drivers: False
  # sync_mode: True
  # log_all: True

You get:

INFO ESPHome 2024.9.0
INFO Reading configuration wasserzaehler-hydrus-2-0.yaml...
INFO Updating https://github.com/SzczepanLeon/esphome-components.git@main
WARNING GPIO2 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
WARNING GPIO8 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
WARNING GPIO9 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Generating C++ source...
INFO Compiling app...
Processing wasserzaehler (board: esp32-c3-devkitm-1; framework: arduino; platform: platformio/espressif32@5.4.0)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-c3-devkitm-1.html
PLATFORM: Espressif 32 (5.4.0) > Espressif ESP32-C3-DevKitM-1
HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, 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-arduinoespressif32 @ 3.20005.220925 (2.0.5)
 - tool-esptoolpy @ 1.40400.0 (4.4.0)
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ off, Compatibility ~ soft
Found 36 compatible libraries
Scanning dependencies...
Dependency Graph
|-- AsyncTCP-esphome @ 2.1.4
|-- WiFi @ 2.0.0
|-- FS @ 2.0.0
|-- Update @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.2.2
|-- DNSServer @ 2.0.0
|-- ESPmDNS @ 2.0.0
|-- ArduinoJson @ 6.18.5
|-- SPI @ 2.0.0
|-- SmartRC-CC1101-Driver-Lib @ 2.5.7
Building in release mode
Compiling .pioenvs\wasserzaehler\src\esphome\components\wmbus\wmbus.cpp.o
Compiling .pioenvs\wasserzaehler\src\main.cpp.o
Archiving .pioenvs\wasserzaehler\lib65b\libESPAsyncWebServer-esphome.a
Archiving .pioenvs\wasserzaehler\liba8b\libDNSServer.a
Archiving .pioenvs\wasserzaehler\lib74b\libESPmDNS.a
Archiving .pioenvs\wasserzaehler\liba9c\libSmartRC-CC1101-Driver-Lib.a
Compiling .pioenvs\wasserzaehler\FrameworkArduino\FirmwareMSC.cpp.o
Compiling .pioenvs\wasserzaehler\FrameworkArduino\FunctionalInterrupt.cpp.o
Compiling .pioenvs\wasserzaehler\FrameworkArduino\HWCDC.cpp.o
Compiling .pioenvs\wasserzaehler\FrameworkArduino\HardwareSerial.cpp.o
Compiling .pioenvs\wasserzaehler\FrameworkArduino\IPAddress.cpp.o
Compiling .pioenvs\wasserzaehler\FrameworkArduino\IPv6Address.cpp.o
Compiling .pioenvs\wasserzaehler\FrameworkArduino\MD5Builder.cpp.o
Compiling .pioenvs\wasserzaehler\FrameworkArduino\Print.cpp.o
Compiling .pioenvs\wasserzaehler\FrameworkArduino\Stream.cpp.o
Compiling .pioenvs\wasserzaehler\FrameworkArduino\StreamString.cpp.o
Compiling .pioenvs\wasserzaehler\FrameworkArduino\Tone.cpp.o
Compiling .pioenvs\wasserzaehler\FrameworkArduino\USB.cpp.o
In file included from src/esphome/components/wmbus/dvparser.h:23,
                 from src/esphome/components/wmbus/meters.h:22,
                 from src/esphome/components/wmbus/wmbus.cpp:4:
src/esphome/components/wmbus/units.h:102:7: error: expected identifier before '(' token
     X(HZ,hz,"Hz",Frequency,"hz")                                        \
       ^~
src/esphome/components/wmbus/units.h:129:53: note: in definition of macro 'X'
 #define X(cname,lcname,hrname,quantity,explanation) cname,
                                                     ^~~~~
src/esphome/components/wmbus/units.h:130:5: note: in expansion of macro 'LIST_OF_UNITS'
     LIST_OF_UNITS
     ^~~~~~~~~~~~~
src/esphome/components/wmbus/units.h:102:7: error: expected '}' before '(' token
     X(HZ,hz,"Hz",Frequency,"hz")                                        \
       ^~
src/esphome/components/wmbus/units.h:129:53: note: in definition of macro 'X'
 #define X(cname,lcname,hrname,quantity,explanation) cname,
                                                     ^~~~~
src/esphome/components/wmbus/units.h:130:5: note: in expansion of macro 'LIST_OF_UNITS'
     LIST_OF_UNITS
     ^~~~~~~~~~~~~
src/esphome/components/wmbus/units.h:128:1: note: to match this '{'
 {
 ^
src/esphome/components/wmbus/units.h:102:7: error: expected unqualified-id before numeric constant
     X(HZ,hz,"Hz",Frequency,"hz")                                        \
       ^~
Compiling .pioenvs\wasserzaehler\FrameworkArduino\USBCDC.cpp.o
src/esphome/components/wmbus/units.h:129:53: note: in definition of macro 'X'
 #define X(cname,lcname,hrname,quantity,explanation) cname,
                                                     ^~~~~
src/esphome/components/wmbus/units.h:130:5: note: in expansion of macro 'LIST_OF_UNITS'
     LIST_OF_UNITS
     ^~~~~~~~~~~~~
src/esphome/components/wmbus/units.h:102:7: error: expected ')' before numeric constant
     X(HZ,hz,"Hz",Frequency,"hz")                                        \
       ^~
src/esphome/components/wmbus/units.h:129:53: note: in definition of macro 'X'
 #define X(cname,lcname,hrname,quantity,explanation) cname,
                                                     ^~~~~
src/esphome/components/wmbus/units.h:130:5: note: in expansion of macro 'LIST_OF_UNITS'
     LIST_OF_UNITS
     ^~~~~~~~~~~~~
src/esphome/components/wmbus/units.h:133:1: error: expected declaration before '}' token
 };
 ^
*** [.pioenvs\wasserzaehler\src\esphome\components\wmbus\wmbus.cpp.o] Error 1
In file included from src/esphome\components\wmbus\dvparser.h:23,
                 from src/esphome.h:90,
                 from src/main.cpp:3:
src/esphome\components\wmbus\units.h:102:7: error: expected identifier before '(' token
     X(HZ,hz,"Hz",Frequency,"hz")                                        \
       ^~
src/esphome\components\wmbus\units.h:129:53: note: in definition of macro 'X'
 #define X(cname,lcname,hrname,quantity,explanation) cname,
                                                     ^~~~~
src/esphome\components\wmbus\units.h:130:5: note: in expansion of macro 'LIST_OF_UNITS'
     LIST_OF_UNITS
     ^~~~~~~~~~~~~
src/esphome\components\wmbus\units.h:102:7: error: expected '}' before '(' token
     X(HZ,hz,"Hz",Frequency,"hz")                                        \
       ^~
src/esphome\components\wmbus\units.h:129:53: note: in definition of macro 'X'
 #define X(cname,lcname,hrname,quantity,explanation) cname,
                                                     ^~~~~
src/esphome\components\wmbus\units.h:130:5: note: in expansion of macro 'LIST_OF_UNITS'
     LIST_OF_UNITS
     ^~~~~~~~~~~~~
src/esphome\components\wmbus\units.h:128:1: note: to match this '{'
 {
 ^
src/esphome\components\wmbus\units.h:102:7: error: expected unqualified-id before numeric constant
     X(HZ,hz,"Hz",Frequency,"hz")                                        \
       ^~
src/esphome\components\wmbus\units.h:129:53: note: in definition of macro 'X'
 #define X(cname,lcname,hrname,quantity,explanation) cname,
                                                     ^~~~~
src/esphome\components\wmbus\units.h:130:5: note: in expansion of macro 'LIST_OF_UNITS'
     LIST_OF_UNITS
     ^~~~~~~~~~~~~
src/esphome\components\wmbus\units.h:102:7: error: expected ')' before numeric constant
     X(HZ,hz,"Hz",Frequency,"hz")                                        \
       ^~
src/esphome\components\wmbus\units.h:129:53: note: in definition of macro 'X'
 #define X(cname,lcname,hrname,quantity,explanation) cname,
                                                     ^~~~~
src/esphome\components\wmbus\units.h:130:5: note: in expansion of macro 'LIST_OF_UNITS'
     LIST_OF_UNITS
     ^~~~~~~~~~~~~
src/esphome\components\wmbus\units.h:133:1: error: expected declaration before '}' token
 };
 ^
*** [.pioenvs\wasserzaehler\src\main.cpp.o] Error 1

Edit: here is my complete config:

$ esphome config wasserzaehler-hydrus-2-0.yaml
INFO ESPHome 2024.9.0
INFO Reading configuration wasserzaehler-hydrus-2-0.yaml...
INFO Updating https://github.com/SzczepanLeon/esphome-components.git@main
WARNING GPIO8 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
substitutions:
  device_name: wasserzaehler
  device_friendly_name: Wasserzaehler
  device_area: Keller
  status_led_pin: GPIO2
  on_board_button_pin: GPIO9
  log_baudrate: '0'
esphome:
  platformio_options:
    board_build.flash_mode: dio
    board_build.mcu: esp32c3
  project:
    name: M5Stack.M5Stamp-C3U_plus_CC1101
    version: '0.0'
  name: wasserzaehler
  friendly_name: Wasserzaehler
  area: Keller
  build_path: build\wasserzaehler
  includes: []
  libraries: []
  name_add_mac_suffix: false
  min_version: 2024.9.0
esp32:
  board: esp32-c3-devkitm-1
  variant: ESP32C3
  framework:
    version: 2.0.5
    source: ~3.20005.0
    platform_version: platformio/espressif32@5.4.0
    type: arduino
  flash_size: 4MB
wifi:
  networks:
  - ssid: \033[5m!secret 'wifi_home1_ssid'\033[6m
    password: \033[5m!secret 'wifi_home1_pw'\033[6m
    priority: 0.0
  - ssid: \033[5m!secret 'wifi_home2_ssid'\033[6m
    password: \033[5m!secret 'wifi_home2_pw'\033[6m
    priority: 0.0
  - ssid: \033[5m!secret 'wifi_home3_ssid'\033[6m
    password: \033[5m!secret 'wifi_home3_pw'\033[6m
    priority: 0.0
  ap:
    ssid: \033[5mwasserzaehler\033[6m
    password: \033[5m!secret 'wifi_fallback_pw'\033[6m
    ap_timeout: 1min
  domain: .local
  reboot_timeout: 15min
  power_save_mode: LIGHT
  fast_connect: false
  passive_scan: false
  enable_on_boot: true
  use_address: wasserzaehler.local
sensor:
- platform: wifi_signal
  name: WiFi Signal RSSI
  id: wifi_signal_db
  update_interval: 60s
  device_class: signal_strength
  entity_category: diagnostic
  disabled_by_default: false
  force_update: false
  unit_of_measurement: dBm
  accuracy_decimals: 0
  state_class: measurement
- platform: copy
  source_id: wifi_signal_db
  name: WiFi Signal Strength
  filters:
  - lambda: !lambda |-
      return min(max(2 * (x + 100.0), 0.0), 100.0);
  unit_of_measurement: '%'
  device_class: ''
  entity_category: diagnostic
  disabled_by_default: false
  force_update: false
  accuracy_decimals: 0
  state_class: measurement
time:
- platform: sntp
  id: time_sntp
  timezone: CET-1CEST,M3.5.0,M10.5.0/3
  update_interval: 15min
  servers:
  - 0.pool.ntp.org
  - 1.pool.ntp.org
  - 2.pool.ntp.org
external_components:
- source:
    url: https://github.com/SzczepanLeon/esphome-components.git
    ref: main
    type: git
  refresh: 0d
  components:
  - wmbus
wmbus:
  gdo0_pin:
    number: 3
    mode:
      input: true
      output: false
      open_drain: false
      pullup: false
      pulldown: false
    inverted: false
    ignore_pin_validation_error: false
    ignore_strapping_warning: false
    drive_strength: 20.0
  cs_pin:
    number: 4
    mode:
      output: true
      input: false
      open_drain: false
      pullup: false
      pulldown: false
    inverted: false
    ignore_pin_validation_error: false
    ignore_strapping_warning: false
    drive_strength: 20.0
  clk_pin:
    number: 5
    mode:
      output: true
      input: false
      open_drain: false
      pullup: false
      pulldown: false
    inverted: false
    ignore_pin_validation_error: false
    ignore_strapping_warning: false
    drive_strength: 20.0
  mosi_pin:
    number: 6
    mode:
      output: true
      input: false
      open_drain: false
      pullup: false
      pulldown: false
    inverted: false
    ignore_pin_validation_error: false
    ignore_strapping_warning: false
    drive_strength: 20.0
  miso_pin:
    number: 7
    mode:
      input: true
      output: false
      open_drain: false
      pullup: false
      pulldown: false
    inverted: false
    ignore_pin_validation_error: false
    ignore_strapping_warning: false
    drive_strength: 20.0
  gdo2_pin:
    number: 8
    mode:
      input: true
      output: false
      open_drain: false
      pullup: false
      pulldown: false
    inverted: false
    ignore_pin_validation_error: false
    ignore_strapping_warning: false
    drive_strength: 20.0
  led_blink_time: 200ms
  log_all: false
  all_drivers: false
  frequency: 868.95
  sync_mode: false
SzczepanLeon commented 2 months ago

This error is visible also on clean build?

ThomDietrich commented 2 months ago

Hey @SzczepanLeon yes, more precisely, the following produces the error:

esphome clean wasserzaehler-hydrus-2-0.yaml
rm -rf .esphome/build/wasserzaehler
esphome run wasserzaehler-hydrus-2-0.yaml
machintrucbidule commented 2 months ago

Same issue here, since esphome 2024.9.1, also after a clean build

ThomDietrich commented 2 months ago

@machintrucbidule could you share your esphome: and esp32: section?

machintrucbidule commented 2 months ago

@machintrucbidule could you share your esphome: and esp32: section?

Sorry can't copy paste from home assistant mobile app, but: Screenshot_20240923-112434

SzczepanLeon commented 2 months ago

Can you remove framework section from YAML and rebuild?

machintrucbidule commented 2 months ago

It was already not there

ThomDietrich commented 2 months ago

Isn't arduino the default? I did remove it and the resulting esphome config and error did not change

ThomDietrich commented 2 months ago

Switched to esp-idf with this result:

$ esphome run wasserzaehler-hydrus-2-0.yaml
INFO ESPHome 2024.9.0
INFO Reading configuration wasserzaehler-hydrus-2-0.yaml...
INFO Cloning https://github.com/SzczepanLeon/esphome-components.git@main
INFO Fetching main
WARNING GPIO8 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Generating C++ source...
INFO Core config, version or integrations changed, cleaning build files...
INFO Compiling app...
Processing wasserzaehler (board: esp32-c3-devkitm-1; framework: espidf; platform: platformio/espressif32@5.4.0)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Library Manager: Installing LSatan/SmartRC-CC1101-Driver-Lib @ 2.5.7
INFO Installing LSatan/SmartRC-CC1101-Driver-Lib @ 2.5.7
Unpacking  [####################################]  100%
Library Manager: SmartRC-CC1101-Driver-Lib@2.5.7 has been installed!
INFO SmartRC-CC1101-Driver-Lib@2.5.7 has been installed!
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32-c3-devkitm-1.html
PLATFORM: Espressif 32 (5.4.0) > Espressif ESP32-C3-DevKitM-1
HARDWARE: ESP32C3 160MHz, 320KB RAM, 4MB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, esp-bridge, esp-builtin, 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.40407.240606 (4.4.7)
 - 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-riscv32-esp @ 8.4.0+2021r2-patch5
Warning: the 'src_filter' option cannot be used with ESP-IDF. Select source files to build in the project CMakeLists.txt file.

Reading CMake configuration...
Library Manager: Installing SPI
Warning! Could not find the package with 'SPI' requirements for your system 'windows_amd64'
Generating assembly for certificate bundle...
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ off, Compatibility ~ soft
Library Manager: Installing SPI
Warning! Could not find the package with 'SPI' requirements for your system 'windows_amd64'
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pioenvs\wasserzaehler\src\esphome\components\copy\sensor\copy_sensor.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\esp32\core.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\esp32\gpio.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\esp32\preferences.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\mdns\mdns_component.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\mdns\mdns_esp32.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\mdns\mdns_esp8266.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\mdns\mdns_host.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\mdns\mdns_libretiny.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\mdns\mdns_rp2040.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\network\util.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\sensor\automation.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\sensor\filter.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\sensor\sensor.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\sntp\sntp_component.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\time\automation.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\time\real_time_clock.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wifi\wifi_component.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wifi\wifi_component_esp32_arduino.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wifi\wifi_component_esp8266.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wifi\wifi_component_esp_idf.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wifi\wifi_component_libretiny.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wifi\wifi_component_pico_w.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wifi_signal\wifi_signal_sensor.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wmbus\Enums.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wmbus\Telegram.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wmbus\address.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wmbus\aes.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wmbus\crc.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wmbus\decode3of6.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wmbus\driver_abbb23.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wmbus\driver_aerius.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wmbus\driver_amiplus.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wmbus\driver_apator08.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wmbus\driver_apator162.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wmbus\driver_apator172.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wmbus\driver_apatoreitn.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wmbus\driver_apatorna1.o
src/esphome/components/wmbus/Telegram.cpp: In member function 'bool Telegram::parseELL(std::vector<unsigned char>::iterator&)':
src/esphome/components/wmbus/Telegram.cpp:1215:34: error: statement has no effect [-Werror=unused-value]
         ("ELL V not yet handled");
                                  ^
Compiling .pioenvs\wasserzaehler\src\esphome\components\wmbus\driver_auto.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wmbus\driver_aventieshca.o
Compiling .pioenvs\wasserzaehler\src\esphome\components\wmbus\driver_aventieswm.o
src/esphome/components/wmbus/driver_abbb23.cpp:37:5: warning: '{anonymous}::Driver::Driver(MeterInfo&, DriverInfo&)' defined but not used [-Wunused-function]
     Driver::Driver(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementation(mi, di)
     ^~~~~~
src/esphome/components/wmbus/driver_aerius.cpp:37:5: warning: '{anonymous}::Driver::Driver(MeterInfo&, DriverInfo&)' defined but not used [-Wunused-function]
     Driver::Driver(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementation(mi, di)
     ^~~~~~
src/esphome/components/wmbus/driver_amiplus.cpp:39:5: warning: '{anonymous}::Driver::Driver(MeterInfo&, DriverInfo&)' defined but not used [-Wunused-function]
     Driver::Driver(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementation(mi, di)
     ^~~~~~
cc1plus.exe: some warnings being treated as errors
*** [.pioenvs\wasserzaehler\src\esphome\components\wmbus\Telegram.o] Error 1
src/esphome/components/wmbus/driver_apator08.cpp:43:5: warning: '{anonymous}::Driver::Driver(MeterInfo&, DriverInfo&)' defined but not used [-Wunused-function]
     Driver::Driver(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementation(mi, di)
     ^~~~~~
src/esphome/components/wmbus/driver_apator162.cpp:45:5: warning: '{anonymous}::Driver::Driver(MeterInfo&, DriverInfo&)' defined but not used [-Wunused-function]
     Driver::Driver(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementation(mi, di)
     ^~~~~~
src/esphome/components/wmbus/driver_apator172.cpp:41:5: warning: '{anonymous}::Driver::Driver(MeterInfo&, DriverInfo&)' defined but not used [-Wunused-function]
     Driver::Driver(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementation(mi, di)
     ^~~~~~
src/esphome/components/wmbus/driver_apatoreitn.cpp:45:5: warning: '{anonymous}::Driver::Driver(MeterInfo&, DriverInfo&)' defined but not used [-Wunused-function]
     Driver::Driver(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementation(mi, di)
     ^~~~~~
src/esphome/components/wmbus/driver_apatorna1.cpp:41:5: warning: '{anonymous}::Driver::Driver(MeterInfo&, DriverInfo&)' defined but not used [-Wunused-function]
     Driver::Driver(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementation(mi, di)
     ^~~~~~
src/esphome/components/wmbus/driver_aventieshca.cpp:37:5: warning: '{anonymous}::Driver::Driver(MeterInfo&, DriverInfo&)' defined but not used [-Wunused-function]
     Driver::Driver(MeterInfo &mi, DriverInfo &di) : MeterCommonImplementation(mi, di)
     ^~~~~~
src/esphome/components/wmbus/driver_aventieswm.cpp:37:5: warning: '{anonymous}::Driver::Driver(MeterInfo&, DriverInfo&)' defined but not used [-Wunused-function]
     Driver::Driver(MeterInfo &mi, DriverInfo &di) :
     ^~~~~~
machintrucbidule commented 2 months ago

For the moment I came back to 3.2.3 by changing :

external_components:
  - source: github://SzczepanLeon/esphome-components@main
    components: [ wmbus ]

to

external_components:
  - source: github://SzczepanLeon/esphome-components@3.2.3
    components: [ wmbus ]

It compiles and works again

wonsky007 commented 2 months ago

Hi!

I've also got a problem with compiling fw after updating ESPHome to 2024.9.1 even on default conf:

INFO ESPHome 2024.9.1 INFO Reading configuration /config/esphome/wmbus-reader.yaml... INFO Updating https://github.com/SzczepanLeon/esphome-components.git@main INFO Unable to import component wmbus.text_sensor: No module named 'esphome.components.wmbus.text_sensor' Failed config

text_sensor.wmbus: [source /config/esphome/wmbus-reader.yaml:96]

Platform not found: 'text_sensor.wmbus'. platform: wmbus name: Text debug for Apator 16-2

Temporary workaround:


 external_components:
   - source: github://SzczepanLeon/esphome-components@3.2.3
     components: [ wmbus ]
SzczepanLeon commented 2 months ago

I've also got a problem with compiling fw after updating ESPHome to 2024.9.1 even on default conf:

This is another topic. This is not compilation problem. Please migrate YAML to new structure. And remove Apator text_sensor.

evilmumi commented 2 months ago

I've also got a problem with compiling fw after updating ESPHome to 2024.9.1 even on default conf:

This is another topic. This is not compilation problem. Please migrate YAML to new structure. And remove Apator text_sensor.

would you be so kind and share a link "how-to"?

SzczepanLeon commented 2 months ago

would you be so kind and share a link \"how-to\"?

Just read main page.

ThomDietrich commented 2 months ago

@SzczepanLeon anything you want me to try or investigate today? Asking as I will be traveling the rest of the week.

SzczepanLeon commented 2 months ago

Not really. I don't have time to open computer and check this issue. Maybe next week (or during cloudy weekend).

evilmumi commented 2 months ago

would you be so kind and share a link "how-to"?

Just read main page.

which main? would some one be so kind please

SzczepanLeon commented 2 months ago

which main? would some one be so kind please

https://github.com/SzczepanLeon/esphome-components

SzczepanLeon commented 2 months ago

Issue seems to be related to used toolchain - toolchain-riscv32-esp

ThomDietrich commented 2 months ago

I have some c/cpp experience from the past but the macro magic in question is far beyond my understanding. I find it odd that one line right in the middle of everything is supposed to be the problem!? X(HZ,hz,"Hz",Frequency,"hz") Did you make sense of that?

spitfire commented 1 month ago

I've also got a problem with compiling fw after updating ESPHome to 2024.9.1 even on default conf:

This is another topic. This is not compilation problem. Please migrate YAML to new structure. And remove Apator text_sensor.

I've tried that, unfortunately it got too big for my esp32

Zrzut ekranu 2024-10-1 o 15 26 38

no such issue with 3.2.3 and old config.

SzczepanLeon commented 1 month ago

@spitfire Please share YAML. Probably You compiled with all drivers - do You need all of them?

spitfire commented 1 month ago
substitutions:
  name: "stalowe-przedpokoj-esp32"
  friendly_name: przedpokój-esp32

esphome:
  name: ${name}
  friendly_name: ${friendly_name}

esp32:
  board: az-delivery-devkit-v4

external_components:
  - source: github://SzczepanLeon/esphome-components@main
  # - source: github://SzczepanLeon/esphome-components@3.2.3
    components: [ wmbus ]

logger:
  # level: WARN
  # level: VERBOSE
  # level: VERY_VERBOSE
  # logs:
  #   api.connection: INFO
  #   api.service: ERROR
  #   api.socket: ERROR
  #   json: ERROR
  #   scheduler: ERROR
  #   wmbus: VERY_VERBOSE

<<: !include templates/spitfire/common/api.yaml

<<: !include templates/spitfire/common/ota.yaml

<<: !include templates/spitfire/common/wifi.yaml

<<: !include templates/spitfire/common/webserver.yaml

<<: !include templates/spitfire/common/time.yaml

bluetooth_proxy:
  active: true

esp32_ble_tracker:

wmbus:
  all_drivers: False
  log_all: False

  mosi_pin: GPIO13
  clk_pin:  GPIO14
  miso_pin: GPIO12
  gdo2_pin: GPIO4
  gdo0_pin: GPIO5
  cs_pin:   GPIO15

binary_sensor: 
  - !include templates/spitfire/common/status.yaml

button:
  - !include templates/spitfire/common/restart.yaml

sensor:
  - !include templates/spitfire/common/esp32-internal_temperature.yaml

  - !include templates/spitfire/common/wifi_signal_db.yaml

  - !include templates/spitfire/common/wifi_signal_percent.yaml

  - !include templates/spitfire/common/uptime.yaml

  - platform: wmbus
    meter_id: 0x18226019
    type: bmeters
    key: "00000000000000000000000000000000"
    ##start wMBus 4.x config
    sensors:
      - name: "Wodomierz ciepła woda RSSI"
        field: "rssi"
        accuracy_decimals: 0
        unit_of_measurement: "dBm"
        device_class: "signal_strength"
        state_class: "measurement"
        entity_category: "diagnostic"
      - name:  "Ciepła woda"
        id: "ciepla_woda"
        field: "total"
        accuracy_decimals: 3
        unit_of_measurement: "m³"
        device_class: "water"
        state_class: "total_increasing"
        icon: "mdi:water"
     ##end wMBus 4.x config

    ##start wMBus 3.x config
    # lqi:
    #   name: "Wodomierz ciepła woda lqi"
    # rssi:
    #   name: "Wodomierz ciepła woda RSSI"
    # total_water_m3:
    #   name:  "Ciepła woda"
    #   id: "ciepla_woda"
    ##start wMBus 3.x config

  - platform: wmbus
    meter_id: 0x18147130 #0x18247718
    type: bmeters
    key: "00000000000000000000000000000000"
    ##start wMBus 4.x config
    sensors:
      - name: "Wodomierz zimna woda RSSI"
        field: "rssi"
        accuracy_decimals: 0
        unit_of_measurement: "dBm"
        device_class: "signal_strength"
        state_class: "measurement"
        entity_category: "diagnostic"
      - name:  "Zimna woda"
        id: "zimna_woda"
        field: "total"
        accuracy_decimals: 3
        unit_of_measurement: "m³"
        device_class: "water"
        state_class: "total_increasing"
        icon: "mdi:water"
    ##end wMBus 4.x config

    ##start wMBus 3.x config
    # lqi:
    #   name: "Wodomierz zimna woda lqi"
    # rssi:
    #   name: "Wodomierz zimna woda RSSI"
    # total_water_m3:
    #   name:  "Zimna woda"
    #   id: "zimna_woda"
    ##start wMBus 3.x config

  # - platform: wmbus
  #   meter_id: 0x00B8DE97
  #   type: bmeters
  #   key: "00000000000000000000000000000000"
  #   lqi:
  #     name: "Nieznany lqi"
  #   rssi:
  #     name: "Nieznany RSSI"
  #   total_water_m3:
  #     name:  "Nieznany woda"
  #     id: "nieznany_0x00B8DE97"

light:
  - platform: status_led
    name: "Switch state"
    pin: GPIO2

Error: The program size (1904393 bytes) is greater than maximum allowed (1835008 bytes)

Using 3.2.3 with the config that's commented out above it is 1771265 bytes.

ThomDietrich commented 1 month ago

Is it necessary to spam this thread with unrelated issues? I don't want to be the party pooper but this could have been its own ticket 😇

Btw looking at your code I wonder if you want to rethink your multi-file design with packages. See an example here.

spitfire commented 1 month ago

Is it necessary to spam this thread with unrelated issues? I don't want to be the party pooper but this could have been its own ticket 😇

@SzczepanLeon I can create another issue for it if you think it's necessary

Btw looking at your code I wonder if you want to rethink your multi-file design with packages. See an example here.

No thanks, I'm good

My current concern is that pretty much the same configuration works with 3.x and doesn't with 4.x

SzczepanLeon commented 1 month ago

I can create another issue for it if you think it's necessary

No - because this is not an issue.

spitfire commented 1 month ago

No - because this is not an issue.

It does not fit (while the previous version did) on a device that's designed to run on with not much else going on on it. Am I "holding it wrong"?

SzczepanLeon commented 1 month ago

This is software on COTS HW, so it is up to you how to fit it. You can remove BLE and try again, or change HW or change partitions layout. But all solutions are not related to my component.

spitfire commented 1 month ago

This is software on COTS HW, so it is up to you how to fit it.

Well it used to, and now it doesn't, based solely on changes in your component. It is the only thing that changed here. With no apparent benefit to my use case.

You can remove BLE and try again, or change HW or change partitions layout. But all solutions are not related to my component.

For BLE I don't want to - why would I want to remove functionality (which is helpful to me) my device currently can provide, and for no apparent benefit?

As for partitioning (apart from it being a big hassle - again for no apparent reason/benefit) unfortunately I can't - the device is far from me and I can't access it physically.

You can slice this issue however you want, and obviously it's up to you what you want to do with your software, how (and if) do you want to support it. I'm just saying it got much bigger than it used to be, which breaks my (and not sure how many other peoples') use case.

SzczepanLeon commented 1 month ago

You can always stay on v3.x

ThomDietrich commented 1 month ago

Back to the issue.

I tried to update the toolchain beyond toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 but that just brings other issues with it. Do you have a hunch what the compiler error stands for? I might play around with the source code some time later...

SzczepanLeon commented 1 month ago

I don't have time to check it. But first thing I will do is to add lots of brackets "()" to those DEFINEs.

spitfire commented 1 month ago

Back to the issue.

I tried to update the toolchain beyond toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 but that just brings other issues with it. Do you have a hunch what the compiler error stands for? I might play around with the source code some time later...

have you tried cleaning up your build files? It helped me with weird build issues like that.

SzczepanLeon commented 1 month ago

@ThomDietrich please try version 4.0.7

ThomDietrich commented 1 month ago

Hey! I can confirm that the code is compiling now. Thank you!!

Fyi

RAM:   [=         ]  12.1% (used 39668 bytes from 327680 bytes)
Flash: [======    ]  62.6% (used 1148608 bytes from 1835008 bytes)
ThomDietrich commented 1 month ago

@spitfire we are only one step further sadly. My ESP32C3 goes into a boot loop. I will try with another ESP32 I have lying around. Could you please share which board/model you used when testing the v4.0? Thanks

spitfire commented 1 month ago

@spitfire we are only one step further sadly. My ESP32C3 goes into a boot loop. I will try with another ESP32 I have lying around. Could you please share which board/model you used when testing the v4.0? Thanks

I was testing it with an ESP8266 and this ESP32 board: https://www.amazon.pl/AZDelivery-ESP32-Development-następca-kompatybilny/dp/B074RGW2VQ

SzczepanLeon commented 1 month ago

Please be precise. Include serial logs and create new issue ...

ThomDietrich commented 1 month ago

https://github.com/SzczepanLeon/esphome-components/issues/135