My PlatformIO Projects Now Compile With Errors And I Cannot Figure Out Why?

I have been using PlatformIO for several years, but recently, it feels like I’d rather poke myself in the eye with a sharp stick than continue with it.

My routine has always been to save all my work onto my server with comments. This method allows me to return to a known working project when needed. It has also enabled me to seamlessly switch between my desktop and laptop, which has worked perfectly for years.

However, this all changed when I discovered the ESP32 Cheap Yellow Display (CYD) Board. While I love this board, I cannot seem to follow instructions from websites and get their code to compile error free.

The few programs that I did manage to compile without errors were carefully preserved on my server. Initially (as I have always done), I could copy these projects back to either of my two computers, and they would compile without issues. But in the last week or so, this no longer works. I can no longer copy a known working project back to either of my computers as they now compile with errors.

I do not have any “lib_deps” in my platformio.ini, so I don’t think the libraries should be changing. Interestingly, I can move any of these projects over to Arduino IDE 2.3.4, and they compile and run flawlessly!

I have spent countless hours searching for a solution and trying different approaches, but nothing seems to work. I’m not a professional programmer; I’m just a hacker who loves to program. However, this issue is really testing my patience.

I have done a complete uninstalling PlatformIO and its directory then re-installing and it still compiles with errors now.

Please help me understand how to resolve this so I can continue enjoying programming with PlatformIO.

Maybe it is just a matter of the used espressif32 version. If you know a working version you can specify the version to be used. Example for version 6.10.0:

platform = espressif32 @ ^6.10.0

Did you recently try pioarduino?

Then for what you use pio???

And as sivar write primary lib is framework, and PIO overwrite it when ini use newest as other prev projects. Result is old project ini require set version as described.

Good question Marian, thank you. Well, I simply copy the entire environment which includes the .pio directory with the libraries. Or more importantly, the exact same libraries that compiled without errors at the time I saved them to the server.
If I am correct, by not having a “lib_deps” in my platform.ini my understanding is that the libraries won’t be touched (upgraded).
Now the way you asked your question, maybe there something I don’t know about pio? Could you elaborate?

This is interesting sivar, I did not realize this existed. And this is one thing that could change. I will do this going forward.
So I am a wanna be programmer and I would like to know how do real programmers deal with this? If I am working for a company and I write software for them, what is the correct way to store my environment so that if I need to come back to it in a week/month/year to do more work. I thought I would want the exact same environment so that it will compile out of the box?
I would love to hear anyone’s comments on this.
I am not going to take anyones job! :slight_smile: Besides, I am retired and unfortunately I realize I would make a lousy programmer. :frowning:
And thank you pointing me to pioarduino sivar, I will look into this.

When your lib_deps is empty, then copy .pio is waste of space, only build stages files is here.
And for full backup you check .platformio folder …, but this is too …
I report here simmilar issue some weeks ago Help with new display for ESP32 QSPI - General Discussion - PlatformIO Community

If you want to have a project that can be reproduced at any time, assign version numbers. This refers not only to the libraries but also to the platform, e.g:

platform = espressif32 @ 6.4.0
lib_deps = 
  bblanchon/ArduinoJson @ 7.0.2

The example above will give you Espressif32 Arduino Framework 2.0.11 based upon ESP-IDF 4.4.5 and ArduinoJson library in version 7.0.2
(For the Arduino Framework version, take a look here)

All of this assumes that the version information is properly maintained by the authors and that corresponding releases are published. And that Github and possibly other sources are still available later :wink:

I understand what you are saying Marian. And what is good about this is I believe this is where the gazillion files are so it will make backing up much quicker.
And from the forum you linked to (platform = espressif32@6.9.0) I can use this to backtrack to earlier versions and eventually I should get to one that compiles with no errors.

Does this make sense?

And Sivar, going forward I will use this to lock in the actual compiler stuff and libraries used.

And even if I have “lib_deps” defined I can still leave out all of the .pio as the compiler will recreate the .pio with both the build and libdep on the first compile.

And that will save both disk space and backup/restore time.

Have I understood this correctly?

This is exactly the way to share projects (without the .pio and .vscode folders) e.g. on github.

PlatformIO knows which platform and libraries are used and collects all things together before the project is built.

1 Like

Thank you for both of your help. It is always nice to learn more about PlatformIO.