Is it possible to access virtual serial ports via Web Serial API?

Viewed 340

I seem to only be able to access physical ports. I do want to access virtual ones like ones created with virtual null modem or virtual serial port driver.

Does anyone know if this is possible.

2 Answers

Chrome enumerates serial ports by calling SetupDiGetClassDevs with GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR. As I discovered when implementing this enumeration logic there are a surprisingly large number of ways to ask Windows for a list of all available COM ports. The advantage of this approach being that it provides device information which can be used to get the human-readable name of the device and USB product identifiers if it is a USB device. It is likely that a virtual COM port driver may be creating the device in a way which prevents it from being discovered this way.

I've created https://bugs.chromium.org/p/chromium/issues/detail?id=1238369 to track this as a Chrome bug. Please comment on whether you are using a different virtual serial port driver than the one mentioned there.

I managed to get Chrome to see the virtual serial ports using com0com on Windows 10 21H1 (OS Build 19043.1110). Chrome connects to the port successfully and it works as expected:

Chrome connects to com0com virtual serial port on Windows 10

Related