Mosibi / Midea-heat-pump-ESPHome

Apache License 2.0
48 stars 11 forks source link

error compiling with new "select:" sensor #24

Closed haute12345 closed 9 months ago

haute12345 commented 9 months ago

I have added registers 1 and 269 to the new selection sensor "select:" and it gives me a compile error. I have updated to the latest version of esphome and the same thing happens. If I comment or delete the two sensors type select: , it already compiles correctly.

i use this framework for my pcb

esp32:
  board: lolin_s2_mini
  variant: esp32s2
  framework:
    type: esp-idf

The error:

INFO ESPHome 2023.12.9
INFO Reading configuration /config/test.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing heatpump (board: lolin_s2_mini; framework: espidf; platform: platformio/espressif32@5.4.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32S2 240MHz, 320KB RAM, 4MB Flash
 - framework-espidf @ 3.40405.230623 (4.4.5) 
 - tool-cmake @ 3.16.4 
 - tool-ninja @ 1.7.1 
 - toolchain-esp32ulp @ 2.35.0-20220830 
 - toolchain-riscv32-esp @ 8.4.0+2021r2-patch5 
 - toolchain-xtensa-esp32s2 @ 8.4.0+2021r2-patch5
Reading CMake configuration...
Dependency Graph
|-- noise-c @ 0.1.4
|-- ArduinoJson @ 6.18.5
Compiling .pioenvs/heatpump/src/esphome/components/api/api_connection.o
Compiling .pioenvs/heatpump/src/esphome/components/api/api_frame_helper.o
Compiling .pioenvs/heatpump/src/esphome/components/api/api_pb2.o
Compiling .pioenvs/heatpump/src/esphome/components/api/api_pb2_service.o
Compiling .pioenvs/heatpump/src/esphome/components/api/api_server.o
Compiling .pioenvs/heatpump/src/esphome/components/api/list_entities.o
Compiling .pioenvs/heatpump/src/esphome/components/api/proto.o
Compiling .pioenvs/heatpump/src/esphome/components/api/subscribe_state.o
Compiling .pioenvs/heatpump/src/esphome/components/api/user_services.o
Compiling .pioenvs/heatpump/src/esphome/components/binary_sensor/automation.o
Compiling .pioenvs/heatpump/src/esphome/components/binary_sensor/binary_sensor.o
Compiling .pioenvs/heatpump/src/esphome/components/binary_sensor/filter.o
Compiling .pioenvs/heatpump/src/esphome/components/captive_portal/captive_portal.o
Compiling .pioenvs/heatpump/src/esphome/components/esp32/gpio.o
Compiling .pioenvs/heatpump/src/esphome/components/esp32/preferences.o
Compiling .pioenvs/heatpump/src/esphome/components/json/json_util.o
Compiling .pioenvs/heatpump/src/esphome/components/logger/logger.o
Compiling .pioenvs/heatpump/src/esphome/components/md5/md5.o
Compiling .pioenvs/heatpump/src/esphome/components/mdns/mdns_component.o
Compiling .pioenvs/heatpump/src/esphome/components/mdns/mdns_esp32.o
Compiling .pioenvs/heatpump/src/esphome/components/mdns/mdns_esp8266.o
Compiling .pioenvs/heatpump/src/esphome/components/mdns/mdns_host.o
Compiling .pioenvs/heatpump/src/esphome/components/mdns/mdns_libretiny.o
Compiling .pioenvs/heatpump/src/esphome/components/mdns/mdns_rp2040.o
Compiling .pioenvs/heatpump/src/esphome/components/modbus/modbus.o
Compiling .pioenvs/heatpump/src/esphome/components/modbus_controller/binary_sensor/modbus_binarysensor.o
Compiling .pioenvs/heatpump/src/esphome/components/modbus_controller/modbus_controller.o
Compiling .pioenvs/heatpump/src/esphome/components/modbus_controller/number/modbus_number.o
Compiling .pioenvs/heatpump/src/esphome/components/modbus_controller/sensor/modbus_sensor.o
Compiling .pioenvs/heatpump/src/esphome/components/modbus_controller/switch/modbus_switch.o
Compiling .pioenvs/heatpump/src/esphome/components/network/util.o
Compiling .pioenvs/heatpump/src/esphome/components/number/automation.o
Compiling .pioenvs/heatpump/src/esphome/components/number/number.o
Compiling .pioenvs/heatpump/src/esphome/components/number/number_call.o
Compiling .pioenvs/heatpump/src/esphome/components/number/number_traits.o
Compiling .pioenvs/heatpump/src/esphome/components/ota/ota_backend_arduino_esp32.o
Compiling .pioenvs/heatpump/src/esphome/components/ota/ota_backend_arduino_esp8266.o
Compiling .pioenvs/heatpump/src/esphome/components/ota/ota_backend_arduino_libretiny.o
Compiling .pioenvs/heatpump/src/esphome/components/ota/ota_backend_arduino_rp2040.o
Compiling .pioenvs/heatpump/src/esphome/components/ota/ota_backend_esp_idf.o
Compiling .pioenvs/heatpump/src/esphome/components/ota/ota_component.o
Compiling .pioenvs/heatpump/src/esphome/components/sensor/automation.o
Compiling .pioenvs/heatpump/src/esphome/components/sensor/filter.o
Compiling .pioenvs/heatpump/src/esphome/components/sensor/sensor.o
Compiling .pioenvs/heatpump/src/esphome/components/socket/bsd_sockets_impl.o
Compiling .pioenvs/heatpump/src/esphome/components/socket/lwip_raw_tcp_impl.o
Compiling .pioenvs/heatpump/src/esphome/components/socket/lwip_sockets_impl.o
Compiling .pioenvs/heatpump/src/esphome/components/socket/socket.o
Compiling .pioenvs/heatpump/src/esphome/components/switch/automation.o
Compiling .pioenvs/heatpump/src/esphome/components/switch/switch.o
Compiling .pioenvs/heatpump/src/esphome/components/template/binary_sensor/template_binary_sensor.o
Compiling .pioenvs/heatpump/src/esphome/components/template/text_sensor/template_text_sensor.o
Compiling .pioenvs/heatpump/src/esphome/components/text_sensor/filter.o
Compiling .pioenvs/heatpump/src/esphome/components/text_sensor/text_sensor.o
Compiling .pioenvs/heatpump/src/esphome/components/uart/uart.o
Compiling .pioenvs/heatpump/src/esphome/components/uart/uart_component.o
Compiling .pioenvs/heatpump/src/esphome/components/uart/uart_component_esp32_arduino.o
Compiling .pioenvs/heatpump/src/esphome/components/uart/uart_component_esp8266.o
Compiling .pioenvs/heatpump/src/esphome/components/uart/uart_component_esp_idf.o
Compiling .pioenvs/heatpump/src/esphome/components/uart/uart_component_libretiny.o
Compiling .pioenvs/heatpump/src/esphome/components/uart/uart_component_rp2040.o
Compiling .pioenvs/heatpump/src/esphome/components/uart/uart_debugger.o
Compiling .pioenvs/heatpump/src/esphome/components/uptime/uptime_sensor.o
Compiling .pioenvs/heatpump/src/esphome/components/web_server/list_entities.o
Compiling .pioenvs/heatpump/src/esphome/components/web_server/web_server.o
Compiling .pioenvs/heatpump/src/esphome/components/web_server_base/web_server_base.o
Compiling .pioenvs/heatpump/src/esphome/components/web_server_idf/web_server_idf.o
Compiling .pioenvs/heatpump/src/esphome/components/wifi/wifi_component.o
Compiling .pioenvs/heatpump/src/esphome/components/wifi/wifi_component_esp32_arduino.o
Compiling .pioenvs/heatpump/src/esphome/components/wifi/wifi_component_esp8266.o
Compiling .pioenvs/heatpump/src/esphome/components/wifi/wifi_component_esp_idf.o
Compiling .pioenvs/heatpump/src/esphome/components/wifi/wifi_component_libretiny.o
Compiling .pioenvs/heatpump/src/esphome/components/wifi/wifi_component_pico_w.o
Compiling .pioenvs/heatpump/src/esphome/core/application.o
Compiling .pioenvs/heatpump/src/esphome/core/component.o
Compiling .pioenvs/heatpump/src/esphome/core/component_iterator.o
Compiling .pioenvs/heatpump/src/esphome/core/controller.o
Compiling .pioenvs/heatpump/src/esphome/core/entity_base.o
Compiling .pioenvs/heatpump/src/esphome/core/helpers.o
Compiling .pioenvs/heatpump/src/esphome/core/log.o
Compiling .pioenvs/heatpump/src/esphome/core/ring_buffer.o
Compiling .pioenvs/heatpump/src/esphome/core/scheduler.o
Compiling .pioenvs/heatpump/src/esphome/core/string_ref.o
Compiling .pioenvs/heatpump/src/esphome/core/util.o
Compiling .pioenvs/heatpump/src/main.o
Linking .pioenvs/heatpump/firmware.elf
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: .pioenvs/heatpump/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection14select_commandERKNS0_20SelectCommandRequestE+0x0): undefined reference to `esphome::select::SelectCall::set_option(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: .pioenvs/heatpump/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection14select_commandERKNS0_20SelectCommandRequestE+0x4): undefined reference to `esphome::select::SelectCall::perform()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: .pioenvs/heatpump/src/esphome/components/api/api_connection.o:(.literal._ZN7esphome3api13APIConnection16send_select_infoEPNS_6select6SelectE+0x4): undefined reference to `esphome::select::SelectTraits::get_options[abi:cxx11]() const'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: .pioenvs/heatpump/src/esphome/components/api/api_connection.o: in function `esphome::api::APIConnection::select_command(esphome::api::SelectCommandRequest const&)':
/config/.esphome/build/heatpump/src/esphome/components/api/api_connection.cpp:771: undefined reference to `esphome::select::SelectCall::set_option(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: /config/.esphome/build/heatpump/src/esphome/components/api/api_connection.cpp:772: undefined reference to `esphome::select::SelectCall::perform()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: .pioenvs/heatpump/src/esphome/components/api/api_connection.o: in function `esphome::api::APIConnection::send_select_info(esphome::select::Select*)':
/config/.esphome/build/heatpump/src/esphome/components/api/api_connection.cpp:758: undefined reference to `esphome::select::SelectTraits::get_options[abi:cxx11]() const'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: .pioenvs/heatpump/src/esphome/components/web_server/web_server.o: in function `std::_Function_handler<void (), esphome::web_server::WebServer::handle_select_request(esphome::web_server_idf::AsyncWebServerRequest*, esphome::web_server::UrlMatch const&)::{lambda()#1}>::_M_invoke(std::_Any_data const&)':
/config/.esphome/build/heatpump/src/esphome/components/web_server/web_server.cpp:925: undefined reference to `esphome::select::SelectCall::perform()'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: .pioenvs/heatpump/src/esphome/components/web_server/web_server.o: in function `esphome::web_server::WebServer::handle_select_request(esphome::web_server_idf::AsyncWebServerRequest*, esphome::web_server::UrlMatch const&)':
/config/.esphome/build/heatpump/src/esphome/components/web_server/web_server.cpp:921: undefined reference to `esphome::select::SelectCall::set_option(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: .pioenvs/heatpump/src/esphome/components/web_server/web_server.o: in function `ArduinoJson6185_71::VariantRef ArduinoJson6185_71::ObjectRef::getOrAddMember<char const>(char const*) const':
/config/.esphome/build/heatpump/.piolibdeps/heatpump/ArduinoJson/src/ArduinoJson/Object/ObjectRef.hpp:208: undefined reference to `esphome::select::SelectTraits::get_options[abi:cxx11]() const'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: .pioenvs/heatpump/src/main.o:(.literal._ZN7esphome17modbus_controller12ModbusSelectC5ENS0_15SensorValueTypeEthtbSt6vectorIxSaIxEE[esphome::modbus_controller::ModbusSelect::ModbusSelect(esphome::modbus_controller::SensorValueType, unsigned short, unsigned char, unsigned short, bool, std::vector<long long, std::allocator<long long> >)]+0x0): undefined reference to `vtable for esphome::modbus_controller::ModbusSelect'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: .pioenvs/heatpump/src/main.o:(.literal._ZN7esphome17modbus_controller12ModbusSelectC5ENS0_15SensorValueTypeEthtbSt6vectorIxSaIxEE[esphome::modbus_controller::ModbusSelect::ModbusSelect(esphome::modbus_controller::SensorValueType, unsigned short, unsigned char, unsigned short, bool, std::vector<long long, std::allocator<long long> >)]+0x4): undefined reference to `vtable for esphome::modbus_controller::ModbusSelect'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: .pioenvs/heatpump/src/main.o:(.literal._ZN7esphome17modbus_controller12ModbusSelectC5ENS0_15SensorValueTypeEthtbSt6vectorIxSaIxEE[esphome::modbus_controller::ModbusSelect::ModbusSelect(esphome::modbus_controller::SensorValueType, unsigned short, unsigned char, unsigned short, bool, std::vector<long long, std::allocator<long long> >)]+0x8): undefined reference to `vtable for esphome::modbus_controller::ModbusSelect'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: .pioenvs/heatpump/src/main.o:(.literal._Z5setupv+0xcbc): undefined reference to `esphome::select::SelectTraits::set_options(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: .pioenvs/heatpump/src/main.o: in function `esphome::modbus_controller::ModbusController* esphome::Application::register_component<esphome::modbus_controller::ModbusController>(esphome::modbus_controller::ModbusController*)':
/config/.esphome/build/heatpump/src/esphome/core/application.h:149: undefined reference to `esphome::select::SelectTraits::set_options(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: .pioenvs/heatpump/src/main.o: in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()':
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s2/xtensa-esp32s2-elf/include/c++/8.4.0/bits/basic_string.h:657: undefined reference to `esphome::select::SelectTraits::set_options(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: .pioenvs/heatpump/src/esphome/core/controller.o:(.literal._ZN7esphome10Controller16setup_controllerEb+0x30): undefined reference to `esphome::select::Select::add_on_state_callback(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int)>&&)'
/config/.esphome/platformio/packages/toolchain-xtensa-esp32s2/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: .pioenvs/heatpump/src/esphome/core/controller.o: in function `esphome::Controller::setup_controller(bool)':
/config/.esphome/build/heatpump/src/esphome/core/controller.cpp:71: undefined reference to `esphome::select::Select::add_on_state_callback(std::function<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned int)>&&)'
collect2: error: ld returned 1 exit status
*** [.pioenvs/heatpump/firmware.elf] Error 1
========================= [FAILED] Took 33.77 seconds =========================
haute12345 commented 9 months ago

I have resolved the error by deleting the build and compiling again. It can be done from the esphome webUI itself. It seems to be a very common mistake when new functionalities are added to libraries. Older builds remain in our cache.