Open kreasteve opened 1 year ago
The note in the doc says (https://docs.circuitpython.org/en/latest/shared-bindings/usb_cdc/index.html#usb_cdc.Serial.connected):
The host is considered to be connected if it is asserting DTR (Data Terminal Ready). Most terminal programs and pyserial assert DTR when opening a serial connection. However, the C# SerialPort API does not. You must set
SerialPort.DtrEnable
.
This is an idiosyncrasy of the C# API. So if your C# code does not set SerialPort.DtrEnable
, .connected
with not be true, and the behavior will be exactly you said:
No data is received if DTR is not active.
The tuple
reference is wrong -- that's from an older beta version of the API, sorry.
If you are saying that the Note about DTR should also say that no data is delivered if DTR is not asserted, that would be a fine additin.
I have a project where circuitpython is communicating with a c# program. I do not use usb_cdc.Serial.connected
and it don't work with the normal read methods without DTR. This is confusing me, because it works until 7.3.3.
The change comes from #7100 that was originally for an issue where using the serial channels too early would cause a crash, so it checks for a connection. The result is that we get a situation where there's something in the buffer, but it can't be read if nothing is connected.
I commented on that here: https://github.com/adafruit/circuitpython/issues/7456#issuecomment-1383495476 (I intended to open an issue for a discussion on that, but I wanted to do some tests first with different configurations and didn't come back to it)
CircuitPython version
Code/REPL
Behavior
No data is received if DTR is not active.
The note in https://docs.circuitpython.org/en/latest/shared-bindings/usb_cdc/index.html#usb_cdc.Serial.connected seems to relate to the whole thing, not only on
usb_cdc.Serial.connected
.Maybe you want to update the documentation.
I tried and searched a bunch of things but I can't get it working without DTR.
Description
I'm using hterm and c# and have this issue since the versions newer as 7.3.3
Additional information
And related to
in https://docs.circuitpython.org/en/latest/shared-bindings/usb_cdc/index.html#usb_cdc.Serial
I never found an
usb_cdc.serials
tuple. I get the Serial object fromusb_cdc.data