Problems with platformIO and seemingly missing file (ESP01-1M)

Hello,

I am using platformIO to write some code for my project. When I tried building today I got 2 errors in my “c_cpp_properties.json” file.


I checked with windows explorer if I could manually find this file manually but no luck.

This error came up in my own project but when I create a new esp01_1m project the same problem occurs. The only include in there is the Arduino.h.

I have tried removing the .json and regenerating it, removing the toolchain-xtensa and reinstalling the espressif8266 platform on platpromIO.

I have tried looking online if I could find a solution but have not been able to find one yet. I was hoping someone here could help me.

Thank you very much.

You are correct – the script adds this non-existant folder to the include path. This is done here

In the previous 2.7.4 core version, this directory did exist. In the latatest 3.0.0 core version, it does not, but the Arduino-ESP8266 people did not update the platformio-build.py properly to reflect this change.

A PR that fixes this is proposed in Remove include and lib folders removed since 3.0.0 core by maxgerhardt · Pull Request #8125 · esp8266/Arduino · GitHub.

If it really bothers you, you can apply this change locally by modifying C:\Users\<user>\.platformio\packages\framework-arduinoespressif8266\tools\platformio-build.py with the changes shown in the PR.

However, this has 0 effect on any built firmware. Since these directories don’t exist, they are just ignored. This cannot cause a non-working firmware etc. It is just that VSCode complains (correctly) about being given a non-existant include directory.

2 Likes

Thank you so much! I really felt like I was stuck. I will see if the merge request has been accepted tomorrow morning and if not I will “DIY” it.

Even if it gets accepted quickly in the Arduino-ESP8266 repository, it will not be used instantly by PlatformIO. It’ll just be there sitting in the master branch. PlatformIO only updates its internal Arduino core package when a new release comes out, see here.

You can of course use platform_packages to tell PlatformIO to use a bleeding-edge git version of the Arduino-ESP8266 core, e.g. as covered some time ago in Custom framework and toolset for Arduino ESP8266 3.0.0 - #2 by maxgerhardt, by adding

platform_packages =
   framework-arduinoespressif8266 @ https://github.com/esp8266/Arduino.git

to the platformio.ini of the project.

This will then however be a per-project fix. And you will have a slight discrepency between the 3.0.0 release version of the core and the bleeding-edge git version of the repo, potentially causing bugs.

So, I’d rather advise to do the change once locally in platformio-build.py, this way it automically fixes it for every project using this core, without using special instructions. In the core version after 3.0.0, this will be fixed automatically then if the PR is accepted and PlatformIO updates to it.

2 Likes

Thank you for the helpful tip! I will change the .py file in my case. Your help has been really helpful to me!