Platformio Serial Monitor output error

Platformio serial monitor output error. I thought it was the FTDI or cable connection. But after changing FTDI, cable and USB port, the problem persists. Then I tried using another serial monitor, it works fine.

  • Top: Platformio Serial Monitor
  • Middle: CoolTerm (standalone exe)
  • Bottom: Microsoft Serial Monitor (vscode extension)

I can’t see an error here.

If it is about the Ansii Color coding you need to set monitor_filters = direct in your platformio.ini

I already set it to direct. As you can see, the first 2 lines output color correctly. This is my filter settings:
monitor_filters =
direct
send_on_enter
esp32_exception_decoder

Looks like many packets lost. Like this line:
[ 303][I][src/espnow.cpp:53] onESPNOWRecv(): add new server

in platformio serial monitor only show:
erver

Anyone knows why Platformio serial monitor can’t read properly, while other serial monitor can?

There’s something strange going on with your serial monitor. Usually you should see some lines like this before the content comming from the serial monitor:

 *  Executing task: C:\Users\boris\.platformio\penv\Scripts\platformio.exe device monitor --environment esp32dev 

--- Terminal on COM3 | 115200 8-N-1
--- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at https://bit.ly/pio-monitor-filters
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H

Which PlatformIO version, do you use? What is the content of your platformio.ini?
Even better: Plese share a minimal reproducible example.

Serial monitor did output line -- Terminal on COM3 … etc. It just that in the screenshot, I reset the ESP and the lines are scrolled out.
I use the latest PlatformIO v3.3.4. I tried with minimal example:

  • platformio.ini:
[env:esp32dev]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
board = esp32dev
framework = arduino

board_build.f_cpu = 240000000L
board_build.f_flash = 80000000L
board_build.filesystem = littlefs

upload_protocol = esptool
upload_port = COM3
upload_speed = 921600

monitor_port = COM3
monitor_speed = 115200
monitor_filters = 
	direct
	send_on_enter
	esp32_exception_decoder

lib_deps =
  • main.cpp:
#include <Arduino.h>

void setup() {
  Serial.begin(115200, SERIAL_8N1, 3, 1);
  Serial.println("\nSTART");
}

void loop() {
  delay(1000);
  Serial.println("Hello world!");
}
  • Platformio Serial output:
— Terminal on COM3 | 115200 8-N-1
— Available filters and text transformations: debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
— More details at 

— Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
ts Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:4876
ho 0 tail 12 room 4
load:0x40078000,len:16560
load:0x40080400,len:3500
entry 0x400805b4

START
ello world!
ello world!
ello world!
ello world!
ello world!
============================================================================================================ [SUCCESS] Took 33.39 seconds ============================================================================================================

Terminal will be reused by tasks, press any key to close it.
  • CoolTerm output:
ets Jul 29 2019 12:21:46

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:4640
load:0x40078000,len:15620
ho 0 tail 12 room 4
load:0x40080400,len:3164
entry 0x4008059c

START
Hello world!
Hello world!
Hello world!
Hello world!
Hello world!

The indentation of these lines are wrong.

monitor_filters =
  direct
  send_on_enter
  esp32_exception_decoder

It looks like the indentation stripped out in reply. My code main.cpp indentation also stripped out. It actually has indentation. Edited my previous reply.

I’m unable to reproduce your error. My output is absolutely fine:

 *  Executing task: C:\Users\boris\.platformio\penv\Scripts\platformio.exe device monitor --environment esp32dev 

Esp32ExceptionDecoder: ROM ELF found at C:\Users\boris\.platformio\packages\tool-esp-rom-elfs\esp32_rev0_rom.elf

Please build project in debug configuration to get more details about an exception.
See https://docs.platformio.org/page/projectconf/build_configurations.html


--- Terminal on COM5 | 115200 8-N-1
--- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at https://bit.ly/pio-monitor-filters
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:4640
load:0x40078000,len:15660
load:0x40080400,len:3164
entry 0x4008059c

START
Hello world!
Hello world!
Hello world!
Hello world!

Do you use PlatformIO IDE or do you use PIOARDUINO IDE?

What are the version numbers of the IDE and the Core?
→ IDE Version: Quick Access / Miscelleaneous / Show Release Notes
→ Core Version: Open a pio-termial and enter pio --version

Which exact pioarduino espressif32-platform do you use?
→ Will be shown in the PLATFORM section during building a project:


Processing esp32dev (platform: https://github.com/pioarduino/platform-espressif32/releases/download/55.03.37/platform-espressif32.zip; board: esp32dev; framework: arduino)
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (55.3.37) > Espressif ESP32 Dev Module

EDIT: Did you see Serial output character loss (first character of line) on Arduino core 3.3.8 (IDF 5.5.4) compared to 3.3.7 · Issue #480 · pioarduino/platform-espressif32 · GitHub ?

EDIT2: Using pioarduino-espressif32 platform 3.3.8 I am now able to reproduce the error:

 *  Executing task: C:\Users\boris\.platformio\penv\Scripts\platformio.exe device monitor --environment esp32dev 

Esp32ExceptionDecoder: ROM ELF found at C:\Users\boris\.platformio\packages\tool-esp-rom-elfs\esp32_rev0_rom.elf

Please build project in debug configuration to get more details about an exception.
See https://docs.platformio.org/page/projectconf/build_configurations.html


--- Terminal on COM5 | 115200 8-N-1
--- Available filters and text transformations: debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at https://bit.ly/pio-monitor-filters
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
ts Jun  8 2016 00:22:57

I_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
 clock div:2
load:0x3fff0030,len:4640
0
load:0x40080400,len:3164
entry 0x4008059c

START
ello world!
ello world!
ello world!
ello world!
ello world!

The issue is caused by the esp32_exeption_decoder included in pioarduino espressif32-platform version 3.3.8. Please see the issue link above for further details.

Possible solutions:

  • remove the exception decoder
  • downgrade to pioarduino espressif32-platform 3.3.7
  • wait for the next release / a fix

Thanks. Will wait for the fix.