Is there solution for "legacy adc calibration driver is deprecated" warning?

I have compile "#warning “legacy adc calibration driver is deprecated, please migrate to use esp_adc/adc_cali.h and esp_adc/adc_cali_scheme.h” and “legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively” with moisture sensor.
Can somebody tell, is there solution for that?
Thanks

2 Likes

I have the same issue. I follow this post with interest…:slight_smile:

1 Like

Same, getting that ADC error with:

esp32:
  board: esp32-c6-devkitc-1
  flash_size: 4MB
  variant: esp32c6
  framework:
    type: esp-idf
    version: "5.3.1"
    platform_version: 6.9.0
    sdkconfig_options:
      CONFIG_OPENTHREAD_ENABLED: n
      CONFIG_ENABLE_WIFI_STATION: y
      CONFIG_USE_MINIMAL_MDNS: y
      CONFIG_ESPTOOLPY_FLASHSIZE_4MB: y

Any clues anyone?

Adding this, from elsewhere on the forum or Github, got my Firebeetle2 ESP32-C6 working with ADC:

external_components:
  - source:
      type: git
      url: https://github.com/lboue/esphome
      ref: adc_oneshot
    components: [ adc ]
    refresh: 0s # Do not update automatically

I’m also getting this.

Here’s the YAML:

sensor:
    # Resistance sensor that calculates the resistance on the voltage divider circuit 
    # based on the known reference resistor and the unknown resistance in the float valve.
  - platform: resistance
    id: floatSensorResistance
    name: "Float Sensor Resistance"
    sensor: floatSensorVoltage
    accuracy_decimals: 0
    configuration: DOWNSTREAM
    resistor: 831Ohm
    reference_voltage: 3.3V
    on_value:
      then:
        - component.update: tankLevel

    # Source sensor to read the voltage value from the pin.
  - platform: adc
    id: floatSensorVoltage
    name: "Float Sensor Voltage"
    accuracy_decimals: 0
    pin: GPIO34
    update_interval: 1s

Here are the warnings:

Compiling .pioenvs/tankfillsensor3/src/esphome/components/api/api_frame_helper.cpp.o
In file included from src/esphome/components/adc/adc_sensor.h:9,
                 from src/esphome/components/adc/adc_sensor_common.cpp:1:
/data/cache/platformio/packages/framework-espidf/components/esp_adc/deprecated/include/esp_adc_cal.h:17:2: warning: #warning "legacy adc calibration driver is deprecated, please migrate to use esp_adc/adc_cali.h and esp_adc/adc_cali_scheme.h" [-Wcpp]
   17 | #warning "legacy adc calibration driver is deprecated, please migrate to use esp_adc/adc_cali.h and esp_adc/adc_cali_scheme.h"
      |  ^~~~~~~
In file included from src/esphome/components/adc/adc_sensor.h:10:
/data/cache/platformio/packages/framework-espidf/components/driver/deprecated/driver/adc.h:19:2: warning: #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively" [-Wcpp]
   19 | #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively"
      |  ^~~~~~~
In file included from src/esphome/components/adc/adc_sensor.h:9,
                 from src/esphome/components/adc/adc_sensor_esp32.cpp:3:
/data/cache/platformio/packages/framework-espidf/components/esp_adc/deprecated/include/esp_adc_cal.h:17:2: warning: #warning "legacy adc calibration driver is deprecated, please migrate to use esp_adc/adc_cali.h and esp_adc/adc_cali_scheme.h" [-Wcpp]
   17 | #warning "legacy adc calibration driver is deprecated, please migrate to use esp_adc/adc_cali.h and esp_adc/adc_cali_scheme.h"
      |  ^~~~~~~
In file included from src/esphome/components/adc/adc_sensor.h:10:
/data/cache/platformio/packages/framework-espidf/components/driver/deprecated/driver/adc.h:19:2: warning: #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively" [-Wcpp]
   19 | #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively"
      |  ^~~~~~~
Compiling .pioenvs/tankfillsensor3/src/esphome/components/api/api_pb2.cpp.o

I am also having the same issue

esp32:
  board: esp32dev
  framework:
    type: esp-idf

i2s_audio:
  - id: i2s_in
    i2s_lrclk_pin: GPIO27
    i2s_bclk_pin: GPIO26
  - id: i2s_out
    i2s_lrclk_pin: GPIO25
    i2s_bclk_pin: GPIO14

microphone:
  - platform: i2s_audio
    i2s_audio_id: i2s_in
    adc_type: external
    pdm: false
    id: mic_i2s
    i2s_din_pin: GPIO13
    channel: right
    bits_per_sample: 32bit

speaker:
  - platform: i2s_audio
    i2s_audio_id: i2s_out
    id: speaker_i2s
    dac_type: external
    i2s_dout_pin: GPIO32
    channel: mono

Having the same issue was well, wondering whether the migration is necesarry…