Hello everyone, I am new to programming and platformIO.
Currently using PlatformIO on VS code, Mac OS High Sierra.
I have been working on this tutorial, esp8266 adafruitio dht
I can run it on Arduino IDE, but I cannot get platformIO to read my config.h
I added the config.h file under the lib tab in my project: lib-config-config.h
the error tells me that it can’t read a library that I’ve included in the config.h file
So what’s your file structure of the project? There is no lib-config-config.h
file, only a config.h
file. You should put that file in the same folder as your main sketch (under src/
).
Otherwise you’ll have to show the full error message and give us a copy of your project.
Thank you for your response, I have attached a screen shot of what I’m working with
Could you use pastebin.org (or a new post which uses Markdown for CPP code formatting) to make a copy of main.cpp
, config.h
and platformio.ini
available?
I can successfully build your code when I put config.h
in the src
folder as I described above and explicitly add the library dependencies in the platformio.ini
as
lib_deps =
Adafruit Unified Sensor
DHT sensor library
Adafruit IO Arduino
Adafruit MQTT Library
ArduinoHttpClient

xtensa-lx106-elf-size -B -d .pioenvs\esp8266\firmware.elf
"esptool" -eo "C:\Users\Maxi\.platformio\packages\framework-arduinoespressif8266\bootloaders\eboot\eboot.elf" -bo .pioenvs\esp8266\firmware.bin -bm dio -bf 40 -bz 4M -bs .text -bp 4096 -ec -eo .pioenvs\esp8266\firmware.elf -bs .irom0.text -bs .text -bs .data -bs .rodata -bc -ec
text data bss dec hex filename
326282 6612 30280 363174 58aa6 .pioenvs\esp8266\firmware.elf
[SUCCESS] Took 19.68 seconds
thank you so much for your time, it worked, I thought that I had to save it under the lib folder.