I am new to Arduino and don't know a lot of things about Arduino and how thing should or shouldn't go, so I am sorry:D For context I am trying to do this project to graduate on high school. I've been having some problems since I started. The last one was with Serial Monitor where should have been written text, but nothing was there. My classmate who knows Arduino pretty well recommended me to reinstall Arduino IDE. After first reinstall, there was some avrdude error after trying to upload and error message saying "Port monitor error: command 'open' failed: Invalid serial port. Could not connect to COM4 serial port." Of course I tried other port or other Arduino but nothing changed. I also tried some things like install driver and stuff like this. So i tried another reinstall. After this I thought something changed because the avrdude error wasn't there but now i realised it showed after upload so I tried it and it is still there and nothing changed.
Before the reinstall was everything alright, except the Serial Monitor, and now when i plug in the USB there is message saying "Connecting to 'Arduino Nano' on 'COM4'..." for like 20 seconds and after that the error message "Port monitor error: command 'open' failed: Invalid serial port. Could not connect to COM4 serial port." shows."
Could somebody help me or does somebody know what does it mean? I would be so much grateful.
When you disconnect the board, do both ports disappear? If that is the case, re-installing the drivers might solve the issue.
Are you using an original Nano (with FTDI chip on the bottom of the board) or a clone with another chip at the bottom (in the below image you can see that it's a CH340).
Yes, when I disconnect the board the ports disappear but it should disappear when nothing is connected, right?
I am using clone with CH340. Although there is nothing written on the component the driver says CH340.
I also tried to use old computer with Windows 10 and everything works. Computer recognise the COM port, can connect and I am able to upload. So it is something with the computer but I don't really know. I am using Windows 11.
I think we don't understand each other. I don't have the problem you are talking about.
When I use both ports and disconnect one, only the one disappear from device manager. I am now confused by your response. I guess I don't know what you mean.
I think the confusion comes from this part of your response
When you said this I'm guessing @sterretje thought both COM ports where disappearing from the device manager when you disconnected the Arduino, which would be very odd.
I am sorry if the confusion was caused by this. I meant that when I use COM3 and disconnect it, COM3 disappears and the same goes for COM5. I hope everything is clear now.
Hi @jakubtan. I found another recent report of this error occurring while uploading to a board that uses the same WCH CH340 USB to serial chip:
I have the 3.8.2023.2 version of the driver reported there as being problematic installed on my computer and I don't have any problems using Serial Monitor and uploading to an Arduino board with the CH340 chip, so it doesn't affect all users universally.
One of the affected users shared the workaround they found, which I interpret as being to "roll back" to a restore point from before the driver update, then disable driver updates to prevent Windows from going back to the problematic version of the driver:
Another user shared their workaround of obtaining an older version of the driver from an alternative source and installing that driver. I don't have any reason to suspect ill intent behind that, but for security reasons I always strongly recommend obtaining drivers exclusively from the device manufacture's website and avoiding unofficial sources for drivers. Unfortunately I didn't find a way to install an older version of the driver obtained from the manufacture's website (http://www.wch-ic.com/downloads/CH341SER_EXE.html). So I don't have any advice on how you could perform that particular workaround in a best practices manner.
Since I can't reproduce the fault, I can't check whether it will help, but you might try uninstalling and then reinstalling the driver in case that will help. I'll provide instructions:
Close Arduino IDE if it is running.
Connect the Arduino board to your computer with a USB cable.
Select View > Devices by type from the Device Manager menus.
Open the "View" menu.
If there is a ✓ to the left of the "Show hidden devices" menu item, click on "Show hidden devices" to disable it.
Open the "Ports (COM & LPT)" section of the Device Manager tree.
You should see a port identified as "USB-SERIAL CH340 (COM_n_)" under the "Ports (COM & LPT)" section (where "COM_n_" is some serial port e.g., COM4). Right click on that item.
A context menu will open.
Select "Uninstall device" from the context menu.
An "Uninstall Device" dialog will open.
Check the box next to "☐ Attempt to remove the driver for this device" in the "Uninstall Device" dialog.
Click the "Uninstall" button.
Wait for the uninstallation process to finish.
Unplug the USB cable of the Arduino board from your computer.
Wait for the Device Manager tree to reload.
Connect the USB cable of the Arduino board to your computer.
Wait for the "USB-SERIAL CH340 (COM_n_)" port to reappear under the "Ports (COM & LPT)" section of the Device Manager tree.
My experience is that the device will be reinstalled automatically by Windows. However, it is maybe possible that the driver removal will actually have been accomplished by the above instructions, in which case it will be necessary to reinstall the driver. If this happens to you, please let me know and I'll provide instructions for installing the driver.
Once the port has reappeared in Device Manager, start Arduino IDE again and check to see whether the problem still occurs.
Although I tried uninstalling the driver, I tried again and followed your instructions exactly. Now everything works without any problem. The Arduino connects and can upload. I guess it was because I didn't check the box in the uninstall popup window earlier. Thank you all.
Hey, i found a 2018 driver version someone archived on sparkfun that seems to work great. Just made an account to post this link. I couldn't get it to work even after downloading the latest version of the driver from the manufacturers website... But this driver worked flawlessly and Arduino IDE is happy again
Hi, I'm another newbie and had the same problem as jakubtan, but the suggested procedure has not cured it. The driver reinstalled, but still could not upload. I then tried downloading and installing the driver from the manufacturers site, but still no success. However, I can upload to a Uno fine. I'd be grateful for any further suggestions.
Unfortunattely steps did not work out for me - every time there was the same result. I tryed the steps mentioned in @ptillisch post, tryed installing driver with WCH distributive - nothing worked - out of 2 nanos, one perfectly established connection with IDE, second failed to. So I assumed installing previous version of driver was an option and it worked. As I had a new W11 installation there was no option to rollback, so I:
unstalled the device and drivers as described in post #11;