Where to set (change) path to ".platformio/packages/framework-arduinoespressif32"?

Howdy,

I’m on a Mac (10.10.5), using PlatformIO with MS Visual Code.

I’m using an MMA8451 (Adafruit breakout board) with an ESP32 (HUZZAH32 Feather). When I upload a program to test I2C communication between the MMA8451 and the ESP32 to the board, an alert pops up with the following error:

Unable to open ‘esp32-hal-i2c.c’: File not found (file://Users/jonathan/Documents/PlatformIO/Projects/mma-test-2019-01-01-1006/Users/Jonathan/.platformio/packages/framework-arduinoespressif32/cores/esp32-hal-i2c.c).

…and the ESP32 reports (via Serial Monitor) that it could not communicate with the MMA8451. (The exact same setup + program works fine via the Arduino IDE.)

The path in the error message is clearly messed up. I figure I botched something during setup, or didn’t set something, or… Whatever. I also figure that the missing/misplaced i2c file is essential for this to succeed. What’s more: The correct file is located in my home directory at: .platformio/packages/framework-arduinoespressif32/cores/esp32-hal-i2c.c

(A host of other libraries, packages, and platforms are in that .platformio folder too!)

The solution seems simple: I need to set this path correctly. I’d like to fix this for my overall installation of PlatformIO, not just this particular project (I figure that’d be in the platform.ini file for the project?). I’m reading documentation, setup instructions, and support and having a Dickens of a time figuring out where to change this setting. I’ve been looking at platform-ide.customPATH, but suspect that’s not the right place.

Where do I set this path for PlatformIO overall?
What syntax/command should I use?
If I overlooked a critical piece of documentation that explains how to fix it, feel free to drop the URL for it here and I’ll run with it.

Thanks!

JAL

Though it pains me to do so, I’m going to uninstall and reinstall Platform from scratch and see what happens. I’ll update this thread afterwards.

FWIW: Same issue persists after uninstall and reinstall.

2019-01-05 Update: I was wrong. The file not found error did cease. The underlying problem (I2C communication failure with the MMA 8451) persisted.

Can you upload your project as ZIP to dropbox or to github so I can reproduce this on Windows and Linux as test?

While preparing to upload my project, I realized that I owe you an apology. After uninstalling and reinstalling PlatformIO, I can not recreate the original issue I described.

The underlying issue {The ESP32 reports (via Serial Monitor) that it could not communicate with the MMA8451. (Using the exact same setup & program that works fine via the Arduino IDE.)} persists, but I can not recreate the “File not found” error.

Thanks for the reply. Sorry to have wasted your time.

Okay, so one error weirdly went away after a reinstall but still no answer on the I2C bus? Can you draw a schematic diagram of your setup and show the full code you’re running?

Howdy,

I’ve figured out a solution. It all has to do with settings in platform.ini for my project.

Summary: If you’re using an ESP32, and your I2C is wonky, open the “platformio.ini” file in the top level of your project’s folder and change “platform = espressif32” to “platform = GitHub - platformio/platform-espressif32: Espressif 32: development platform for PlatformIO

I sincerely appreciate your willingness to help, Max. Thanks!