Closed CharlesOkwuagwu closed 3 years ago
Hi @CharlesOkwuagwu!
Regarding whether this was intentional or not, I don't recall having open
take so long before either working or returning an error. Since I don't work hardly at all on Windows these days, it might be a new behavior with dealing with some serial ports.
In any case, I certainly wouldn't oppose having a settable timeout on open
. I just wonder if something else is happening and perhaps an error should be detected and returned earlier. Do you have any idea why the open
is taking so long on your system?
I see this happen mainly on application restarts when maybe the modem had been in use prior and is just re-initializing itself.
What I then do is delay 30 seconds then retry the open, which always works.
Setup
circuits_uart.open
command has no way to configure atimeout
, the default 4000ms always applies, and the error below might be avoidable if we could configure a longer or flexible timeout say.https://github.com/elixir-circuits/circuits_uart/blob/7181819bfce930de2c51c6b8a0991d1d4a461892/lib/circuits_uart.ex#L552
Provision to supply a timeout to
call_port
is not given fromopen
.Was that intentional?