Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input/output error #173

Open
mrspirytus opened this issue Mar 19, 2021 · 3 comments
Open

Input/output error #173

mrspirytus opened this issue Mar 19, 2021 · 3 comments

Comments

@mrspirytus
Copy link

Hello,

I am getting exceptions occasionally on Write(). Here is an exception I am getting.

terminate called after throwing an instance of 'std::runtime_error'
  what():  Input/output error
Aborted (core dumped)

here is kernel dmsg. Did you ever encounter this? I have a little LTE module plugged into 2 port USB hub. And sending AT commands on /dev/ttyUSB1. I am not sure if this is a problem with liberalism. I am still investigating

disabled by hub (EMI?), re-enabling...

Cheers

@mcsauder
Copy link
Collaborator

Hi @mrspirytus , are you using a SerialPort or a SerialStream object?

@mcsauder
Copy link
Collaborator

You will get this exception in the following case:

else if (write_result <= 0 && errno != EWOULDBLOCK)
{
        throw std::runtime_error(std::strerror(errno)) ;
}

So if the write was unsuccessful and reported back as such by the OS, or if errno is anything but a blocking call you will see this. If you add a try/catch block to your executing code you can capture this exception and continue execution of your application.

@mrspirytus
Copy link
Author

Still looking into this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants