runtime icon indicating copy to clipboard operation
runtime copied to clipboard

/src/libraries/System.IO.Ports/src/System/IO/Ports/SerialStream.Unix.cs:227

Open codeoflin opened this issue 6 years ago • 4 comments

Description

when I trying to open a serialport, I just got this Exception:

{"ClassName":"System.ArgumentException","Message":"Value does not fall within the expected range.","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":" at System.IO.Ports.SerialStream..ctor(String portName, Int32 baudRate, Parity parity, Int32 dataBits, StopBits stopBits, Int32 readTimeout, Int32 writeTimeout, Handshake handshake, Boolean dtrEnable, Boolean rtsEnable, Boolean discardNull, Byte parityReplace)\n at System.IO.Ports.SerialPort.Open()\n at KioskDev.Devices.Scanner.Scanner.Scan(Config config, Int32 overtime) in /root/KioskDev/Devices/Scanner/Scanner.cs:line 51","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":null,"HResult":-2147024809,"Source":"System.IO.Ports","WatsonBuckets":null,"ParamName":null}

Configuration

system: UnionTech OS Desktop 20 Professional CPU: FT2000(aarch64)

Regression?

I'm not sure but not every system have this problem.

Other information

This is my code:

图片

This is my logs:

图片

and my serial ports : 图片

codeoflin avatar Oct 19 '20 09:10 codeoflin

I googled it. seems I'm not the only one got this problem: https://stackoverflow.com/questions/58212812/serial-port-not-working-with-arm64-in-net-core-3-0-invalid-argument-at-system

codeoflin avatar Oct 19 '20 09:10 codeoflin

what port are you trying to open? It is unlikely tty3 is serial port if the screen capture is right.

wfurt avatar Oct 20 '20 01:10 wfurt

what port are you trying to open? It is unlikely tty3 is serial port if the screen capture is right.

Oh,I see, thanks, I first time to know tty{number} may be not serial port. apologize for my ignorance

codeoflin avatar Oct 20 '20 01:10 codeoflin

from the list, It seems like ttyAMA* may be the one.

wfurt avatar Oct 20 '20 01:10 wfurt