Windows 10 Build 16176 brought USB-serial adapters to WSL. Also non-NTFS and USB and Flash drives became mountable in WSL. Here’s how to use USB-serial adapters in WSL:
- Plug your USB-serial adapter into the PC
- Look in Windows Device Manager under Ports to see the COM port number. See troubleshooting notes below if it doesn’t show there. Let’s assume it’s COM 5 for this example.
in your WSL terminal, (assuming your device is on COM5 for this example), type
sudo chmod 666 /dev/ttyS5
in serial communications, you must know a priori the baud rate your device communicates at, or nothing will work. Here we assume your device works at 115200 baud.
stty -F /dev/ttyS5 115200
screen /dev/ttyS5 115200
- the COM port number can change upon plugging in the same device, especially if replugging into a different physical USB port on the PC.
- If plugging in a different unit of the same type of device, it may likely also get a new COM port number (e.g. two Red Pitayas, even if sequentially plugged into the same USB port, may well get different COM port numbers).
WSL USB-serial troubleshooting
If your device doesn’t show up in Device Manager > Ports, see if it was mistakenly enabled as a Mouse or Human Interface Device. If so, unplug and replug your device. If it still fails to show up as a Port, instead showing up as mouse or HID, try right-clicking and Disabling the device and unplug/plug it once more. If it still fails, maybe you’re lacking the Windows driver. Try it in a native Linux PC and see if the device works there.