Config with platform adc no longer compiles with 2024.12

Hey,

I have an ESP using the adc platform that no longer compiles since 2024.12. It compiled and is working right now with version 2024.11.3. I read that there were breaking changes with 2024.12, but I don’t see how they apply. I’m pretty dumb with this esp stuff so I could use some help please.

Config:

esphome:
  name: radon-manometer
  platform: ESP32
  board: nodemcu-32s

sensor:
  - platform: adc
    id: pressure_sensor
    pin: GPIO39
    name: "vacuum"
    update_interval: 0.1s
    unit_of_measurement: "in"
    accuracy_decimals: 2
    attenuation: auto
    filters:
      - lambda: return ((x-0.1)/3.0*300.0-100.0)-1.8;
      - exponential_moving_average:
          alpha: 0.01
          send_every: 100

Error:

/opt/esphome/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor_common.cpp.o: in function `esphome::adc::ADCSensor::get_setup_priority() const':
/opt/esphome/.esphome/build/radon-manometer/src/esphome/components/adc/adc_sensor_common.cpp:21: multiple definition of `esphome::adc::ADCSensor::get_setup_priority() const'; .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor.cpp.o:/opt/esphome/.esphome/build/radon-manometer/src/esphome/components/adc/adc_sensor.cpp:145: first defined here
/opt/esphome/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor_common.cpp.o: in function `esphome::adc::ADCSensor::get_setup_priority() const':
/opt/esphome/.esphome/build/radon-manometer/src/esphome/components/adc/adc_sensor_common.cpp:21: multiple definition of `non-virtual thunk to esphome::adc::ADCSensor::get_setup_priority() const'; .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor.cpp.o:/opt/esphome/.esphome/build/radon-manometer/src/esphome/components/adc/adc_sensor.cpp:145: first defined here
/opt/esphome/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor_common.cpp.o: in function `esphome::adc::ADCSensor::update()':
/opt/esphome/.esphome/build/radon-manometer/src/esphome/components/adc/adc_sensor_common.cpp:9: multiple definition of `esphome::adc::ADCSensor::update()'; .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor.cpp.o:/opt/esphome/.esphome/build/radon-manometer/src/esphome/components/adc/adc_sensor.cpp:146: first defined here
/opt/esphome/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor_common.cpp.o: in function `non-virtual thunk to esphome::adc::ADCSensor::update()':
adc_sensor_common.cpp:(.text._ZThn80_N7esphome3adc9ADCSensor6updateEv+0x0): multiple definition of `non-virtual thunk to esphome::adc::ADCSensor::update()'; .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor.cpp.o:adc_sensor.cpp:(.text._ZThn80_N7esphome3adc9ADCSensor6updateEv+0x0): first defined here
/opt/esphome/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor_common.cpp.o: in function `esphome::adc::ADCSensor::set_sample_count(unsigned char)':
/opt/esphome/.esphome/build/radon-manometer/src/esphome/components/adc/adc_sensor_common.cpp:15: multiple definition of `esphome::adc::ADCSensor::set_sample_count(unsigned char)'; .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor.cpp.o:/opt/esphome/.esphome/build/radon-manometer/src/esphome/components/adc/adc_sensor.cpp:152: first defined here
/opt/esphome/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor_esp32.cpp.o: in function `esphome::adc::ADCSensor::setup()':
/opt/esphome/.esphome/build/radon-manometer/src/esphome/components/adc/adc_sensor_esp32.cpp:24: multiple definition of `esphome::adc::ADCSensor::setup()'; .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor.cpp.o:/opt/esphome/.esphome/build/radon-manometer/src/esphome/components/adc/adc_sensor.cpp:46: first defined here
/opt/esphome/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor_esp32.cpp.o: in function `non-virtual thunk to esphome::adc::ADCSensor::setup()':
adc_sensor_esp32.cpp:(.text._ZThn80_N7esphome3adc9ADCSensor5setupEv+0x0): multiple definition of `non-virtual thunk to esphome::adc::ADCSensor::setup()'; .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor.cpp.o:adc_sensor.cpp:(.text._ZThn80_N7esphome3adc9ADCSensor5setupEv+0x0): first defined here
/opt/esphome/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor_esp32.cpp.o: in function `esphome::adc::ADCSensor::dump_config()':
/opt/esphome/.esphome/build/radon-manometer/src/esphome/components/adc/adc_sensor_esp32.cpp:57: multiple definition of `esphome::adc::ADCSensor::dump_config()'; .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor.cpp.o:/opt/esphome/.esphome/build/radon-manometer/src/esphome/components/adc/adc_sensor.cpp:96: first defined here
/opt/esphome/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor_esp32.cpp.o: in function `non-virtual thunk to esphome::adc::ADCSensor::dump_config()':
adc_sensor_esp32.cpp:(.text._ZThn80_N7esphome3adc9ADCSensor11dump_configEv+0x0): multiple definition of `non-virtual thunk to esphome::adc::ADCSensor::dump_config()'; .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor.cpp.o:adc_sensor.cpp:(.text._ZThn80_N7esphome3adc9ADCSensor11dump_configEv+0x0): first defined here
/opt/esphome/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor_esp32.cpp.o: in function `esphome::adc::ADCSensor::sample()':
/opt/esphome/.esphome/build/radon-manometer/src/esphome/components/adc/adc_sensor_esp32.cpp:84: multiple definition of `esphome::adc::ADCSensor::sample()'; .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor.cpp.o:/opt/esphome/.esphome/build/radon-manometer/src/esphome/components/adc/adc_sensor.cpp:177: first defined here
/opt/esphome/.platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor_esp32.cpp.o: in function `non-virtual thunk to esphome::adc::ADCSensor::sample()':
adc_sensor_esp32.cpp:(.text._ZThn100_N7esphome3adc9ADCSensor6sampleEv+0x0): multiple definition of `non-virtual thunk to esphome::adc::ADCSensor::sample()'; .pioenvs/radon-manometer/src/esphome/components/adc/adc_sensor.cpp.o:adc_sensor.cpp:(.text._ZThn100_N7esphome3adc9ADCSensor6sampleEv+0x0): first defined here
collect2: error: ld returned 1 exit status
*** [.pioenvs/radon-manometer/firmware.elf] Error 1

