mattlward
(Matt Ward)
February 20, 2025, 8:07pm
1
I am currently running the latest ESPHome Builder and the latest version of ESPHome on my ESP32 boards. Every time I compile I get this set of linking errors. I figured during the last couple of ESPHome Builder updates something would get cleaned up and they would go away, but they have not. Can anyone tell me how to fix this or even if I need to fix it?
I am running:
Core 2025.1.4
OS 14.2
Supervisor 2025.02.1
ESPHome 2025.2.0
On bare metal Gen8 i5
Thanks Matt
Compiling .pioenvs/esphome-web-8281ec/src/main.cpp.o
In file included from src/esphome/components/adc/adc_sensor.h:9,
from src/esphome.h:3,
from src/main.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"
| ^~~~~~~
In file included from src/esphome/components/pulse_counter/pulse_counter_sensor.h:10,
from src/esphome/components/pulse_counter/automation.h:5,
from src/esphome.h:57:
/data/cache/platformio/packages/framework-espidf/components/driver/deprecated/driver/pcnt.h:15:2: warning: #warning "legacy pcnt driver is deprecated, please migrate to use driver/pulse_cnt.h" [-Wcpp]
15 | #warning "legacy pcnt driver is deprecated, please migrate to use driver/pulse_cnt.h"
| ^~~~~~~
Linking .pioenvs/esphome-web-8281ec/firmware.elf
RAM: [= ] 10.1% (used 32988 bytes from 327680 bytes)
Flash: [===== ] 53.3% (used 978257 bytes from 1835008 bytes)
zoogara
(Daryl)
February 21, 2025, 3:54am
2
Try a clean build first. In the ESPHome builder, there’s an ellipsis menu bottom right of the device. Select that and choose “Clean Build Files” and see if the warnings go away next time you compile.
If that doesn’t work - look for open issues on Github and maybe log a new one if it’s not already done.
mattlward
(Matt Ward)
February 21, 2025, 4:11am
3
So, the clean build did not make a difference. I assumed that new build files were downloaded with every update to ESPHome that is why this is driving me nuts. Will poke around on GitHub and see if I can find anything.
Protoncek
(Pavel)
February 21, 2025, 8:38am
5
These are warnings, not errors, i have them, too. And they appear for quite a while now if you use adc component. Obviously, some library in adc component is still being used in esphome but it’s deprecated, old… thus warning. For now, all still works fine, but the question is how long…
And, to be honest, i didn’t explore if someone already reported this.
mattlward
(Matt Ward)
February 23, 2025, 6:44am
6
My full yaml, including the pull for adc is posted in this thread regarding pulse count doing the same thing.
opened 04:43AM - 21 Feb 25 UTC
### The problem
I am getting the following when compiling my code for ESP32.
I… n file included from src/esphome/components/pulse_counter/pulse_counter_sensor.h:10,
from src/esphome/components/pulse_counter/automation.h:5,
from src/esphome.h:57:
/data/cache/platformio/packages/framework-espidf/components/driver/deprecated/driver/pcnt.h:15:2: warning: #warning "legacy pcnt driver is deprecated, please migrate to use driver/pulse_cnt.h" [-Wcpp]
15 | #warning "legacy pcnt driver is deprecated, please migrate to use driver/pulse_cnt.h"
| ^~~~~~~
### Which version of ESPHome has the issue?
ESPHome 2025.2.0
### What type of installation are you using?
Home Assistant Add-on
### Which version of Home Assistant has the issue?
Core 2025.1.4
### What platform are you using?
ESP32-IDF
### Board
esp-wroom-32d generic dev board.
### Component causing the issue
Pulse counter
### YAML Config
```yaml
substitutions:
name: esphome-web-8281ec
friendly_name: Apple Fan Controller
devicename: apple-fan
esphome_platform: esp32
esphome_board: esp32dev
esphome_project_name: Apple.temperature_control
esphome_project_version: apple-fan-v.1
esphome:
name: $name
friendly_name: Apple Fan Controller
name_add_mac_suffix: false
project:
name: $esphome_project_name
version: $esphome_project_version
on_boot:
# Power up fan at boot
priority: 800
then:
- if:
condition:
api.connected:
then:
- logger.log: API is connected! Now we can trigger what we want!
esp32:
board: esp32dev
framework:
type: esp-idf
external_components:
- source: github://pr#7942
refresh: 30s
components:
- adc
# Enable logging
logger:
level: debug
logs:
sht3xd.component: info
# Enable Home Assistant API
api:
reboot_timeout: 0s
# Allow Over-The-Air updates
ota:
- platform: esphome
wifi:
domain: .home
ssid: !secret wifi_ssid
password: !secret wifi_password
# Set up a wifi access point
ap:
ssid: ${friendly_name}
password: '12345678'
dashboard_import:
package_import_url: github://mattlward/Apple-Fan-v1/esphome-web-8281ec.yaml@main
import_full_config: true
web_server:
include_internal: true
status_led:
pin:
number: GPIO2
inverted: false
i2c:
- id: bus_a
sda: GPIO21
scl: GPIO22
scan: true
frequency: 100kHz
- id: bus_b
sda: GPIO16
scl: GPIO17
scan: true
frequency: 400kHz
display:
- platform: lcd_pcf8574
id: mydisplay
dimensions: 16x2
i2c_id: bus_b
address: 0x27
lambda: |-
//Print sensor temperature, spd % and RPM on line 0
it.printf(0,0,"%.0fF", id(sht30t).state);
it.printf(4,0,"%.0f%%", id(slider).state);
//it.printf(4,0,"%.0fRPM", id(fan_pulse).state);
it.printf(9,0,"+%.3fV", id(ps5v).state);
it.printf(0, 1, "%s", id(addr).state.c_str());
if (id(apple_backlight).state) {
// Binary sensor is on
// Control backlight on mydisplay
// Binary sensor is on in HA
id(mydisplay).backlight();
} else {
// Binary sensor is off in HA
id(mydisplay).no_backlight();
}
# //Print time on line 1
# it.strftime(1,1,"%I:%M%p %m/%d", id(my_time).now());
# it.printf(1,0,,displayText = name);
output:
- platform: ledc
id: apple_pwm_speed
pin: GPIO27
frequency: 25000Hz
number:
- platform: template
name: Pwm Fan Slider
id: slider
internal: false
min_value: 15
max_value: 100
step: 1
optimistic: true
unit_of_measurement: '%'
set_action:
then:
- output.set_level:
id: apple_pwm_speed
level: !lambda "return x/100;"
text_sensor:
# Expose WiFi information as sensors.
- platform: wifi_info
ip_address:
name: IP address
id: addr
ssid:
name: SSID
id: ssid
mac_address:
name: ESP Mac Wifi Address
# Send Uptime in raw seconds
- platform: template
name: $friendly_name Uptime
id: uptime_human
icon: mdi:clock-start
sensor:
- platform: sht3xd
temperature:
name: Apple Internal Temperature
id: sht30t
internal: false
accuracy_decimals: 1
filters:
- lambda: return x * (9.0/5.0) + 32.0;
unit_of_measurement: °F
on_value:
then:
- lambda: |-
const int min_temp = 70; // Minimum temperature threshold (°F)
const int max_temp = 85; // Maximum temperature threshold (°F)
const int min_speed = 15; // Minimum fan speed percentage (%)
const int max_speed = 100; // Maximum fan speed percentage (%)
// Create a call to update the fan speed
auto call = id(slider).make_call();
// Get the temperature value
int temp = ceil(x);
// Calculate the fan speed
int speed = ceil(min_speed + ((temp - min_temp) * (max_speed - min_speed) / (max_temp - min_temp)));
// Ensure the calculated speed stays within the defined limits
speed = clamp(speed, min_speed, max_speed); // If you are using framework: type: esp-idf
// ▲▲▲ ▼▼▼ If you get an error when compiling, try inverting the comment on these lines.
//speed = constrain(speed, min_speed, max_speed); // If you are using framework: type: arduino
call.set_value(speed);
// Publish the new speed value
call.perform();
# int min_temp = 70; // Adjust here
# int max_temp = 85; // Adjust here
# int mim_speed = 15; // Adjust here
# int max_speed = 100; // Adjust here
# int temp = floor(x);
# int speed = floor(mim_speed + ((temp - min_temp) * (max_speed - mim_speed) / (max_temp - min_temp)));
# if (temp <= (min_temp)) { // If the temperature is less than 70º F, set the speed to 15%
# auto call = id(slider).make_call();
# call.set_value(mim_speed);
# call.perform();
# } else if (temp < (max_temp)) { // If the temperature is less than 85º F, set the speed to XX%
# auto call = id(slider).make_call();
# call.set_value(speed);
# call.perform();
# } else { // If the temperature is higher than 85º C, set the speed to 100%
# auto call = id(slider).make_call();
# call.set_value(100);
# call.perform();
# }
humidity:
name: Apple Internal Humidity
id: sht30h
internal: false
accuracy_decimals: 0
filters:
- sliding_window_moving_average:
window_size: 15
send_every: 15
i2c_id: bus_a
address: 0x44
update_interval: 5s
# Fan Speed
- platform: pulse_counter
pin:
number: GPIO25
mode:
input: true
pullup: true
name: PWM Fan RPM
id: fan_pulse
unit_of_measurement: RPM
internal: false
accuracy_decimals: 0
filters:
- multiply: 0.5
count_mode:
rising_edge: INCREMENT
falling_edge: DISABLE
update_interval: 3s
# Measure +5v rail
- platform: adc
id: ps5v
pin: GPIO36
name: "PS5v"
update_interval: 15s
internal: false
attenuation: 12db
samples: 2
accuracy_decimals: 3
filters:
- multiply: 1.824
# Send WiFi signal strength & uptime to HA
- platform: wifi_signal
name: $friendly_name WiFi Strength
update_interval: 60s
- platform: uptime
name: $friendly_name Uptime
id: uptime_sensor
update_interval: 60s
on_raw_value:
then:
- text_sensor.template.publish:
id: uptime_human
# Custom C++ code to generate the result
state: !lambda |-
int seconds = round(id(uptime_sensor).raw_state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
return (
(days ? to_string(days) + "d " : "") +
(hours ? to_string(hours) + "h " : "") +
(minutes ? to_string(minutes) + "m " : "") +
(to_string(seconds) + "s")
).c_str();
binary_sensor:
- platform: homeassistant
id: apple_backlight
entity_id: input_boolean.esphome_apple_backlight
internal: false
time:
- platform: homeassistant
id: my_time
#- platform: sntp
# id: my_time
# timezone: UTC
# servers:
# - 0.pool.ntp.org
# - 1.pool.ntp.org
# - 2.pool.ntp.org
switch:
- platform: restart
name: Restart
```
### Anything in the logs that might be useful for us?
```txt
Compiling .pioenvs/esphome-web-8281ec/src/main.cpp.o
In file included from src/esphome/components/adc/adc_sensor.h:9,
from src/esphome.h:3,
from src/main.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"
| ^~~~~~~
In file included from src/esphome/components/pulse_counter/pulse_counter_sensor.h:10,
from src/esphome/components/pulse_counter/automation.h:5,
from src/esphome.h:57:
/data/cache/platformio/packages/framework-espidf/components/driver/deprecated/driver/pcnt.h:15:2: warning: #warning "legacy pcnt driver is deprecated, please migrate to use driver/pulse_cnt.h" [-Wcpp]
15 | #warning "legacy pcnt driver is deprecated, please migrate to use driver/pulse_cnt.h"
| ^~~~~~~
Linking .pioenvs/esphome-web-8281ec/firmware.elf
RAM: [= ] 10.1% (used 32988 bytes from 327680 bytes)
Flash: [===== ] 53.3% (used 978257 bytes from 1835008 bytes)
```
### Additional information
I did resolve the same class of warning for adc by adding this:
external_components:
- source: github://pr#7942
refresh: 30s
components:
- adc