PlatformIO Community

Chasing Down the Problem that Ruins Everything

This is a new problem. Just happened today. I wanted to reproduce a librarry error, because I figured out how to ask my question.
This is not about libraries. There’s a story.
Arduino IDE stopped working on my new Win10 PC, so I got a new Win10 PC, better. Arduino still won’t open. The image flashes, but it’s never mentioned in Task Manager.

So I got PlatformIO. I figured out how to use it, but now I’m getting nonsense error after nonsense error. Look at this one:
image

(I just typed in [env], to see if that would do anything. It didn’t. Same error)
I know Platformio makes their .ini files correctly.
I have experience with .ini files.

Meanwhile, when I try to use Arduino code I’ve used a thousand times, I get this:
image

SPI is actually in there twice. Why isn’t it working?

This cpde, directly taken from a library example, gets me an error:
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)

#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

It says it’s not recognized. These stinking libraries are where they belong.

Is my PC set up wrong?

Not nonsense… it’s just you don’t understand what it’s saying the problem is.

So by specifying ${env.HOMEDIR} , etc, you’re telling PlatformIO when it processes that to replace that placeholder with the contents of the HOMEDIR parameter in the env section. So where is it? :stuck_out_tongue: That probably wasn’t what you wanted anyway… to access environment variables, you want the special sysenv section… i.e. ${sysenv.HOMEDIR}… making the proper line for lib_extra_dirs

lib_extra_dirs = ${sysenv.HOMEDRIVE}${sysenv.HOMEPATH}\Documents\Arduino\libraries 

… and get rid of the [env] section header.

Get rid of the second include, and next time, past in the complete compile output, and use ``` before and after the output so it’s formatted as code. Then we have a chance of working out what the root issue is.

More importantly, WHY are you specifying the ESPIDF framework in the platformio.ini, when you’re using the Arduino framework, given the code you are using?

Thank you. The framework is a legacy error, now just artifact. My problems happen before the framework. I’m not getting compiled. Too many hangups with libraries. I’m actually in the process of learning how to explain my problems, because I’m learning the language though error. Framework was part of it.

Getting a handle on the .ini file is crucial. The ‘extra_dirs’ line was given to me by a different helper like you.

That doesn’t matter… you are trying to compile… if you were getting it compiled, you probably wouldn’t posting this thread! :laughing:

No problem. Best practice is to share the code (where possible) + platformio.ini + compile output, and only then try to explain what you think is going on / what you’ve done. Just in case what you think is not even close. Plus, we’re not omnipotent / omniscient / omnipresent - we don’t know what code you’ve used, what configuration, what error you got! :wink:

Very much so… everything PlatformIO knows about a given project is specified in this file.

So now that you’ve corrected the lib_extra_dirs line (slip of the 'ol grey matter), and are using the right framework (i.e. Arduino IDE = Arduino), is it working now, or are you getting a different error? If so, what is it?

The status is still failure.