Problem with Serial Monitor showing gibberish (NodeMCU ESP8266 v3

Hi, I'm using a NodeMCU ESP8266 v3 board. I uploaded a simple sketch:

cpp

void setup() {
  Serial.begin(9600); // I also tried 115200
  Serial.println("Hello, world!");
}

void loop() {
  delay(1000);
  Serial.println("Hello, world!");
}

The board uploads successfully, but when I open the Serial Monitor, I only see garbled text like:

���䬒���������������������������������������������������,������

I already tried:

  • Serial.begin(9600); (the board says "use 9600bps" on the bottom)
  • Also tried Serial.begin(115200);
  • Matched the baud rate in Serial Monitor to the code
  • Chose "NodeMCU 1.0 (ESP-12E Module)" under Tools > Board
  • Used different USB cables and USB ports
  • Upload shows "Done Uploading", no errors

Still, the output is unreadable. Any idea what could be wrong?

Verify the IDE serial monitor is set to 9600.

What you are seeing is typically caused by a mismatch between the IDE and the Arduino communication speed (baud). When programming the baud is changed during which information is sent back to the lDE. When finished the IDE switches to your programed baud. If you switch tailing messages from the upload will appear in you code. I always add a delay(3000) at the beginning of setup. I still get a short burst of ???? but after that it is ok.

If the baud rates match, press the reset button to make the sketch restart. Any different?

No, still the same.

Tried, still the same.

Try another board.

In all sketches I include a brief delay to minimise/eliminate initial spurious output. Haven't used it with a NodeMCU ESP8266 v3 board but maybe worth a try?

Serial.begin(115200);
delay(200);

Did you restart the Arduino IDE after installing the board?

Are you using the correct drivers for your board?

After connecting the ESP8266 board to your computer, if the COM port in Arduino IDE is grayed out, it means you don’t have the required USB drivers installed on your computer.
Most ESP8266 boards either use the CP2101 or CH340 drivers. Check the USB to UART converter on your board, and install the corresponding drivers.

Image and quoted info courtesy of the great resource I have found so helpful when using these types of boards, Random Nerd Tutorials: