Sometimes, when building and uploading the firmware, you may run into bizarre, even-though the code is correct - platformio will refuse to build and instead will complain with some weird error.
It usually means that either PlatformIO, or ArduinoSDK got and update and that's the moment when this guide may come in handy.
Updating PlatformIO itself
There are two ways to update your platformio installation
You can update it easily by simply typing in one command into your terminal.
- Open a terminal / command prompt
pio upgradeand press enter
- Wait for it to finish
Via PlatformIO in Visual Studio Code
You can also update it using the platformio tab in your Visual Studio Code.
- Open VSC
- Click on that little and icon on the sidebar
- A side panel will open, there will be a couple of sections, one of them called
Quick Access, open it.
Quick Accesssection, click on the
- Then, click on the
Upgrade PlatformIO Core
- Wait for it to finnish and done!
Upgrading the SDK
You'll also need to upgrade the SDK from timem to do this
Upgrading the SDK via VSC
- Follow the guide above up until clicking on the
- Instead, open the
PIO Homeand select
- This will open a window for PlatformIO dashboard, in there, click on a
Platformsbutton on the sidebar
- Once there, you should see a couple of tabs next to the side bard, things like
Embedded. Click on
- Locate a platform called
Espressif 32and click on
Update to <version>
- Wait until it is done and that's it!