go-serial icon indicating copy to clipboard operation
go-serial copied to clipboard

Not able to connect on WSL

Open marcelb98 opened this issue 3 years ago • 1 comments

When I try to connect to a serial port from Windows Subsystem for Linux, this is not possible.

The code:

c, err := serial.Open(port, serial.WithBaudrate(9600), serial.WithParity(serial.NoParity),serial.WithDataBits(8),serial.WithStopBits(serial.OneStopBit), serial.WithReadTimeout(1000))
defer c.Close()
if err != nil {
   fmt.Print(port+" ")
   fmt.Println(err)
}

gives the error:

/dev/ttyS3 operating system error: inappropriate ioctl for device

If the code is compiled for Windows the connection is possible. Connecting to the serial console from WSL using screen is also possible. Any ideas?

marcelb98 avatar Oct 15 '20 11:10 marcelb98

@marcelb98 I don enough time to investigate it, sorry. But will be glad to accept a PR if you or someone consider to make it.

albenik avatar Nov 06 '20 06:11 albenik