Finding connected USB port using the command line

Is there a command / utility that allows you to find which USB port is being used to currently connect to your Arduino ?

On a desktop computer ? Which operating system ? With a Python script ?
By the way, I don't know the answer. Try Google.

using cygwin on Windows, there's a /dev/ entry when the port is active. unplugging the cables identifies which

The Windows mode command lists all COM ports

C:\Users\Bob2>mode

Status for device COM13:
------------------------
    Baud:            115200
    Parity:          None
    Data Bits:       8
    Stop Bits:       1
    Timeout:         OFF
    XON/XOFF:        OFF
    CTS handshaking: OFF
    DSR handshaking: OFF
    DSR sensitivity: OFF
    DTR circuit:     ON
    RTS circuit:     ON


Status for device CON:
----------------------
    Lines:          9001
    Columns:        120
    Keyboard rate:  31
    Keyboard delay: 1
    Code page:      850

Tks Bob

pjrebordao:
Tks Bob

Note that mode will show all COM ports and also CON (console)

What's wrong with the Windows Device Manager?

The basic answer is "no". You can find ports but you will not be able to identify what is what. E.g. you have two identical Arduinos connected.

@SteveMann, it will be difficult to use that for automation :wink:

The idea was to have a batch file in Windows to allow me to upload a sketch into several Arduinos, quickly.
It works but I have to manually edit the right COM port everytime.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.