Trying to build project fails immediately

I created a blank ESP8266 project in the VSCode PIO IDE, with the following main.cpp file:

#include <Arduino.h>

void setup() {
  Serial.begin(9600);
}

void loop() {
  Serial.println("Hello World!");
}

with this in platformio.ini:

[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino

[env:esp12e]
platform = espressif8266
board = esp12e
framework = arduino

The following is printed to the output window when I try to build the project:

Executing task: platformio.exe run <
The terminal process terminated with exit code: 1
Terminal will be reused by tasks, press any key to close it.

The same behavior has been observed with non-ESP8266 projects, e.g. STM32 Blue Pill projects which worked prior to this issue. This leads me to believe that this isn’t an ESP8266 issue.

PIO Versions:

  • Home 2.3.1
  • Core 4.0.2

Any idea as to what could be causing this?

Try opening PlatformIO IDE Terminal and type

pio run

Do you see any errors?

@ivankravets, unfortunately, I appear to have run into this issue again:

neil@Neil-Laptop:/mnt/c/Users/neilb/Documents/PlatformIO/Projects/ESP8266 Test$ pio run

Command 'pio' not found, did you mean:        

  command 'cpio' from deb cpio
  command 'plio' from deb gnustep-base-runtime
  command 'pip' from deb python-pip
  command 'fio' from deb fio
  command 'pia' from deb pia
  command 'gio' from deb libglib2.0-bin       
  command 'tio' from deb tio
  command 'rio' from deb rio
  command 'pil' from deb picolisp
  command 'pi' from deb pi
  command 'pico' from deb nano
  command 'pico' from deb alpine-pico
  command 'pico' from deb joe-jupp
  command 'pig' from deb bsdgames
  command 'pic' from deb groff-base

Try: sudo apt install <deb name>

neil@Neil-Laptop:/mnt/c/Users/neilb/Documents/PlatformIO/Projects/ESP8266 Test$ 

This is from the terminal launched by the PIO icon in the bottom bar of VSCode.

What is your OS? How did you install PlatformIO? Try to remove ~/.platformio/penv folder and restart VSCode.

1 Like

I have the same error.

I use W10, and installed the arduino (not the w10 store), installed PIO on VS-Code.
In PIO I installed library: Heltec ESP32 Dev-Boards by Heltec Automation and platform: Espressif 32

My PC recognize heltec esp32 lora on COM4

I try remove ~/.platformio/penv, but error continue…

> Executing task in folder test: platformio.exe run <

The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

Home = 2.3.2
Core =4.0.2

1 Like

I’m running Windows 10, and installed PIO via VSCode extension manager. I just tried the penv folder removal and PIO reinstallation fix and… same issue exactly. Seems to be a bug?

@ivankravets Any idea what could be causing this issue?

Is there any particular reason you’re using the WSL Bash terminal? If you use either the regular command prompt, or powershell (or even the git bash terminal), the pio command should work fine, but the WSL Bash shell doesn’t seem be working properly.

If you’re not sure how to change it, open up the command palette and type in shell for Terminal: Select Default Shell …
image

Hrm, you’re right about that… pio is a command on CMD or PowerShell…

But as for the root issue of this post, the behavior resulting in nothing happening when I try to build the project is mysteriously gone, thus fixing my problem.

1 Like

Ah, @pfeerick this is to do with the WSL terminal after all! IDK what changed, but now when I have the VSCode terminal set as WSL, no PlatformIO actions work. I have to set the terminal to powershell or cmd to make them work again.

This behavior didn’t exist previously, I have been using WSL as my terminal for a while now with PIO and had no issues…

1 Like

At least it’s working for you again, and we’re closer to pinning down the underlying issue.