question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trying to read output from Arduino Uno clone (with CH340 on board):

var arduino = new SerialPortStream("COM6", 9600, 8, Parity.None, StopBits.One);
arduino.DtrEnable = true;

arduino.Open();

while (true)
{
    Console.Write(arduino.ReadExisting());
    System.Threading.Thread.Sleep(1000);
}

ReadExisting() throws:

Unhandled Exception: System.IO.IOException: Device Error
   at RJCP.IO.Ports.SerialPortStream.ReadCheckDeviceError(Boolean immediate) in c:\Users\jcurl\Documents\Programming\HELIOS\serialportstream\code\SerialPortStream.cs:line 629
   at RJCP.IO.Ports.SerialPortStream.ReadExisting() in c:\Users\jcurl\Documents\Programming\HELIOS\serialportstream\code\SerialPortStream.cs:line 931
   at ArduinoReader.Program.Main(String[] args) in C:\Users\Andrei\documents\visual studio 2017\Projects\ArduinoReader\ArduinoReader\Program.cs:line 17

Same code with System.IO.Ports.SerialPort works fine.

Windows 10 x64 1703, .NET 4.6.1

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jcurlcommented, May 21, 2017

I’ve made a commit to the branch “feature/dotnet-98” if you could please test. It’s slightly different. If it’s OK, I’ll merge and put in the next release.

0reactions
jcurlcommented, May 22, 2017

Merged on master

Read more comments on GitHub >

github_iconTop Results From Across the Web

What Is I/O Device Error & How to Fix I/O Device Error?
An I/O device error (short for Input/Output device error) happens when Windows is not able to perform an input/output action (such as ...
Read more >
External Hard Disk I/O Device Errors - Stellar Data Recovery
The Easiest Solutions to Fix Hard Disk I/O Device Error · Solution 1: Check all cables connections · Solution 2: Update or Re-Install...
Read more >
How to Fix External Hard Drive I/O Device Error | 3 Solutions
When an I/O error occurs, it indicates that the external hard drive has encountered a serious problem and has become inaccessible for file...
Read more >
Error codes in Device Manager in Windows
Lists the error codes that may be reported by Device Manager and the possible resolutions in Windows.
Read more >
5 Tips to Fix Can't Be Performed Because of an I/O Device ...
I/O Device Error, short for Input/Output Device Error, usually happens on external hard drives, SD cards, USB flash drives, CDs, or DVDs when...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found