Please take a look at the image attached. I am not sure how this happened. The port number duplicated almost every time I plug the Arduino in. I tried re-launching the Arduino and re-install the IDE. The port number still there even though the Arduino is detached. I also cannot upload any sketch to any Arduino that I owned. (Mega, Uno, Nano)
shah253's picture:
The duplicate ports issue has already been fixed in the beta build of the Arduino IDE. It is caused by disconnecting your board while the Serial Monitor is open. If you're not intentionally disconnecting your board, maybe you have a bad USB cable or jack, which is causing intermittent disconnections?
Once you exit the Arduino IDE and restart it, the duplicate ports should be gone.
There is also a separate bug that causes uploads to native USB boards like the Leonardo and MKR boards to fail after disconnecting while the Serial Monitor is open:
However, the Mega, Uno, and Nano are not affected by that bug. I have never found the multiple ports issue to cause uploads to Mega, Uno, or Nano to fail.
Please do this:
- (In the Arduino IDE) File > Preferences
- Uncheck the checkbox next to "Show verbose output during: compilation"
- Check the checkbox next to "Show verbose output during: upload
- Click "OK"
- Sketch > Upload
- After the upload fails, you'll see a button on the right side of the orange bar "Copy error messages" (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button.
- In a forum reply here, click on the reply field.
- Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
- Press "Ctrl + V". This will paste the upload output between the code tags.
- Move the cursor outside of the code tags before you add any additional text to your reply.