[SOLVED] Arduino 1.8.12 Metro Mini - serial monitor prints twice

When I upload a new sketch and the serial monitor window is already open and the output cleared, the very first Serial.print("Something"); statement is always printed twice, also without a timestamp, as if the device resets twice before commencing running the code properly. Two examples:

Start WLAN connection
21:02:40.320 -> Start WLAN connection
21:02:51.450 -> Wait for WLAN connection
21:02:51.450 -> MAC address: A4:CF:12:12:78:7C

Random number
21:02:57.969 -> Random number
21:02:58.006 -> 729
21:02:58.057 -> 54

Is there something I can do to eliminate that problem?


Ok, that solves it. Select Both NL & CR. Enter any character and hit enter. No more double printing.

while(Serial.read() == -1);