serialport-rs icon indicating copy to clipboard operation
serialport-rs copied to clipboard

Windows Subsystem for Linux (WSL) Port '/dev/ttySX' not available: Not a typewriter

Open jessebraham opened this issue 3 years ago • 3 comments

This issue was migrated from GitLab. The original issue can be found here: https://gitlab.com/susurrus/serialport-rs/-/issues/52

Hello and thank you for a great library. I was using WSL to try and run your clear_input_buffer and received the error: Error: port '/dev/ttyS4' not available: Not a typewriter. I then tried to run list_ports I received No ports found

I then ran the program on windows using the COM4 name and it ran successfully. Am i doing something wrong or is there something going on with WSL? (I am on Ubuntu 18.04 Windows 10 version 1809).

Also, I am able to cat /dev/ttyS4 and read input from WSL.

Thank you.

jessebraham avatar Feb 07 '22 21:02 jessebraham

Running into this, too. COM ports are exposed to WSL via the /dev/ttyS# (where # is the COM#). So far I haven't been able to read/write them under Rust, but can under cat if the baud rate is 38400.

Qix- avatar May 18 '23 21:05 Qix-

@Qix-

Serialport support in WSL2 is pretty new and limited, so I'm inclined to think that this is a WSL issue.

Since you can talk to it with cat, I wonder if this is a DTR/RTS/etc problem? You could try fiddling with some of those settings when opening the port.

mlsvrts avatar May 18 '23 21:05 mlsvrts

~~This isn't any of those issues. I have no problems talking to serial ports under WSL in other applications, including socat, cat, stty, etc.~~

I take all of this back, serial ports under WSL1 are seriously broken. Data is received sometimes and not other times, and it's a complete grab-bag as to when that happens. Receiving over COM ports shows no issues whatsoever.

Qix- avatar Sep 28 '23 19:09 Qix-