A couple of things:
First, I have a dozen or so USB devices. How can I tell which are Arduino without having to play "let's try the next one"?
How do you stop an upload? RE the first question, if I am trying to upload and it not's an Arduino the new IDE just merrily keeps throwing errors. How do you kill an upload when it's obviously (com lights on the Arduino not blinking) loading to a particular connected Arduino.
Arduino IDE has a port identification feature. When a port has unique properties, Arduino IDE will label it with the board name associated with those properties. This makes it quite easy to distinguish the ports of Arduino boards from the ports produced by unrelated devices attached to your computer or internal ports.
If you use official Arduino boards (with the exception of the classic Nano), you will find the ports are identified in this way. This identification is not in any way exclusive to official boards.
Many boards made by 3rd party manufacturers also produce unique identifying properties. However, you will find this is less common when working with cheap derivative boards. The reason is that those boards tend to use general purpose USB to serial converter chips (e.g., WCH CH340, Silicon Labs CP210x). These chips use a USB VID/PID pair provided by the manufacturer. This means it is impossible to know what device happens to be on the other side of that USB connection, making it impossible to identify the ports produced by those chips.
If you are using a board that doesn't produce an identifiable port, probably your best strategy for identifying it is as follows:
Unplug the USB cable of the board from your computer.
Open the dropdown menu (referred to as the "Board Selector" even though it is fundamentally a list of ports) on the Arduino IDE toolbar.
Take note of the ports listed in the "Board Selector" menu.
Plug the USB cable of the board into your computer.
The port that appears in the "Board Selector" menu after you plug the USB cable into your computer is the port of the board.
If you find this inconvenient, then I recommend replacing the board with one that can be identified.
There is a boards platform that contains dummy board definitions for each of the common generic USB to serial converter chips:
The purpose of this platform is to cause the ports produced by these chips to be labeled with the chip name (e.g., "COM42 (CH340)" instead of "COM42"). That still doesn't tell you that the port is an Arduino board, but it might be enough for you to infer which is the port once you learn which chip your board has (which you could do by performing the unplug/plug procedure I described above once).
However, the benefits of that "zzInoVIDPID" platform are debatable for Arduino IDE 2.x users. The reason is that Arduino IDE 2.x has a helpful behavior of automatically selecting the identified board along with the port when you select it via the "Board Selector" menu. When you have the "zzInoVIDPID" platform installed, this will cause the dummy board (e.g., "CH340") to be selected when you select the port from the "Board Selector" menu. You can always just select the correct board from the Tools > Board menu, so it doesn't do any real harm, but it might cause confusion to users who try to compile or upload for the dummy board automatically selected by Arduino IDE and encounter a confusing error message.
If it sounds like something that would be useful to you, you can install it following the instructions at the link above. If you later decide it isn't helpful you can easily uninstall it via the Arduino IDE Boards Manager and be back to the normal Arduino IDE behavior of not identifying these ports.
There is no way to kill an upload via the Arduino IDE UI. In the case where you want to terminate an upload quickly, the usual technique is to momentarily unplug the USB cable. However, that is not always possible or convenient if you accidentally started an upload to the port of some random device attached to your computer or to the internal port.
I think that with the techniques I described above you will be able to identify the correct port and will no longer upload to the wrong port. Typically a port number assignment is fairly persistent so I find I am able to easily remember the port number of a given board (e.g., "COM4 is the Nano") after a short time using it.
The Arduino IDE developers are tracking the request for the addition of an upload cancelation capability here:
If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject:
Many thanks for the useful information! Now if I could just figure out how to either speedup the Adafruit libraries or run multiple independent lAPA102C strips from ONE Arduino using FastLed I'd be a happy camper, but right now it looks like I'm gonna need 3 UNOs and a Giga to get to where I need to be. All in 2 weeks........
Never thought of the unplugging the USB and I do unfortunately use knockoff Arduinos. But not for long. I got a batch of Nanos that wer ALL BAD so I've started ordering ONLY Arduinos. More expensive but LESS headaches.
You are welcome. I'm glad if I was able to be of assistance.
In cases where you have multiple boards of the same model connected to your computer, the IDE's port identification feature is a bit less useful. The reason is that it only identifies the board model. It doesn't give any identification of the individual units. So you might see something like this in the port list:
COM42 (Arduino Uno)
COM43 (Arduino Uno)
COM1
It at least allows us to know that the board we want to connect to is either COM42 or COM43, but we don't know which is which. In the case of boards like the official Uno whose USB chip has a unique serial number, it is possible to positively identify which exact board unit is producing the port. You can do this by selecting the port and then selecting Tools > Get Board Info from the Arduino IDE menus. The unique serial number of the board that produced the selected port is shown in the "SN" field of the dialog that opens. You would still need to perform some procedure like the unplug/plug technique I described in my previous reply to learn which of the boards is the one with that serial number.
In the end, I'm not sure how useful the serial number information is in actual practice, but I thought it worth mentioning in the context of this discussion at least.
Yeah, a bad or unreliable "cheap" board can be very "expensive" once you add in the cost of those headaches!
I already mentioned it in my previous reply, but since you mentioned "Nanos", I should disclose that, although a wonderful board all around, the official classic Nano board is the one non-retired Arduino board that does not produce a port with identification properties. So unfortunately Arduino IDE will not label the port produced by even an official Nano. The reason is that the Nano uses the general purpose FTDI FT232R USB to serial converter chip. This chip has the USB VID/PID pair provided by the manufacturer for all FT232 chips, meaning it is not unique to the Nano board (it is identified as "FTDI FT232RL/RQ/BM/BL/BQ, FT245RL/RQ/BM/BL/BQ, VNC1L, VNC2" if you have that "zzInoVIDPID" platform installed).