Go Down

Topic: COM port problems - need help. (Read 3316 times) previous topic - next topic

dmen

Aug 01, 2014, 01:55 am Last Edit: Aug 01, 2014, 02:05 am by dmen Reason: 1
Hi, I am using an Arduino UNO to control a servo for tilting of a web cam. It's working great - I am using Serproxy to communicate from Flash to the Arduino. For testing, on my laptop, the com port has been 9. Now, I have to install my app, with the Arduino/camera on a different machine - eight different machines to be exact. So, I took my stack of 8 Arduino's and loaded my code onto them. Each time I plugged in a new Arduino I had to select a different com port - it incremented by one each time.
Then I selected a random board and replaced my all along test uno with this one - and thought I could still use com 9 with serproxy to communicate... but it did not work. Looking in Device Manager, I saw that this uno was listed as com 15? Does the Arduino store the com port? I don't get this...
I tried setting serproxy's config file to use com 15 but it's not working for whatever reason.
Since I need to install this hardware / software combo on eight different machines, is there a way I can always guarantee the Arduino will be on the same com port?
Or is there a better way communicate from Flash to Arduino? I can write to a port... which is what serproxy interprets.

steinie44

#1
Aug 01, 2014, 02:25 pm Last Edit: Aug 01, 2014, 03:59 pm by steinie44 Reason: 1
Your computer OS selects the com port number the first time you use it.

dmen

Thanks, but that's not very helpful - and I don't believe it's correct either. I have two UNO's sitting in front of me right now - one is always on COM 9 and the other always on COM 15 - after a reboot etc... this does not appear to be windows selecting the port number. It appears the number is stored in the Arduino... if not then how to account for one always on 9 and the other always on 15?

XChalo

As far as I know, the number of the COM port depends pn the device you attach as well as on the USB port you attach it to. If I change the USB port I plug my Arduino into, it gets reinstalled with the first free port number available. But when I reattach it to a USB port, on which it was installed before, it mostly gets its port reassigned.

dmen

Thanks. All of these Arduinos were installed using the same cable - ie the same USB port. So, yes - it's getting the port reassigned. Is Windows storing some device id or something? It's that or the Arduino's store something. I mean I even reboot and and plugging in different Arduinos yields different com ports. I _really_ wish there was a way to have all the Arduinos use the same port. Because now I will need to modify the serproxy cfg file on every machine I install on... not the best.

XChalo

There is a possibility to change the COM-Port number after installing the Arduino, if said port is still free

dannable

My personal experience is that Windows allocates the same COM port number to an individual Arduino board.
Beginners guide to using the Seeedstudio SIM900 GPRS/GSM Shield

XChalo

I agree, but for me the port number also changes as I change the USB port

dmen

OK, I think I understand now. Thanks for the replies. Windows stores Device ID's and assigns that same device to the serial port it was previously assigned. Since I set up about a dozen boards in the past month Device Manager showed like 23 serial ports in use when I did View > Show Hidden Devices. I deleted all the Arduino devices in the list. Then plugging in the board that was COM 15, it now shows COM 5. Plug in another one and it's COM 6. Makes sense now...
So, I would think when I install on new machines likely they probably all will be on COM 4.

XChalo

Yes, probably. But if you want, you can still change those numbers afterwards in the device manager

steinie44

OK this will explain it.
Did you know each Arduino has a unique serial number in its USB interface that you can use to distinguish one Arduino from another?

http://todbot.com/blog/2012/03/02/listcomports-windows-command-line-tool-for-usb-to-serial/


dmen

Thanks Steinie, that helps. And you were right - OS does decide. I just never knew that the ID's were stored and re-assigned. Not even sure why they are, but now that I know it's pretty easy to work with.

steinie44

Quote

Not even sure why they are, but now that I know it's pretty easy to work with.

It's the same for other devices like printers and external hard drives.
One way to get around that is to use a external programmer like mini's use.
That way the com port number will be the same.

Go Up