Com Port creep


When i first used Arduino a year age the Uno, Mega etc would use a single digit com port.
That port number has been constantly rising. eg today Arduino was attaching to Com 28. Is there
any way to force Arduino back to a lower port number?


You are clearly a windows user.
Windows tries to give you the same com port number when you attach your device. To do so it needs to remember which com port it has given before to a device. As such each time you plug in a new device the numbering goes up.
The only way to have windows use small numbers again is by removing the device information somewhere in the controll panel.
I have heard that it is possiblle to tell windows not to keep this info and assign the first free port (as is default in linux) but I don't have a link anymore.
Best regards

Thanks Jantje
for your response. I'll get IS working on it.
Now I'm wondering if this is why Windows want to re-install
the drivers everytime the unit(s) get attached to the pc.
What a pain!

Thanks again

As far as I recall it is even USB device USB slot. This is why changing slot sometimes makes things work.
It is windows after all.
I have cursed at this when I was using windows. Now I use linux I wish Linux had fixed ports to devices by default on :D.
Best regards

I don't have multiple Yun's to verify this 100%, but in general the following steps have worked for me over the years. You can choose to either change the COM port number that your Arduino's use, or you can delete any old Arduino's from Device Manager.

Configure Windows to see hidden devices:

  • goto: Control Panel, System, Advanced system settings
  • button: Environment variables
  • button: New (your choice whether to add to your user variables OR global system variables)
  • Variable name: devmgr_show_nonpresent_devices
  • Variable value: 1
  • buttons: OK, OK

Goto your Device Manager and view hidden devices:
(reopen Device Manager if it was already open during the steps above)

  • menu: View
  • click: Show hidden devices (whenever you reopen Device Manager you'll need to click this again)

Now you should see all your connected and disconnected devices.

A. change the COM port number that is used

  • if you don't think you'll connect more than one Arduino to your computer at a time then you could change all Arduino's to use the same COM port
  • right-click on any Arduino device: Properties
  • tab: Port Settings
  • button: Advanced
  • dropdown: COM Port Number (if a COM port is already in use then click Yes on the warning message)
  • for devices such as "Arduino Yun bootloader" you should keep them on a separate COM port of their own


B. delete old Arduino devices that you'll never reconnect

  • simply delete (Uninstall) the one that you don't want from Device Manager
  • do NOT click the checkbox "Delete the driver software for this device"

Fyi, to see how Windows identifies one Arduino from another in the first place, goto the device manager Properties for an Arduino, Details tab, change property dropdown to Hardware Ids, then you can see the Vendor id code (VID) and Product id code (PID) for this device which are embedded within each device's hardware. Like Jantje said, connecting to different USB controllers can make a difference too.

That was a great explanation Thomas-C

Per Jantje’s sugestion i found Microsoft’s help:
but it didn’t help. Using your explanation the Comports are all low numbers now. Left the bootloaders alone.
jpg below show the before view.

Thank You