Go Down

Topic: Arduinos and Windows COM ports (Read 3119 times) previous topic - next topic

cappy2112


I've created an Arduino-based piece of test equipment where I work.
We are building 20 of these for use throughout the lab.

I've noticed that whenever I plug an Arduino "fresh out of the box" into the USB port a different COM port gets used each time.
This is quite annoying,but I'm sure it's more of a Windows issue than an Arduino issue.

Since I'm building 20 testers does this mean I may see up to 20 different COM ports in the Arduino IDE under the Tools/Serial Port menu?
Is there a straightforward way of forcing all Arduinos to use the same COM port each time it's plugged in?

pwillard

sadly... you would have to play with the windows registry... as each USB device attached inserts it's unique ID in the registry.

retrolefty

Since I'm building 20 testers does this mean I may see up to 20 different COM ports in the Arduino IDE under the Tools/Serial Port menu?

Not nessesarly, when you first open up the arduino IDE it searches via OS request for all active and attached serial comm ports. If there are no arduinos plugged in you won't see them listed as avalible in the port pull down menu. For instance, in my windows XP systems if I have no arduinos plugged into any usb ports and then open the arduino IDE, the port menu only shows COM1 and COM2 avalible as these are my two legacy RS232 ports I had built with my PC. I must have half a dozen usb arduinos and usb serial cables around and each was given a new com port number when first plugged into the PC, but it's not a problem as normally only have one or sometimes two arduinos plugged in at any given session.

Is there a straightforward way of forcing all Arduinos to use the same COM port each time it's plugged in?

I don't know how straight forward it might be but I do seem to recall sometime ago that there was a way to change windows settings (registry and or driver settings?) to do that, but as I explained it really doesn't seem to be an issue in reality. Possibly just put a small sticker on each arduino board with it's com port number written on it?

Lefty

zoomkat

In the past with some usb serial adapters, I've had windows assign an ever increasing com port number each time the device was plugged in. It appeared that windows somehow thought something was still assigned to the previous ports or saw the adapter as something new each time it was plugged in.  To fix the problem I went into the comport setup and assigned the usb device to a previous comport I knew wasn't being used (like com port 5). Windows complained, but accepted the assigned number. From then on the usb serial adapter was assigned that comport when plugged in. 
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

Texy

You need to educate the staff/end user how to set the correct comm port. You are unlikely to get anywhere near 20 different comm ports reported, but this is down to how many USB devices are been seen in the past or that are correctly connected.
Out of interest, what does the test kit do?

Texy

cappy2112


You need to educate the staff/end user how to set the correct comm port. You are unlikely to get anywhere near 20 different comm ports reported, but this is down to how many USB devices are been seen in the past or that are correctly connected.
Out of interest, what does the test kit do?

Texy


What is a test kit?

Texy

The test equipment the arduino is part of.
Texy

cappy2112


The test equipment the arduino is part of.
Texy


The arduino is used to control 5V power to a device which we are testing.
Power is turned on/off several times a minute. The arduino simply monitors a digital signal from this device in order
to know if it comes ready- after cycling power.

Since we are building 20+ of these testers, I need to verify that each one works by downloading a sketch.

I need to plug in each Arduino into my computer and make sure the sketch turns
one of the I/O lines on/off.

If each USB device writes a unique ID to the windows registry, it's possible that each Arduino will have a different COM port #.
This isn't really a problem, just inconvenient. I'm sure there is some upper limit to the COM port numbers.

What would happen if we were building 300 of these testers?
At some point I would expect the COM ports to be used over, or Windows would display a warning or error message.

Daanii

You can use the Device Manager to hard-code the COM port you want to use.

If you plug in a new Arduino and Windows assigns it to COM port 10, for example, you can find the COM port in the "Ports (COM & LPT)" listing in Device Manager. Click on COM port 10 and choose the "Port Settings" tab. Click on "Advanced" and change the "COM Port Number" to whatever you want. If another device has that COM port number already, you can override that and assign it anyway.

I'm not sure what will happen, though, when a user plugs the Arduino into a different Windows machine. I suspect the new Windows machine will assign a new COM port number to the Arduino.

zoomkat

Quote
What would happen if we were building 300 of these testers?
At some point I would expect the COM ports to be used over, or Windows would display a warning or error message.


You probably need to use an arduino using a known windows USB serial driver. The FTDI chip based arduinos seem to have fewer issues than the drivers used with the UNO.
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

cappy2112


Quote
What would happen if we were building 300 of these testers?
At some point I would expect the COM ports to be used over, or Windows would display a warning or error message.


You probably need to use an arduino using a known windows USB serial driver. The FTDI chip based arduinos seem to have fewer issues than the drivers used with the UNO.


The UNOS DO use known Windows drivers. I think that's the only way they will work.

The installation for the FTDI driver is easier though. You just run the installer.

With the UNO, Windows XP pops up a dialog that tells you you need a CD for SP3, EVEN after you've already installed the USB driver
on the machine.

Haven't tried W7 yet, not sure I want to see what happens there, but eventually our company will be migrating to Windows 7 64-bit.



zoomkat

Hopefully the FTDI driver will be automatically identified by windows and installed. The UNO driver will probably always be unknown by windows and will require some type of manual install process.
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

oric_dan


Danii said:
--------
You can use the Device Manager to hard-code the COM port you want to use.

If you plug in a new Arduino and Windows assigns it to COM port 10, for example, you can find the COM port in the "Ports (COM & LPT)" listing in Device Manager. Click on COM port 10 and choose the "Port Settings" tab. Click on "Advanced" and change the "COM Port Number" to whatever you want. If another device has that COM port number already, you can override that and assign it anyway.

I'm not sure what will happen, though, when a user plugs the Arduino into a different Windows machine. I suspect the new Windows machine will assign a new COM port number to the Arduino.
------

When you're in the Device Manager, click on "View > Show Hidden Devices", and it will display
ALL the commports that have been redundantly assigned on your PC. The first time I did this, there
were about 50 installs, mostly the same vendor programs installed again and again and again.

Then, under "Ports (COM & LPT)", select the redundant installs, and right-click to uninstall. It shouldn't
hurt anything if you remove too much [I think], as they should re-install next time. Also, you can go in
and re-assign commport #s by right-clicking on "Properties > Port Settings > Advanced", as mentioned.



retrolefty

Quote
I'm not sure what will happen, though, when a user plugs the Arduino into a different Windows machine. I suspect the new Windows machine will assign a new COM port number to the Arduino.


Correct, a given Windows machine will assign it the next available unassigned COM port number, for that machine only, when the board is first plugged into the machine. There is no way to automatically force a COM number assignment that will follow the board to whatever machine it plugs into.

cappy2112


Quote
I'm not sure what will happen, though, when a user plugs the Arduino into a different Windows machine. I suspect the new Windows machine will assign a new COM port number to the Arduino.


Correct, a given Windows machine will assign it the next available unassigned COM port number, for that machine only, when the board is first plugged into the machine. There is no way to automatically force a COM number assignment that will follow the board to whatever machine it plugs into.


Of course it won't follow it. It would be nice to be able to configure Windows to use the same com port on all machines though.

I've got to send some of the testers that I've made with the Arduino to our engineering group overseas. The documentation I write will be translated to another language. It would be great if I could document it using a known com port number, as opposed to "Whatever com port windows assigns to the Arduino". I don't know how that will come across to the recipient once it's translated into another language.


Go Up