Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble locating my serial ports using bash on Windows 10

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.

like image 858
Marco Bruscia Avatar asked Jul 18 '16 19:07

Marco Bruscia


People also ask

Why are my COM ports not showing up?

If the COM port still does not appear in the dropdown, check the Device Manager found in Control Panel and verify the USB adapter is listed and working properly. The COM port number should be listed beside it in parenthesis if it is working properly.


1 Answers

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.

like image 110
Zak Avatar answered Sep 27 '22 23:09

Zak