PlatformIO + ESP32: 6 top reasons for learning it

PlatformIO + ESP32: 6 top reasons for learning it

In this post, I write about my top six reasons why I decided to learn how to use PlatformIO IDE, especially (but not only) to use with my ESP32 projects.

Here’s my reasons, in no particular order.

Reason 1

The first reason is that my Arduino and ESP32 projects are getting larger. I find that the Arduino IDE is starting to show its constraints, especially because as the projects are getting larger, they are getting more complicated.

PlatformIO, on the other hand, when used with an editor like Atom or MS Code, makes it easy to handle much larger projects.

The second reason the need for better control of project dependencies.

Again, because my projects are becoming more complicated, I started having more frequent issues with incompatibilities between libraries of different versions.

I needed a way to control my project dependencies in a centralized way, and PlatformIO solves this problem via the project configuration file.

As part of the curriculum of ESP32 Unleashed (a new course I’m about to publish in early July, 2019), I’m going to show you how to use the project configuration file to mark the exact version of a particular library that you want to use or even a particular platform.

Dependencies control is done at the project level, which is awesome. Each project has its own dependencies, and the tool manages them independently of other projects.

Reason 3

The third reason is that in PlatformIO, projects are self-contained.

Everything that you need to compile the project is stored inside the project directory. I can share this directory with other people, and they will be able to work with my project and to compile it.

I can copy it to another computer, and I will be able to get to work immediately, without having to worry about do the setup manually. PlatformIO takes care of that automatically.

Life is so much better when projects are self-contained.

Reason 4

My fourth reason is the amazing integration of the toolchain components.

With PlatformIO and MS Code, I’ve got the compiler, the terminal, the serial monitor, the version control system, the editor itself, and a lot more, all nicely integrated into a single tool.

This creates a single unified experience for me as a programmer.

When I use the Arduino IDE, I need to have other tools set up, like a separate terminal, and Git for versioning. This just adds to my workload and to the configuration that I have to do.

Reason 5

A very important reason for deciding to use PlatformIO in this project is curiosity.

Where would we be without it?

PlatformIO has been on my radar for more than a year and I decided that I needed a non-trivial project to force me to use it exclusively for several weeks.

Learning by doing is the best way to learn it isn’t it?

I admit that it was scary to start with.

When you start work with a powerful tool like PlatformIO, not to mention MS Visual Code, for the first time it is overwhelming because of the steep learning curve.

And this is why I needed a project that was too big for the Arduino IDE. The same project was perfect for PlatformIO. It made me stick with the new tool long enough to understand its power, and actually become fairly capable of using it.

Reason 6

The sixth reason is that I wanted to learn better programming skills and habits.

The Arduino IDE is great for learning electronics and basic programming but I feel that I have become lazy using.

The Arduino IDE is great for hiding a lot of the complexity of programming embedded systems but I began to feel the need for more power.