Fazecast/jSerialComm

Question about "cdc_acm 2-1.3:1.0: failed to set dtr/rts"

Dominik-Helfenstein opened this issue · 5 comments

Hi,

I am currently using v2.6.2 and somewhat randomly (maybe every few days) I receive the error message cdc_acm 2-1.3:1.0: failed to set dtr/rts from the Linux kernel module. I have read that this problem might come from a short drop of the supply voltage for the USB device. It might come from my USB device as well but I am not sure.

The problem is that the library does not recognize the error message. Messages are still being received from the USB device, but none can be sent. Currently, a custom watchdog checks whether a message has been sent and if the message couldn't be sent for 15s, it throws an error.

Have you seen this problem before or do you know more about this problem than me? And do you know if it is fixed in the latest version? Or is it solely a problem of my USB device (it has a custom firmware)?

I am happy about any information 🙂

Regards,
Dominik

I've never personally seen or heard of this message before, and since it's coming from the kernel, it's probably nothing I can do anything about in user space. One thing to try would be to register an event listener with jSerialComm to listen for LISTENING_EVENT_PORT_DISCONNECTED events and see if maybe this event gets thrown when that kernel error occurs. If so, you might be able to reconnect immediately when that happens. If no event is detected, then I'm not sure there's anything that can be done about it from the library...

In the past few weeks I have investigated a bit further and on Windows it detects the connection loss properly, but not on Linux.
I've also experimented with the serial package in Rust and it detects the connection loss too and throws an error.

I will try your suggestion, thanks.

Any update on this issue? Also, could you please test with the newest library version (2.10.1) as it has some updates to the flow control configuration code under-the-hood.

I test it within the next two weeks and will inform you

Hi,

2.10.1 has not fixed the issue without modification.
However, the LISTENING_EVENT_PORT_DISCONNECTED introduced in 2.8.0 works perfectly.
The event is triggered as soon as I provoke that the USB device loses connection. I can then restart the serial communication part of our software.

Thanks