Esp32 Serial Monitor Acts Weird

So I am using an ESP32 Wrover E board by Freenove, and I wanted to get its MAC address for ESP Now. But, when Using Serial.begin(Any baud rate), The serial monitor prints out weird text: ��������������, and if I do not put a delay before trying to print stuff, it does not print. I have been trying to solve this for a while, I made sure the baud rates were matching, tried another Wrover E I had, changed usb ports, and nothing worked. The only thing left is to check the cable, but I only have one USB C cable. The MKR Vidor 4000 works fine. Could anybody give me an idea of what it could be besides the cables, before the new cable arrives for me to test?

Did you set the serial monitor to the same baud rate as in the begin?

Yes, and I changed baud rates from 9600 to 115200, making sure both serial monitor and the ESP32 board matched.
Either way, after the gibberish text, I can print whatever I want, if I add a delay before doing so.

Sorry, I didn't see the fact you didn't wait for the serial port to settle down. A delay is the customary technique, but if you have a board that allows it then you can loop on not ready.
What that means is this is expected behaviour, not a bug.

I see a few separate things happening.

  • After uploading (which is over the USB-serial) and resetting the board, the Serial Monitor takes about a second to re-acquire the Serial connection. Dunno if anything can be done to improve this.
  • When the ESP32 starts, its bootloader prints some diagnostics, always at 115200. You can see it if the Serial Monitor is already open at that bit rate and you press the reset button (if you have one). It starts like
    ets Jun  8 2016 00:22:57
    
    rst:0x1 (POWERON_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
    configsip: 188777542, SPIWP:0xee
    
  • The Serial Monitor defaults to 9600 when first opened (in a given window?)

So if both sides are at 115200: when you upload, you won't see the boot diagnostics, nor the first second of your output. If you then reset, you'll see both.

If both are 9600 (or any other value), instead of the boot diagnostics when you reset, you'll see gibberish.

I seem to recall seeing initial gibberish in other situations, but I can't reproduce that now. In any case, the first thing that prints will be at the end of that gibberish, so if you want to make it easier to see, you need a Serial.println() or '\n' to start a new line.

If you're using WiFi, that often takes a second or so to connect, so you don't necessarily need a do-nothing delay just for the Serial.

After resetting, the gibberish text does not appear, so maybe it has something to do with the serial initialization?

Ok, with the new cable the text still appears, so at this point I am stumped. It does not really matter either way, but it is annoying.

sounds similar to a problem with the TTGO ESP32 LoRa V1 board - see baudrate-changes-after-boot. e.g. when using ESP32 core 3.1.0 the serial monitor on my ESP32 TTGO Lora Oled V1 shows garbage all at baud rates -serial output OK with ESP32 core 2.0.17
what Tools>Board do you select? I mainly use "ESP32 Dev Module"
which version of the ESP32 core are you using?
if V3 try loading 2.10.17

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.