PlatformIO serial monitor crashes NodeMCU ESP32s

This worked for me too. Putting in a breadboard instead of holding it in my hand, worked for me too. (NodeMCU ESP32s).

Thanks a bunch!

Hi, I got exactly the same problem. I use Wemos D1 mini with ESP-8285.
Uploading simple code to the board (by arduino IDE or PIO, not matters):


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

void loop() {
    Serial.println("On");
    delay(1000);

    Serial.println("Off");
    delay(1000);
}

Then open Arduino IDE serial monitor. Everything works perfect - board send “On Off On Off” with one-second delay.
Then I open PIO serial monitor. Board starts sending constantly the same value “On On On” or “Off Off Off” without delay. It looks like it freeze in a loop. In this state, I also can not restart Arduino by button. After turning monitor off, I have to unplug Arduino from power source, then it works.
I checked other serial monitors: putty, Linux command screen. Each of them works exactly like PIO monitor.

So, is there anything special in Arduino monitor? Why does it work, but none of others? Here is my config:

[env:d1_mini_lite]
platform = espressif8266
board = d1_mini_lite
framework = arduino
upload_protocol = esptool
build_src_filter = -<*> +<led_test.cpp>
lib_deps = fastled/FastLED@^3.5.0
monitor_speed = 9600
build_type = debug
monitor_filters = esp8266_exception_decoder

My Arduino IDE board setting

You can only get equal results with equal board settings. If you choose “Generic ESP8285 Module” in the Arduino IDE, choose esp8285.json in PlatformIO too and configure the remaining parts.

[env:esp8285]
platform = espressif8266
board = esp8285
upload_resetmethod = nodemcu
board_build.ldscript = eagle.flash.1m64.ld
build_flags = -DLED_BUILTIN=2
framework = arduino
upload_protocol = esptool
build_src_filter = -<*> +<led_test.cpp>
lib_deps = fastled/FastLED@^3.5.0
monitor_speed = 9600
;build_type = debug
monitor_filters = esp8266_exception_decoder

Does that make a difference?

I checked it and still don’t work.
But there is the change. In this way, Arduino monitor also don’t work - makes board ‘freeze’. It looks like board is waiting for something. When I close monitor, the board works normally again without any reset.

Then it has to do something with the monitor DTR / RTS states. Please try all 4 variants listed in Noob stuck on ESP32-CAM+MB with PIO/vscode - #5 by maxgerhardt.

I am confused. I am 100% sure I tried it before with rts=0, dtr=0. And didn’t work.
Now it works with current config:

[env:d1_mini_lite_master]
platform = espressif8266
board = d1_mini_lite
framework = arduino
upload_protocol = esptool
build_src_filter = -<*> +<client.cpp>
lib_deps = fastled/FastLED@^3.5.0

monitor_rts = 0
monitor_dtr = 0
monitor_speed = 9600

Only issue is: before text I get a lot of weird characters

The ESP8266’s bootloader output at 74880 baud is suppressed by the Arduino IDE, but not in PlatformIO. You will see that if you use that baud in both code and platformio.ini, the ‘weird’ characters are gone and bootloader messages.

Oh, okay. Now I understand.
Thank you for all your help :smiley: