VSCode in Windows - ports configuration

I need a quick tip.

I’ve been using Mac OS for decades and I’m not used to Windows anymore.
Now, I need to proceed my work in VSCode for Windows because I’ve received a new model of TTGO T3 that uses WCH CH9102F USB interface. This interface simply doesn’t connect to Mac.

I’m running Windows in Parallels Desktop virtual machine. I’ve installed VSCode for Windows and imported a copy of my project folder into it.

Then I’ve installed the port driver and now it’s already available in Windows Control Panel:

Moreover, the port is available for VSCode as well:

But, as usual, even after saving the project configuration, “upload_port” and “monitor_port” in platformio.ini file are never updated this way.

Now I’ve got to update platformio.ini manually. It means I have to place “COM3” device path there:

upload_port = /dev/cu.usbmodemFA1331
monitor_port = /dev/cu.usbmodemFA1331

Help please.

COM3 is the device name. upload_port = COM3 is valid as you can see in the docs.

However, the correct answer is to delete both upload_port and monitor_port instructions from the platformio.ini, since PlatformIO is well-capable of auto-detecting the upload port.

Hello @maxgerhardt
Thank you.

Just that? It couldn’t be easier. Good solution of Microsoft (finally).

I’ve been running projects in parallel, connected via an USB hub. One of them consists of two LoRa modules communicating with each other. There’s always one that shows up as /dev/cu.SLAB_USBtoUART and the other ones receive numerical suffixes which always increase every time a module is switched off or disconnected and further reconnected.

Moreover, so far I could never depend on this auto-detecting feature. For some reason it rarely works. Not even with a single device connected at a time.

Usually I visit PIO Home, section “Projects”, “configure”, where I delete the selected port and wait for the updated ports list. I select the corresponding port and “Save”. But it usually has no effect on platformio.ini, it’s just to be aware what’s the new port designation. Then I open platformio.ini and edit the port manually.

I guess fixing this represents as a good improvement opportunity. But I’m aware it affects only a few users, maybe only who connects more that one device and uses Mac OS.

Regards,