Serial monitor not working in Arduino IDE?

However I see random character on the serial monitor, when resetting the NodeMCU.

Then the monitor is working fine. The boot code in the esp8266 outputs some status information at 78,800 baud before launching your application. You're seeing this text as garbage characters every time the esp8266 reboots.

Are you sure that the program you compiled in the IDE actually got downloaded into the NodeMCU. Perhaps you aren't seeing the text you expect because your program isn't actually running.

Try compiling and downloading the program again, but this time, expand the status window and look at the messages. I suspect your program didn't get downloaded.

/r/esp8266 Thread