Serial Port already in use- Arduino nano

Thread Starter

Exjay

Joined Nov 19, 2015
166
Hello,
I am developing myself in the embedded world. So I decided to start with Arduino nano. I am stuck at the point of uploading a blink example into the uC. It prompts serial Port com3 already in use. I have changed port and cable, yet no iota of improvement. Before I installed the Arduino IDE, I have installed the ch340 driver already. Please, help me out. Thanks for your support as usual. You guys are my angel when it comes to electronics. AAC is my last resort.
 

djsfantasi

Joined Apr 11, 2010
9,189
So are you using a Windows PC to upload the blink example into the μC? Have you confirmed (via Windows device manager) that com3 has been assigned to the Arduino?

You can’t just select com3 because your documentation says com3: Windows must have assigned com3 to the Arduino driver. The IDE and device manager must agree.

if at all in doubt, after installing the driver, reboot. And recheck. You may have to disconnect and reconnect the Arduino.
 

Thread Starter

Exjay

Joined Nov 19, 2015
166
So are you using a Windows PC to upload the blink example into the μC? Have you confirmed (via Windows device manager) that com3 has been assigned to the Arduino?

You can’t just select com3 because your documentation says com3: Windows must have assigned com3 to the Arduino driver. The IDE and device manager must agree.

if at all in doubt, after installing the driver, reboot. And recheck. You may have to disconnect and reconnect the Arduino.
I'm using a window OS. Please, how do I confirm that com3 is assigned to my Arduino? Whenever I connect the USB to Arduino, it shows USB-SERIAL CH340 (COM3) only.
 

MrChips

Joined Oct 2, 2009
31,195
Unplug the USB cable.
Go to the Device Manager on your Windows PC.
Open the tree for >Ports (COM & LPT).
Plug in the USB cable connected to the Arduino.
Observe which COM port has been assigned to Arduino.
 

Thread Starter

Exjay

Joined Nov 19, 2015
166
Unplug the USB cable.
Go to the Device Manager on your Windows PC.
Open the tree for >Ports (COM & LPT).
Plug in the USB cable connected to the Arduino.
Observe which COM port has been assigned to Arduino.
I did as you instructed. When I disconnected the Arduino, I didn't see the Ports (COM & LPT), but it appeared after connection. It showed USB-SERIAL CH340 (COM3).
 

Ya’akov

Joined Jan 27, 2019
9,276
Sometimes the Arduino serial monitor can get confused and grab the port. I’ve experienced that, but didn’t explore the exact circumstances. If somehow the serial monitor window is open, close it. If that doesn’t solve the problem you‘ll need more information.

Get Process Explorer from Microsoft (free).

Run it, and use the search dialog to find “serial”. If there is a process with a handle for the port, it will be in the list.

1702375874145.png
It may be that a different process has control of the port. In that case you can try killing it.

One other possibility is updating the driver. You might not have the latest and that can cause various problems. I don’t think it is a likely cause, but it could be.
 

Ya’akov

Joined Jan 27, 2019
9,276
I don’t know if it is even possible, but I wonder if there might be two drivers that think they own that port?
I don’t think it is, access will be with a mutex lock. But, device manager might show a conflict if one is possible. It’s worth looking.
 

Thread Starter

Exjay

Joined Nov 19, 2015
166
Sometimes the Arduino serial monitor can get confused and grab the port. I’ve experienced that, but didn’t explore the exact circumstances. If somehow the serial monitor window is open, close it. If that doesn’t solve the problem you‘ll need more information.

Get Process Explorer from Microsoft (free).

Run it, and use the search dialog to find “serial”. If there is a process with a handle for the port, it will be in the list.

It may be that a different process has control of the port. In that case you can try killing it.

One other possibility is updating the driver. You might not have the latest and that can cause various problems. I don’t think it is a likely cause, but it could be.
Thanks for your advice. Unfortunately, it didn't work out. I used the process explorer, killed some processes using the serial but not a tinge of the code uploaded.
 

Ya’akov

Joined Jan 27, 2019
9,276
Same thing. I changed the port number to 2. Nothing changes. I'm thinking of using another laptop on Friday
That‘s a good troubleshooting step. But if that doesn’t work there are a couple of other things to try. Since Windows is very much a secondary platform for me, I don’t have a ready answer, which I suspect I would have since this seems to be something a lot of people have trouble with.

I also can‘t help as quickly as I would like because unlike MacOS and Linux, I can’t as easily picture the tools and tests—I need to be in front of a Windows computer to be reminded.
 

Thread Starter

Exjay

Joined Nov 19, 2015
166
I hope I resolve it by then. However, can one explain the process of installation? Formerly, I installed ch340 driver before installing the Arduino IDE. Is that the correct sequence?
 

MrAl

Joined Jun 17, 2014
11,764
I hope I resolve it by then. However, can one explain the process of installation? Formerly, I installed ch340 driver before installing the Arduino IDE. Is that the correct sequence?
Hello there,

That sounds right to me.

You should be aware that you may not see any ports like COM or LPT in device manager until after you plug something in that uses one of those or similar. Once you plug one thing in that uses a COM port then you will see the main item that lists the ports.
What you could do is plug it in and see that a COM port appears in device manager. If a COM port appears, that's got to be the right one. If you want to be ultra sure, unplug it and see that the COM port goes away.

You should check to see that the item you see in device manager is not disabled. If it is disabled you may get a strange unrelated error message but for sure the port will not work. If it is not disabled, try disabling it and then enabling it.
Also, when you click for properties, do you see a line that reads, "This device is working properly" or similar? If you see anything else but that, report that in this thread also.
Did you try rebooting the computer?
Also, do you have a second Arduino board to test on your system?
 

Thread Starter

Exjay

Joined Nov 19, 2015
166
Hello there,

That sounds right to me.

You should be aware that you may not see any ports like COM or LPT in device manager until after you plug something in that uses one of those or similar. Once you plug one thing in that uses a COM port then you will see the main item that lists the ports.
What you could do is plug it in and see that a COM port appears in device manager. If a COM port appears, that's got to be the right one. If you want to be ultra sure, unplug it and see that the COM port goes away.

You should check to see that the item you see in device manager is not disabled. If it is disabled you may get a strange unrelated error message but for sure the port will not work. If it is not disabled, try disabling it and then enabling it.
Also, when you click for properties, do you see a line that reads, "This device is working properly" or similar? If you see anything else but that, report that in this thread also.
Did you try rebooting the computer?
Also, do you have a second Arduino board to test on your system?
No, I don't have spare. It shows the COM when I plugged in my Arduino.
 

djsfantasi

Joined Apr 11, 2010
9,189
Secondly, after the port appears in Windows Device Manager, the same port must appear in the Arduino IDE. I’ve seen a similar problem appear because different ports appear in those two locations.
Thirdly, after installing the device, you must reboot. And reboot whenever the port appears to have moved.
 
Top