[forward] Use USB-Serial adapters via Windows Subsystem for Linux

10 篇文章 0 订阅
3 篇文章 0 订阅

https://www.scivision.co/usb-tty-windows-subsystem-for-linux/

Use USB-Serial adapters via Windows Subsystem for Linux

 1 minute read

 On this page

Windows 10 Build 16176 (April 2017) brought support for

Here’s how to use USB-serial adapters in WSL:

  1. Plug USB ↔ serial adapter into the PC
  2. 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.

    If the device doesn’t show under USB Devices → Ports in Windows Device Manager, the following steps will not work!

  3. in your WSL terminal, (assuming your device is on COM5 for this example), type
    chmod 666 /dev/ttyS5
    
  4. 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
    
  5. You can connect to serial devices using PuTTY with WSL if you have X11 installed on WSL or using
    screen /dev/ttyS5 115200
    

Notes

  • 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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值