Guidance for a Platform IO Noob

I am a retired HW engineer and have used and have basic skills with:

  • C++
  • IDEs such as VS
  • Arduino

I want to start a project for a weather station and bought three ESP32-DevKit-V4 modules. I have installed VS Code and Platform IO. I have downloaded the example zip file called platform-espressif32-develop.zip and I see there’s an examples folder in there that has several projects that would be good for me to look at to start getting familiar. What’s not clear (to me) is how I load up any of these examples into Platform IO on VS Code.

Thanks in advance for anny help you can give.

  • Open the project you wish to open, using Explorer or your systems file manager. Do you see a file named platformio.ini? If so, this is a PlatformIO project. and it can be opened in VS Code.

  • Open VS Code, select File->Open Folder. Navigate to the project folder and click “Open”.

  • Normally, the src folder contains the sources, and sometimes headers, for the project. Sometimes the headers are in include instead of src.

  • Also, any libraries that are included as part of the project will be in the lib folder, with each separate library in a sub-folder of its own. (lib/library_a, lib/library_b etc). Headers and sources go in the same place.

  • In the main VS Code window, you should see the file explorer fdown the left side, if not, click the top leftmost ico — two sheets of paper — to display the explorer. You can now double click on each file to open in a separate tab.

  • There is a toolbar along the bottom of the main window with buttons to compile, upload and such like. The Tick/check icon builds the code, the right pointing arrow uploads the code, The dustbin/trash can cleans the project, etc. These options and more can be found by clicking the Ant’s head/Alien face on the far left toolbar.

PlatformIO is a build system which has an interface with VS Code to give a GUI/IDE system for ease of development. It can also be used from the command line, for those of us not afraid of such things :wink:, but it’s probably best to begin with VS Code.

HTH

Cheers,
Norm.

Thanks for the reply Norm. I managed to get the C:\platform-espressif32-develop\examples\arduino-wifiscan project open in Platform IO and it compiled but there were multiple targets listed in platformio.ini which it kept trying to upload to my modules so I deleted the three I was not using so all I have is…

[env:esp32dev]
platform = espressif32
framework = arduino
board = esp32dev
monitor_speed = 115200

Which I THINK is right for my hardware.

This compiles and loads to my module (after I hit the EN followed by Boot button). It says it’s compiled with no errors and, looking at the src code, I was expecting to see serial messages running in the Terminal window but all I see is what looks like a PowerShell command of…

PS C:\platform-espressif32-develop\examples\arduino-wifiscan>

Is this not the window I should expect to see the serial output from the module on?

Ted

I figured it out, it’s working! The monitor I needed is launched by the icon that looks like a small 2-pin power plug (3rd icon from the right on the bottom line that has build and program icons). That pulls up a window that has all the expected serial information from the program I compiled and uploaded.

I was under the (wrong) impression that the Platform IO Terminal was the same window as the Serial Monitor.

Thanks again for your help.

Ted

Glad you got sorted. The terminal is where you can use the command line tools instead of the gui.

By the way, welcome to PlatformIO.

Cheers,
Norm.

1 Like