go-serial
go-serial copied to clipboard
Not able to connect on WSL
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 I don enough time to investigate it, sorry. But will be glad to accept a PR if you or someone consider to make it.