Have to kill serial-monitor.exe to upload to the board

Hey there. Might not be a problem with the arduino software itself, but I never had this problem before.

I've used 1.8 forever, but I bought a new computer and moved to the 2.2.1 version. I also moved from Win10 Home to Win10 Pro.

Everything's ok, but there is this petty annoyance that's bothering me.

If my sketch includes Serial.begin(baud), it creates the task serial-monitor.exe that occupies the COM port and that I have to manually kill every time I need to upload code to the board.
Old computer still runs, I uploded the same code from it and I don't have this problem.

Using Win 10 Pro version 10.0.19044, Arduino IDE 2.2.1.
Arduino is a third party Uno R3 based. Windows has no problems recognizing it.
Board and port are correctly set on the IDE. Again, everything works, I just need to kill a task

Already tried changing USB ports, disconnecting other devices, nothing helps.
I don't think my code's relevant, but I tested this simple one from the begginer material I learned from and it has the same problem. It just reads the value of a 10k potentiometer, maps it to a 0-5 V value and prints the result on the serial monitor.

const int pinoPotenciometro = A0;
int leitura = 0;
float tensao = 0.0;

void setup() {
  Serial.begin(9600);
  pinMode(pinoPotenciometro, INPUT);
}

void loop() {
  leitura = analogRead(pinoPotenciometro);
  tensao = leitura * 5.0 / 1024.0;
  Serial.println(tensao);
  
  delay(100); 
}

Please don't tell me to just stick to the old computer...
Thanks in advance.

PS: PLEASE let us name sketches using spaces again...

You can try disabling the automatic opening of the serial monitor in Arduino IDE 2.2.1 to prevent the task from occupying the COM port. Alternatively, you can use a third-party serial monitor program like PuTTY or CoolTerm. Make sure to have the correct drivers installed for your Arduino board and try using a different USB cable or port if needed.

Hi @Thauaaguirre

Are you certain you have to manually kill the task? If you are affected by the bug that causes Serial Monitor to interfere with the upload, you should be able to simply close the Serial Monitor by clicking the X icon on the tab:

215050213-e6c41c1a-0eae-448a-ae91-f2acefedf793

Please give that a try and then let us know if the upload still fails even with the "Serial Monitor" tab closed. I'm not aware of any conditions under which it should be necessary to manually kill the task (but I am interested in learning of it if that is actually a thing).

Arduino IDE 1.8 also did not allow the use of spaces in sketch names, so I'm not sure what you mean by "again".

Thank you for sharing another ChatGPT answers.

Yes, that's it!! Thanks a bunch!
I just knew it would be something stupidly simple I overlooked...

However, there is a small caveat. When I plug in a board with serial.begin in the setup it occupies the port. Simply opening and closing the serial monitor fixes it.

Thanks again, mate!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.