Trouble locating my serial ports using bash on Windows 10

Marco Bruscia picture Marco Bruscia · Jul 18, 2016 · Viewed 11.3k times · Source

I want to be able to read from serial ports on my computer and write to a file. Inside /dev (using Bash shell on Windows 10) I can't seem to locate my USB serial ports (I have tty, tty0, tty1, and that's it for tty).

Is it located somewhere else, or even accessible through the bash shell? I just want to be able to know how to access it at this point.

In device manager, COM4 shows up under ports when I plug in my USB. I also ran the command wmic path Win32_SerialPort in the Windows command prompt and it said "No Instance(s) Available." So I'm very confused as to how I can view my Serial Ports and why they aren't showing up in certain instances.

Any clarification on how serial ports work, especially with USB, would be greatly appreciated, as I am pretty new with this stuff.

Answer

Zak picture Zak · Jul 7, 2017

Soon, Windows will officially support serial on the Windows Subsystem for Linux (WSL). The COM_n_ ports will be available at /dev/ttyS_n_

Mapping:

COM1 >> /dev/ttyS0
COM2 >> /dev/ttyS1
...
COM192 >> /dev/ttyS191

A good functional description can be found here:

https://blogs.msdn.microsoft.com/wsl/2017/04/14/serial-support-on-the-windows-subsystem-for-linux/

NOTE: At time of writing this feature is only available on the insider builds.