Where does PlatformIO store platform frameworks?

I’m trying to port a simple ESP32 Arduino program from the Arduino IDE to PlatformIO and I’m having unending problems.

The current one is that it can’t find some symbols which should be there, from WiFiGeneric.h (arduino-esp32/WiFiGeneric.h at master · espressif/arduino-esp32 · GitHub)

src/Controller2.cpp: In function 'void WiFiEvent(system_event_id_t)':
src/Controller2.cpp:158:14: error: 'ARDUINO_EVENT_WIFI_READY' was not declared in this scope

I’ve got ‘#include <WiFi.h>’ in ‘Controller2.cpp’ which should, in turn, include WiFiGeneric.h, but apparently it isn’t doing so, but because I can’t find where the header files are stored, I can’t check them or do any form of diagnosis at all.

You are linking to the master version here, or rather the one that is currently being worked on as “2.0.0”, and your sketch also seems to be requiring it. However, core 2.0.0 has not been released as stable yet and PlatformIO is using, as documented here, the latest stable 1.0.6 version the core currently. And as you can see here, those enums do not exist in that version.

There are two possibilites:

  • Rewrite your sketch to work with the latest stable release 1.0.6 instead of the 2.0.0 current development version of Arduino-ESP32
  • Tell PlatformIO to use that bleeding-edge 2.0.0 core. Results and correctness not guaranteed as beta versions are not officially supported.

As documented, PlatformIO stores the framework in a package, framework-arduinoespressif32 in the Arduino-ESP32 case, which is located in <home folder>\.platformio\packages on the harddrive.

Thanks. The one I linked to is the one which was installed by default in my Arduino IDE, and that bit of my code was based on various blog articles which have been around for a while, so I don’t think it was unreasonable to assume it was a usable version.

I’ll try to tell PlatformIO to use the later version because that may fix other strange problems I’ve been having with porting the software over.