Can't see printed statements in Serial Monitor

Hello!
I recently installed PlatformIO for Vscode and I am running into an issue where I cannot see my Serial.println comments in the Serial Monitor.
I made sure to do monitor_speed in the ini file.
Here is my code:

Everything compiles just fine and when I open the Serial Monitor up, I see nothing.

1 Like

Hi

U’re probably missing an entry in your platformio.ini file, some thing like

monitor_speed = 115200

Try something simple first in PlatformIO, it has a steep learning curve.

Below are my platformio.ini and main.cpp contents for a BlinkLed and ‘SerialHello’…

; PlatformIO Project Configuration File
;
;   Build options: build flags, source filter
;   Upload options: custom upload port, speed and extra flags
;   Library options: dependencies, extra library storages
;   Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:nanoatmega328]
platform = atmelavr
board = nanoatmega328
framework = arduino

;monitor_port = COM12
monitor_speed = 115200

main.cpp

#include <Arduino.h>

void setup()
{
	// initialize LED digital pin as an output.
	pinMode(LED_BUILTIN, OUTPUT);

	Serial.begin(115200);
}

void loop()
{
	Serial.println("Hello world");
	// turn the LED on
	digitalWrite(LED_BUILTIN, HIGH);
	// wait for a second
	delay(500);
	// turn the LED off
	digitalWrite(LED_BUILTIN, LOW);
	// wait for a second
	delay(500);
}
1 Like

Same issue here.

Trying the simplest code and nothing shows up.

#include <Arduino.h>

void setup (void)
{
    Serial.begin(115200);
    delay(500);

    Serial.print("Inicializando...\n\n");

}

void loop (void)
{
    delay(1000);
}

platformio.ini:

[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
upload_port = /dev/cu.SLAB_USBtoUART
upload_speed = 115200
monitor_port = /dev/cu.SLAB_USBtoUART
monitor_speed = 115200

What’s missing?

Thank you.
Regards, Ciro.

Now I found out the issue I’ve just reported doesn’t regard Serial.print itself.

The problem is related to the code flashing. Despite the [SUCCESS] report, the code is never flashed to the device.

I’ve tried to check with an ordinary serial monitor. When I try to flash with VSCode+PlatformIO, no Serial.print message is shown. But when I flash with Arduino IDE, all serial messages appear normally.

?!

Have you got any idea what might be happening?

Thank you.
Regards,
Ciro

Instead of

Serial.print

try

Serial.println

Does that help?