callums005 / unity-arduino-communication

MIT License
1 stars 0 forks source link

IOException Error: The supplied user buffer is not valid for the requested operation. #1

Open KennyMarko opened 7 months ago

KennyMarko commented 7 months ago

Hi, I know it's be awhile this repo was updated and I don't know if anyone is still managing this, but I need help.

I followed the YT tutorial for this project but I keep getting this error on Unity.

`IOException: The supplied user buffer is not valid for the requested operation.

System.IO.Ports.WinSerialStream.ReportIOError (System.String optional_arg) (at <36d5d97f0e39429283d80156f1c7f1fc>:0) System.IO.Ports.WinSerialStream.Read (System.Byte[] buffer, System.Int32 offset, System.Int32 count) (at <36d5d97f0e39429283d80156f1c7f1fc>:0) System.IO.Ports.SerialPort.ReadExisting () (at <36d5d97f0e39429283d80156f1c7f1fc>:0) (wrapper remoting-invoke-with-check) System.IO.Ports.SerialPort.ReadExisting() Controller.DataThread () (at Assets/Scripts/Controller.cs:41)`

More Info:

Serial monitor is closed. No application is using COM3 (Arduino UNO on my system is connected to COM3). I made sure to run only Unity.

Unity version - Unity 2022.3.12f1 .NET - .NET Framework OS - Windows

callums005 commented 7 months ago

Hi! Whilst you are correct the repo has not been updated in a while, I'm still here! I am currently at work so I shall have a look a little later, thanks for supplying version numbers, can I confirm if it is Windows 10 or 11 you are currently using?

KennyMarko commented 7 months ago

Windows 11.

Thank you for responding!