Platformio is a really well known open source ecosystem for IoT development. Most advanced features are remote unit testing and firmware updates, which means that you will learn how to use pretty powerful cross-platform IDE.
Installing VS Code
Platformio can be used in several code editors, but we will use Visual Studio Code. VS Code is great source code editor developed by Microsoft and it can be used on Windows, Linux or macOS. Great thing about VS Code is that it supports debugging, version control, intelligent code completion, snippets and much more.
In this step we will download and install VS Code. Select your platform (Windows, Linux, macOS) and install your software after downloading it.
Open Visual Studio Code that you have just installed and in the extensions field search for official PlatformIO IDE extension. Install PlatformIO extension.
Setting Up Platformio IDE
You can always access PlatformIO (PIO) home by clicking home button that can be found in the status bar of the VS Code.
Adding IoTaaP platform to PIO
PlatformIO can work with various development boards, like Arduino, Nucleo, etc. In order to make your IoTaaP board function properly, you have to add it’s configuration to your PlatformIO installation.
Go to your Platformio Home tab in VS Code, select Platforms and click on the Embedded tab, then type Espressif32 in the search bar.
Click on the Espressif 32 in your search results and click the Install button.
This will automatically install all needed files, settings and configurations for your IoTaaP Magnolia board.
After installation, you should get the message that your platform is successfully installed.
You can check the official PlatformIO documentation about IoTaaP Magnolia board here.
Now you can proceed with the next step and install IoTaaP library.
Installing IoTaaP Libraries
In order to use all IoTaaP features out of the box, you have to install IoTaaP libraries.
Go to your Platformio Home tab and select Libraries from the side menu. Type “IoTaaP” in the search field, click on the specific IoTaaP Library, like IoTaaP OS by IoTaaP Team and then click Add to Project.
Click on the platformio Home button and then click on New Project button in Quick Access menu.
In Project Wizard you will be able to enter your project name, select your development board and framework.
Type your project name (e.g. MyCoolProject) and search for IoTaaP Magnolia board*
Click on Finish and wait a few moments for PlatformIO to configure your new project
Your project structure is very simple, you will mostly use ‘lib‘ and ‘src‘ directories. Expand src directory, and you will find main.cpp file, this is the main file of your new project with the following content:
Testing your environment
Our development boards, like IoTaaP Magnolia contain FT232RL - USB to serial converter onboard, and the following environment testing is applicable to this kind of development board. If you have different development board, containing ESP32 module, you should check official documentation from the manufacturer.
Connect your IoTaaP board with your PC using USB cable. Your PC should automatically install all drivers needed for your board to work. If you have trouble with automatic driver installation, you can install your drivers manually
PlatformIO automatically detects upload port by default. You can configure a custom port using
upload_port option in platformio.ini
Use Upload button in your Platformio status bar to start uploading your project to the board.
If everything works well you should see [SUCCESS] message. Congrats, your working environment is now fully functional 💪
Feel free to write your problems in our community page.
Manual port configuration:
Open platformio.ini file located in your project tree and add the following line (replace COM2 with your COM port if needed)
; COM2 upload_port = COM2