Serial Monitor Not Working On Esp32(SOLVED)

I am trying a simple program like this:

void setup() {
  Serial.begin(115200);
  Serial.println("Test");

}

void loop () {
}

But my Serial Monitor is not working and other Forums are saying to turn off DTR & RTS on Serial Monitor Setting but I can't find , can some on help please?

You need to wait for the Serial interface to fully initialize before you can use it:

Thanks, how do you tell when it's fully initialized?

while(!Serial);

my code

 Serial.begin(115200);
  while(!Serial);
  Serial.println("Test");

It is likely that the Serial Monitor just hasn't connected yet before you print "Test".

Thanks but, I waited 2 minutes after the program has started and it is still not working. And baud rate is 115200 because I use esp32.

What version of Arduino have you installed ?

If you are using a local (PC) copy of Arduino, I would recommend reinstalling Arduino.

Do you mean the ide?

If you send your message before the serial monitor is connected, you can wait all you want but the message is not coming back.

Put your message into loop() and you should see it.

Yes, the Arduino IDE

The latest version.

That goes without saying....

It did not work but do I have to turn off DTR & RTS if you know what that is?

That would be at hardware level in your Device Manager if you are using Windows. Don't bother with that, reinstall Arduino IDE

you must use port USBtty0. this port does not exist until you plug the device in. plug the ESP32 in, select your board in board manager, start the serial monitor at 115200, and hit reset on the ESP32, in that order. you should see a wall of bootup chatter after you hit reset. the ESP boots up so fast it's gone by the time you start serial monitor without a reset.

do not start serial monitor first. I use TTGO T3 V1.6 OLED LoRa ESP32s. The computer does not always catch on when I plug it in. I keep a Dev kit ESP around to plug in to open the USBtty0 port, then plug in the TTGO.

This may be a solution, I will try after school tomorrow because I have to have dinner and thanks for all you help.

Maybe also consider installing the appropriate TTL (serial plug-n-play) driver, depending on which chip is used on your ESP32.

That can be either the CH340 or the CP2102, NOT both.

Hi guys, I am back from school. So I reinstall the Arduino Ide, right.

But is the solution to turn off DTR & RTS because other Forum said that.