Assign com port (windows)

Cool Javelin
Posts: 12
Joined: Wed Oct 20, 2021 3:58 am

Assign com port (windows)

Postby Cool Javelin » Sat Feb 18, 2023 8:56 am

I have several ESP32 projects going on simultaneously, (also ESP8266's) and have 2 or 3 plugged into a powered USB hub at the same time.

Windows is happy enough to assign COM numbers to the devices and all is good.

However, each time I disconnect and connect the devices from the hub, Windows may assign different COM numbers to each.

An example:
If I connect ESP32-1 I may get COM15, then ESP32-2 may get COM16.
If I disconnect both then attach them in reverse order, Windows will assign the opposite COM numbers (ESP32-1 will get COM16 and ESP32-2 will get COM15).

Is there any way I can differentiate the two devices sufficiently enough so Windows will assign the same COM numbers to the same device? (Like the way UUID is used on hard drives in Linux to assign device names.)

Thanks, Mark.

Franco
Posts: 104
Joined: Thu Dec 10, 2015 1:11 pm

Re: Assign com port (windows)

Postby Franco » Sat Feb 18, 2023 8:09 pm

This is between Windows OS and the serial to USB converter, the ESP32 is not involved.
I presume one way of assigning a specific COM port to a USB device is through the Windows device manager.

User avatar
mbratch
Posts: 300
Joined: Fri Jun 11, 2021 1:51 pm

Re: Assign com port (windows)

Postby mbratch » Sat Feb 18, 2023 11:18 pm

What sort of "ESP32" are you using? Is it a dev kit, or your own custom board?

When you change the order of plugging them in, do you use the same respective USB port on your hub with each ESP32, or is that changing when you change the order? By that I mean if you initially have ESP32-1 connected to USB-1 and ESP32-2 connected to USB-2, then unplug them and the plug in ESP32-2 first, do you plug ESP32-2 into USB-2 or USB-1?

I have an ESP32 devkit. Since it has onboard USB to serial conversion, the COM port assignment has been consistent associated with each devkit I have if I use the same USB port.

Cool Javelin
Posts: 12
Joined: Wed Oct 20, 2021 3:58 am

Re: Assign com port (windows)

Postby Cool Javelin » Sun Feb 19, 2023 2:32 am

I tried an experiment, I plugged one of the devices into a USB port (sans hub), and got COM15. I swapped out devices, and got the same COM port.

I went into Windows device manager and assigned a different COM port number (COM16)

Then I swapped them back, and got COM16.

Apparently, the serial to USB chips on the WROOM boards are so identical Windows cannot distinguish them. I think this is a lost cause.

I will try attaching the devices through the HUB and see if I can utilize the position of the device to help windows.

Mark.

User avatar
mbratch
Posts: 300
Joined: Fri Jun 11, 2021 1:51 pm

Re: Assign com port (windows)

Postby mbratch » Mon Feb 27, 2023 12:24 pm

That's a good test and an interesting result.

I am using the Espressif ESP32 Pico Devkit. I have connected 10 to 20 different ones to my laptop and each results in its own different COM port number. I'd have to look at the devkit schematic to see what USB/Serial converter chip they use, but I suppose it's likely different to the one used on the WROOM. But that may not be the issue. Perhaps there's something in the configuration software of the different devkits and the WROOM doesn't bother to identify itself as a uniquely different device.

Who is online

Users browsing this forum: No registered users and 91 guests