Question by 
               zammle2009wtf · Dec 02, 2020 at 12:36 AM · 
                deviceusbserialportserial.io.port  
              
 
              Unity - IOException: SerialPort.Open()
So I am trying to open a Serial Port on unity so I can read data.
However, the new USB device I'm trying to read from has been giving me issues unlike previous.
IOException: Invalid argument
 System.IO.Ports.SerialPortStream.ThrowIOException () (at <aa976c2104104b7ca9e1785715722c9d>:0)
 System.IO.Ports.SerialPortStream..ctor (System.String portName, System.Int32 baudRate, System.Int32 dataBits, System.IO.Ports.Parity parity, System.IO.Ports.StopBits stopBits, System.Boolean dtrEnable, System.Boolean rtsEnable, System.IO.Ports.Handshake handshake, System.Int32 readTimeout, System.Int32 writeTimeout, System.Int32 readBufferSize, System.Int32 writeBufferSize) (at <aa976c2104104b7ca9e1785715722c9d>:0)
 (wrapper remoting-invoke-with-check)System.IO.Ports.SerialPortStream..ctor(string,int,int,System.IO.Ports.Parity,System.IO.Ports.StopBits,bool,bool,System.IO.Ports.Handshake,int,int,int,int)
 System.IO.Ports.SerialPort.Open () (at <aa976c2104104b7ca9e1785715722c9d>:0)
 (wrapper remoting-invoke-with-check) System.IO.Ports.SerialPort.Open()
 
               Never got this error before when opening other USB serial ports.
 using System.IO.Ports;
 void Start()
 {
       stream = new SerialPort("/dev/usb/hiddev0",256000,Parity.None, 8 ,StopBits.One);
       stream.WriteTimeout = 300;
       stream.ReadTimeout = 5000;
       stream.DtrEnable = true;
       stream.RtsEnable = true;
       stream.Open()
 }
 
               I tried to change syntax but haven't gotten a successful open().
EDIT: turns out Hiddev aren't readable serial. I have all core information about device, but no matter what I try, I can not get the data to Unity.
               Comment
              
 
               
              Your answer