microsoft / microsoft/WSL

CH340 Serial device doesn't appear in /dev/

Open
#7,649 9 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
C++
Stars
33.7k
Forks
1.8k
Avg merge
3d 17h
Merged PRs (30d)
116

Description

I seem to be unable to find the serial port for my Arduino to Ubuntu on WSL2, but it shows up in lsusb (passed through with usbipd).

It should appear as /dev/ttyUSB* or /dev/ttyS*, or like WSL1 could automatically be assigned a tty port without having to use usbipd.

I've attempted to build the kernel module myself but it fails as this seems to be impossible to do on WSL short of building WSL from scratch (and even then I couldn't figure out how to add support)

I am running Windows 11 with the preview build of WSL to enable USB support via usbipd.

The device appears in lsusb as Bus 001 Device 003: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
and can be seen in dmesg as:

[15159.884965] vhci_hcd vhci_hcd.0: pdev(0) rhport(0) sockfd(3)
[15159.885370] vhci_hcd vhci_hcd.0: devid(65542) speed(2) speed_str(full-speed)
[15159.885803] vhci_hcd vhci_hcd.0: Device attached
[15160.172592] vhci_hcd: vhci_device speed not set
[15160.242586] usb 1-1: new full-speed USB device number 3 using vhci_hcd
[15160.322591] vhci_hcd: vhci_device speed not set
[15160.392593] usb 1-1: SetAddress Request (3) to port 0
[15160.436425] usb 1-1: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.63
[15160.436944] usb 1-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[15160.437353] usb 1-1: Product: USB2.0-Serial

but is not enumerated as a serial device. I think the WSL kernel is missing a module?

Thanks,
Hope there is a simple fix.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the USB attachment through usbipd and compare the device output in lsusb and dmesg with the expected /dev/ttyUSB* or /dev/ttyS* entry. Investigate whether the WSL kernel lacks the CH340 serial kernel module; done means the adapter is enumerated as a usable serial device in WSL2.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino, linux, ubuntu
Domain
embedded-iot, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.