PlatformIO Community

ESP32 code starting from scratch

Hello all.

I’m migrating a project written for ESP32 in Arduino to VSCode + PlatformIO.
The target device is a TTGO T3 V2.1.6, with LoRa, OLED and SD Card (ttgo-lora32-v21).

I’ve already tested most of the peripherals interfaces in Arduino IDE, using some ESP32 specific libraries. There are a couple of other ones to be tested, but maybe this is the right moment to change the platform.

No need to say that I’ve been investing dozens of hours to understand the basics in this new environment. Nevertheless, some colleagues have made me optimist and positive that the effort worths it.

I intend to write a functional code with good maintainability, so that I can myself adjust it to my customer’s future demands.
From this project I also intend to learn for future and more complex projects.

So, my first concern is a dilema.
Which framework should I choose to start my project? Arduino or ESP-IDF.

Since you started off in the Arduino IDE, that’s what I’d pick in PIO as well.

Another consideration is the libraries you use - if they assume an Arduino runtime environment and you want to keep using them, then again, that more or less settles it?

That’s an important point: the libraries.

I’ve already chosen libraries that fit the project demands. I really wouldn’t like to start searching for new libraries in this stage.

I’m following your advise.
Thank you.

Following an advise from @ullix, I’ve deleted VSCode and esp-idf folders and now I’m installing it back again.

Like other times, I’m facing all those error messages during the installation process.
Following instructions in
Running Visual Studio Code on macOS ,
I found problems with PowerShell. So I’ve installed it again, following
Installing PowerShell on macOS - PowerShell | Microsoft Docs .
During the first trial, another error message. Then I’ve tried again and then its ok.

Now I’d like to know whether I need to install esp-idf again, since I’m gonna begin with Arduino framework only.

You do not have to install anything manually. Platformio will install everything needed