Clean the build first. You likely have incompatible object files left from previous builds.

Tried that I think. Prior to posting I had already tried deleting the .platformio and .esphome directories and tried compiling again. No success. Is there something else I should be doing to clean the build?

Yes it’s an option in the ESP device card three dot menu in the add-on.

I compile and upload my ESP firmware from yaml files on the command line (esphome run…) and add the device to Home Assistant in the GUI. So the three dot menu won’t apply here. Pretty sure wiping out the .platformio and .esphome directories is all I need to do to clean the build when compiling on the command line. The errors I’m getting are from the compile on the command line.

I was more thinking maybe something changed and I need to change something in my yaml file, what that would be I have no idea. This is where I’m looking for help. Or maybe there’s a bug in the adc sensor stuff and I should be opening an issue with the devs.

Ah right yeah I was. Couldn’t post the screen shot earlier.


.

There is a CLI version: Command Line Interface — ESPHome

“esphome clean” just deleted some stuff from .esphome. So ya me deleting the .platformio and .esphome directories accomplished cleaning the build files. So we’re back to square 1. Thanks though.

There are 3 versions of Esphome 2024.12 (2024.12.0 - 2024.12.2), which version do you use and how did you install that version? Did you run the setup script after you updated the esphome version on the environment you are using? If I compile your code in a clean Esphome 2024.12.2 docker container I only get some ‘deprecated’ warning, but compilation is successful.

Right now I’m running 2024.12.2. The issue started with 2024.12.0. I am doing everything via the command line. Initial install via pip and continued upgrading via pip.

pip3.9 install -U --user esphome


Compiling is done via the command line too.

esphome run radon-manometer.yml

To me it looks like your install is corrupt. Maybe you should try an uninstall and reinstall again.

Guess so. Didn’t expect it to work, but figured I would do it so I could say I did. pip uninstalled esphome, esphome-dashboard, and esptool, went into my .local dir and blew away everything esp, and installed from scratch. Compiles now.

1 Like