Serial Monitor displays nothing

When I delete // it doesn't work.

I reset the board and this is happened:

The original sketch although slightly flawed, does work.

yes

This is actually expected. When the ESP8266 starts up, its ROM bootloader prints some diagnostic information. This data is printed at 74880 baud. So when you have the Serial Monitor set to a different baud rate (which is the correct thing to do in this case since your sketch communicates at 115200 baud) it is displayed as some garbage. You can simply ignore this garbage as the diagnostic information is only useful in special cases where the ESP8266 is misbehaving (e.g., resetting due to a watchdog timer timeout).

If you scroll the Serial Monitor output field all the way to the right, you should see the expected "What is your name?" message at the end of the line after all the garbage.

You can avoid that poor user experience by adding code to print a blank line or two before your first message:

void setup() {
  Serial.begin(115200);
  // Add some blank lines between the ROM bootloader output and the sketch output.
  Serial.println();
  Serial.println();
}

You will now get something like this:

rll��|�l�|�l�b|����r�b�b��nn�lnn���bp��lrlrlp�n��l��bn�|���b��nn�l��l`�nnl`nr���nbl�lp�n�r������bn�|�b��nn�l`�nnl`nr���nb��`r��nb��`��p�l`��n�l����n�r��n|�l�l`b��|r�l�n��n�l`��r�l�l��

What is your name?
1 Like

yes, I did what you say and I got this:


tank you very much for your help.

You are welcome. I'm glad it is working now.

Regards,
Per

1 Like

Mark the poster who solved it.