Unable to open Serial Monitor in Arduino IDE

jparmenter

New member
Hello everyone,

Let me start by saying I am fairly new to using the Teensy 4.1, and so I am getting started with some basic Serial communication projects. I am currently attempting to do a basic IO demo between a Python script and the Teensy via USB Serial COM on Windows.

The issue I am having is that I am unable to open the Serial Monitor in the Arduino IDE, or if I am able to I don't receive any of the data transmitted by the T41. The basic example below is all I have uploaded to the board right now.

Code:
void setup() {
  Serial.begin(115200);
  Serial.println("Teensy Initializing...");
}

void loop() {
  Serial.println('a');
}

Yet when I attempt to open the Serial Monitor or Serial Plotter I get the error "Error opening serial port 'usb:20001/0/0/5'. (Port busy)". I have found some others having this issue who were able to resolve it by restarting the PC, changing COM or USB ports, changing the port in Tools > Ports, but none of this has worked for me.

In addition, when I run this Python script, I am able to view the Serial output as though I was using the Monitor in Arduino.

Code:
import serial
import time

ser = serial.Serial('COM3', 115200)
time.sleep(2)

while True:
    dataIn = ser.readline().decode()
    print(dataIn)

I don't think that the Python script having been run is the issue, although I may need to use ser.close() after this executes. For now, I don't really need to use the monitor in Arduino if I can continue to use Python, but I feel like this is a sign of some other issue I will need to address.

Update: I was able to find a workaround for this issue. I believe the reason that Serial Ports: COM3 was not outputting was a baud rate mismatch, and after changing the baud rate in the device manager I am now able to see the serial output in Arduino. However, if Teensy Ports: COM3 is selected this error still persists.
 
Last edited:
Serial Monitor seems to work okay with Arduino 1.8.19 and TeensyDuino 1.59b2 on Windows 7. Are you using Arduino IDE 2.x? I have not been able to use 2.x due to Serial Monitor issues, and I've been assuming that if I move from Windows 7 to 10 that it will probably work better.
 
The "Port Busy" error means some other program opened the serial port. Windows only lets 1 program open it.

While it's theoretically possible some 3rd program on your PC could be causing trouble, seems pretty likely Arduino IDE can't get access because your Python program has the port open.
 
Serial Monitor seems to work okay with Arduino 1.8.19 and TeensyDuino 1.59b2 on Windows 7. Are you using Arduino IDE 2.x? I have not been able to use 2.x due to Serial Monitor issues, and I've been assuming that if I move from Windows 7 to 10 that it will probably work better.

I am using Arduino 1.8.19 and Teensy 1.58.1
 
I agree, but I can't figure out if it is Python or some other program using the port. This issue persists even after restarting the PC and terminating all Python processes
 
I agree, but I can't figure out if it is Python or some other program using the port. This issue persists even after restarting the PC and terminating all Python processes

I'm not as familiar with newer versions of Windows, but in Windows 7 and older you can check the status of virtual serial ports in the Device Manager.
 
To add some more info to this, the issue only happens if I've selected Tools > Port > Teensy Ports: COM3. ~If I use Serial Ports: COM3 I am able to open the monitor but can't view any of the data being transmitted.~

Update: I was able to view the data using this port after i changed the baud rate in the device manager to match the code.

Some other info is that after running Process Manager I don't see any other processes that are associated with the ID for this port (usbser). There was a javaw.exe process while the Arduino IDE was open, but this disappeared after it was closed.
 
Last edited:
but I can't figure out if it is Python or some other program using the port.

You could first reboot your PC, so you're starting fresh with no program having opened the port.

Then use only Arduino and open / close the serial monitor several times, before you run the Python program. If the Port Busy problem doesn't come up, that's a pretty strong indication you don't have another 3rd program interfering. You could try running everything else installed on your PC except Python and keep reopening the serial monitor, just to check if anything other than Python might be the problem.
 
Back
Top