Why ESPHome might fail compiling a custom component with 'fatal error: string: No such file or directory'

I just spent several hours trying to figure out why ESPHome refused to compile a custom component I was working on. The error message I got was Compiling .pioenvs/datenzwerg-sleepy/src/esphome/components/sound_pressure/sound_pressure_sensor.c.o In file included from src/esphome/components/sound_pressure/sound_pressure_sensor.h:3, from src/esphome/components/sound_pressure/sound_pressure_sensor.c:1: src/esphome/core/component.h:3:10: fatal error: string: No such file or directory 3 | #include <string> | ^~~~~~~~ compilation terminated. Compiling .pioenvs/datenzwerg-sleepy/src/main.cpp.o *** [.pioenvs/datenzwerg-sleepy/src/esphome/components/sound_pressure/sound_pressure_sensor.c.o] Error 1 Other external and internal components compiled just fine, so that was quite a head scratcher, until I just finally noticed something in my source tree: my custom component’s source file had the file ending ....

July 14, 2023 · 1 min
A TFA Dostmann CO2 sensor

TFA Dostmann meets ESPHome

I attended RC3 from December 27th until December 30th. While it was (once again) only a virtual edition of the Chaos Communication Congress, at least this time around I managed to have a similar experience to 36c3, as in, I spent the last two days mostly hanging out with a bunch of fellow geeks in a fun location (a jitsi conference that also included a camera pointing at an aquarium full of fish) and nerding out while tinkering around with electronics....

January 3, 2022 · Updated January 27, 2022 · 4 min